Merge pull request #263065 from hraban/sbcl-bootstrap-from-clisp

sbcl: bootstrap from CLISP on supported systems

authored by

7c6f434c and committed by
GitHub
37ee83ed 7654cf09

+60 -68
+57 -6
pkgs/development/compilers/sbcl/2.x.nix
··· 1 - { lib, stdenv, fetchurl, fetchpatch, writeText, sbclBootstrap, zstd 2 - , sbclBootstrapHost ? "${sbclBootstrap}/bin/sbcl --disable-debugger --no-userinit --no-sysinit" 1 + { lib, stdenv, callPackage, clisp, fetchurl, fetchpatch, writeText, zstd 3 2 , threadSupport ? (stdenv.hostPlatform.isx86 || "aarch64-linux" == stdenv.hostPlatform.system || "aarch64-darwin" == stdenv.hostPlatform.system) 4 3 , linkableRuntime ? stdenv.hostPlatform.isx86 5 4 , disableImmobileSpace ? false ··· 26 25 sha256 = "sha256-fSiakSMgIgKL8BKJAMMr8A5MVDDDLyivBZTIpZKphlQ="; 27 26 }; 28 27 }; 28 + # Collection of pre-built SBCL binaries for platforms that need them for 29 + # bootstrapping. Ideally these are to be avoided. If CLISP (or any other 30 + # non-binary-distributed Lisp) can run on any of these systems, that entry 31 + # should be removed from this list. 32 + bootstrapBinaries = rec { 33 + # This build segfaults using CLISP. 34 + x86_64-darwin = { 35 + version = "2.2.9"; 36 + system = "x86-64-darwin"; 37 + sha256 = "sha256-b1BLkoLIOELAYBYA9eBmMgm1OxMxJewzNP96C9ADfKY="; 38 + }; 39 + i686-linux = { 40 + version = "1.2.7"; 41 + system = "x86-linux"; 42 + sha256 = "07f3bz4br280qvn85i088vpzj9wcz8wmwrf665ypqx181pz2ai3j"; 43 + }; 44 + armv7l-linux = { 45 + version = "1.2.14"; 46 + system = "armhf-linux"; 47 + sha256 = "0sp5445rbvms6qvzhld0kwwvydw51vq5iaf4kdqsf2d9jvaz3yx5"; 48 + }; 49 + armv6l-linux = armv7l-linux; 50 + x86_64-freebsd = { 51 + version = "1.2.7"; 52 + system = "x86-64-freebsd"; 53 + sha256 = "14k42xiqd2rrim4pd5k5pjcrpkac09qnpynha8j1v4jngrvmw7y6"; 54 + }; 55 + x86_64-solaris = { 56 + version = "1.2.7"; 57 + system = "x86-64-solaris"; 58 + sha256 = "05c12fmac4ha72k1ckl6i780rckd7jh4g5s5hiic7fjxnf1kx8d0"; 59 + }; 60 + }; 61 + sbclBootstrap = callPackage ./bootstrap.nix { 62 + cfg = bootstrapBinaries.${stdenv.hostPlatform.system}; 63 + }; 64 + bootstrapLisp = 65 + if (builtins.hasAttr stdenv.hostPlatform.system bootstrapBinaries) 66 + then "${sbclBootstrap}/bin/sbcl --disable-debugger --no-userinit --no-sysinit" 67 + else "${clisp}/bin/clisp -E UTF-8 --silent -norc"; 29 68 30 - in with versionMap.${version}; 69 + in 31 70 32 71 stdenv.mkDerivation rec { 33 72 pname = "sbcl"; ··· 35 74 36 75 src = fetchurl { 37 76 url = "mirror://sourceforge/project/sbcl/sbcl/${version}/${pname}-${version}-source.tar.bz2"; 38 - inherit sha256; 77 + inherit (versionMap.${version}) sha256; 39 78 }; 40 79 41 80 nativeBuildInputs = [ texinfo ]; ··· 108 147 buildPhase = '' 109 148 runHook preBuild 110 149 111 - sh make.sh --prefix=$out --xc-host="${sbclBootstrapHost}" ${ 150 + sh make.sh --prefix=$out --xc-host="${bootstrapLisp}" ${ 112 151 lib.concatStringsSep " " 113 152 (builtins.map (x: "--with-${x}") enableFeatures ++ 114 153 builtins.map (x: "--without-${x}") disableFeatures) ··· 142 181 } 143 182 ''); 144 183 145 - meta = sbclBootstrap.meta; 184 + meta = with lib; { 185 + description = "Lisp compiler"; 186 + homepage = "https://sbcl.org"; 187 + license = licenses.publicDomain; # and FreeBSD 188 + maintainers = lib.teams.lisp.members; 189 + platforms = attrNames bootstrapBinaries ++ [ 190 + # These aren’t bootstrapped using the binary distribution but compiled 191 + # using a separate (lisp) host 192 + "x86_64-linux" 193 + "aarch64-darwin" 194 + "aarch64-linux" 195 + ]; 196 + }; 146 197 }
+3 -58
pkgs/development/compilers/sbcl/bootstrap.nix
··· 1 - { lib, stdenv, fetchurl, makeWrapper }: 1 + { lib, stdenv, fetchurl, makeWrapper, cfg }: 2 2 3 - let 4 - options = rec { 5 - aarch64-darwin = { 6 - version = "2.1.2"; 7 - system = "arm64-darwin"; 8 - sha256 = "sha256-H0ALigXcWIypdA+fTf7jERscwbb7QIAfcoxCtGDh0RU="; 9 - }; 10 - x86_64-darwin = { 11 - version = "2.2.9"; 12 - system = "x86-64-darwin"; 13 - sha256 = "sha256-b1BLkoLIOELAYBYA9eBmMgm1OxMxJewzNP96C9ADfKY="; 14 - }; 15 - x86_64-linux = { 16 - version = "1.3.16"; 17 - system = "x86-64-linux"; 18 - sha256 = "0sq2dylwwyqfwkbdvcgqwz3vay9v895zpb0fyzsiwy31d1x9pr2s"; 19 - }; 20 - i686-linux = { 21 - version = "1.2.7"; 22 - system = "x86-linux"; 23 - sha256 = "07f3bz4br280qvn85i088vpzj9wcz8wmwrf665ypqx181pz2ai3j"; 24 - }; 25 - aarch64-linux = { 26 - version = "1.3.16"; 27 - system = "arm64-linux"; 28 - sha256 = "0q1brz9c49xgdljzfx8rpxxnlwhadxkcy5kg0mcd9wnxygind1cl"; 29 - }; 30 - armv7l-linux = { 31 - version = "1.2.14"; 32 - system = "armhf-linux"; 33 - sha256 = "0sp5445rbvms6qvzhld0kwwvydw51vq5iaf4kdqsf2d9jvaz3yx5"; 34 - }; 35 - armv6l-linux = armv7l-linux; 36 - x86_64-freebsd = { 37 - version = "1.2.7"; 38 - system = "x86-64-freebsd"; 39 - sha256 = "14k42xiqd2rrim4pd5k5pjcrpkac09qnpynha8j1v4jngrvmw7y6"; 40 - }; 41 - x86_64-solaris = { 42 - version = "1.2.7"; 43 - system = "x86-64-solaris"; 44 - sha256 = "05c12fmac4ha72k1ckl6i780rckd7jh4g5s5hiic7fjxnf1kx8d0"; 45 - }; 46 - }; 47 - cfg = options.${stdenv.hostPlatform.system}; 48 - in 49 - assert builtins.hasAttr stdenv.hostPlatform.system options; 50 3 stdenv.mkDerivation rec { 51 4 pname = "sbcl-bootstrap"; 52 - version = cfg.version; 5 + inherit (cfg) version; 53 6 54 7 src = fetchurl { 55 8 url = "mirror://sourceforge/project/sbcl/sbcl/${version}/sbcl-${version}-${cfg.system}-binary.tar.bz2"; 56 - sha256 = cfg.sha256; 9 + inherit (cfg) sha256; 57 10 }; 58 11 59 12 nativeBuildInputs = [ makeWrapper ]; ··· 73 26 postFixup = lib.optionalString (!stdenv.isAarch32 && stdenv.isLinux) '' 74 27 patchelf --set-interpreter $(cat $NIX_CC/nix-support/dynamic-linker) $out/share/sbcl/sbcl 75 28 ''; 76 - 77 - meta = with lib; { 78 - description = "Lisp compiler"; 79 - homepage = "http://www.sbcl.org"; 80 - license = licenses.publicDomain; # and FreeBSD 81 - maintainers = lib.teams.lisp.members; 82 - platforms = attrNames options; 83 - }; 84 29 }
-4
pkgs/top-level/all-packages.nix
··· 26035 26035 }; 26036 26036 26037 26037 # Steel Bank Common Lisp 26038 - sbclBootstrap = wrapLisp { 26039 - pkg = callPackage ../development/compilers/sbcl/bootstrap.nix {}; 26040 - faslExt = "fasl"; 26041 - }; 26042 26038 sbcl_2_3_8 = wrapLisp { 26043 26039 pkg = callPackage ../development/compilers/sbcl/2.x.nix { version = "2.3.8"; }; 26044 26040 faslExt = "fasl";