From f047ae82cdacd93187cb8477992dc2c209f99f5a Mon Sep 17 00:00:00 2001 From: Brian Leung Date: Fri, 6 Aug 2021 19:54:12 -0700 Subject: [PATCH] mit-scheme: 10.1.10 -> 11.2 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Add ncurses as a propagated build input. Add ghostscript, autoconf, and libtool as native build inputs. Add epsf and texinfo to the texLive closure. Support aarch64 Linux, and remove support for i686 Linux. Co-authored-by: Sandro Jäckel --- .../compilers/mit-scheme/default.nix | 73 +++++++++++-------- pkgs/top-level/all-packages.nix | 6 +- 2 files changed, 42 insertions(+), 37 deletions(-) diff --git a/pkgs/development/compilers/mit-scheme/default.nix b/pkgs/development/compilers/mit-scheme/default.nix index 8cf709c10aea..e7098abb60af 100644 --- a/pkgs/development/compilers/mit-scheme/default.nix +++ b/pkgs/development/compilers/mit-scheme/default.nix @@ -1,12 +1,15 @@ { fetchurl, lib, stdenv, makeWrapper, gnum4, texinfo, texLive, automake, - enableX11 ? false, xlibsWrapper ? null }: + autoconf, libtool, ghostscript, ncurses, + enableX11 ? false, xlibsWrapper }: let - version = "10.1.10"; - bootstrapFromC = ! (stdenv.isi686 || stdenv.isx86_64); + version = "11.2"; + bootstrapFromC = ! ((stdenv.isLinux && stdenv.isAarch64) || stdenv.isx86_64); - arch = if stdenv.isi686 then "-i386" - else "-x86-64"; + arch = if stdenv.isLinux && stdenv.isAarch64 then + "-aarch64le" + else + "-x86-64"; in stdenv.mkDerivation { name = if enableX11 then "mit-scheme-x11-${version}" else "mit-scheme-${version}"; @@ -16,49 +19,55 @@ stdenv.mkDerivation { # leads to more efficient code than when building the tarball that contains # generated C code instead of those binaries. src = - if stdenv.isi686 + if stdenv.isLinux && stdenv.isAarch64 then fetchurl { - url = "mirror://gnu/mit-scheme/stable.pkg/${version}/mit-scheme-${version}-i386.tar.gz"; - sha256 = "117lf06vcdbaa5432hwqnskpywc6x8ai0gj99h480a4wzkp3vhy6"; + url = "mirror://gnu/mit-scheme/stable.pkg/${version}/mit-scheme-${version}-aarch64le.tar.gz"; + sha256 = "11maixldk20wqb5js5p4imq221zz9nf27649v9pqkdf8fv7rnrs9"; } else fetchurl { url = "mirror://gnu/mit-scheme/stable.pkg/${version}/mit-scheme-${version}-x86-64.tar.gz"; - sha256 = "1rljv6iddrbssm91c0nn08myj92af36hkix88cc6qwq38xsxs52g"; + sha256 = "17822hs9y07vcviv2af17p3va7qh79dird49nj50bwi9rz64ia3w"; }; - buildInputs = if enableX11 then [xlibsWrapper] else []; + buildInputs = [ ncurses ] ++ lib.optional enableX11 xlibsWrapper; - configurePhase = - '' (cd src && ./configure) - (cd doc && ./configure) - ''; + configurePhase = '' + runHook preConfigure + (cd src && ./configure) + (cd doc && ./configure) + runHook postConfigure + ''; - buildPhase = - '' cd src - ${if bootstrapFromC - then "./etc/make-liarc.sh --prefix=$out" - else "make compile-microcode"} + buildPhase = '' + runHook preBuild + cd src - cd ../doc + ${if bootstrapFromC + then "./etc/make-liarc.sh --prefix=$out" + else "make compile-microcode"} - # Provide a `texinfo.tex'. - export TEXINPUTS="$(echo ${automake}/share/automake-*)" - echo "\$TEXINPUTS is \`$TEXINPUTS'" - make + cd ../doc - cd .. - ''; + make - installPhase = - '' make prefix=$out install -C src - make prefix=$out install -C doc - ''; + cd .. - fixupPhase = + runHook postBuild + ''; + + + installPhase = '' + runHook preInstall + make prefix=$out install -C src + make prefix=$out install -C doc + runHook postInstall + ''; + + postFixup = '' wrapProgram $out/bin/mit-scheme${arch} --set MITSCHEME_LIBRARY_PATH \ $out/lib/mit-scheme${arch} ''; - nativeBuildInputs = [ makeWrapper gnum4 texinfo texLive automake ]; + nativeBuildInputs = [ makeWrapper gnum4 texinfo texLive automake ghostscript autoconf libtool ]; # XXX: The `check' target doesn't exist. doCheck = false; diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 090a0461680e..26131df52c59 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -11926,14 +11926,10 @@ in mint = callPackage ../development/compilers/mint { }; mitscheme = callPackage ../development/compilers/mit-scheme { - texLive = texlive.combine { inherit (texlive) scheme-small; }; - texinfo = texinfo5; - xlibsWrapper = null; + texLive = texlive.combine { inherit (texlive) scheme-small epsf texinfo; }; }; mitschemeX11 = mitscheme.override { - texLive = texlive.combine { inherit (texlive) scheme-small; }; - texinfo = texinfo5; enableX11 = true; };