mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-01-02 19:14:14 +00:00
ea02d8a9a5
Moves the bootstrap code into main derivation because it’s only used there, and this helps let the main derivation decide when to evaluate it in the first place (depending on the system), which helps on Hydra. Not actually enabled by default on any systems yet.
30 lines
830 B
Nix
30 lines
830 B
Nix
{ lib, stdenv, fetchurl, makeWrapper, cfg }:
|
|
|
|
stdenv.mkDerivation rec {
|
|
pname = "sbcl-bootstrap";
|
|
inherit (cfg) version;
|
|
|
|
src = fetchurl {
|
|
url = "mirror://sourceforge/project/sbcl/sbcl/${version}/sbcl-${version}-${cfg.system}-binary.tar.bz2";
|
|
inherit (cfg) sha256;
|
|
};
|
|
|
|
nativeBuildInputs = [ makeWrapper ];
|
|
|
|
installPhase = ''
|
|
mkdir -p $out/bin
|
|
cp -p src/runtime/sbcl $out/bin
|
|
|
|
mkdir -p $out/share/sbcl
|
|
cp -p src/runtime/sbcl $out/share/sbcl
|
|
cp -p output/sbcl.core $out/share/sbcl
|
|
mkdir -p $out/bin
|
|
makeWrapper $out/share/sbcl/sbcl $out/bin/sbcl \
|
|
--add-flags "--core $out/share/sbcl/sbcl.core"
|
|
'';
|
|
|
|
postFixup = lib.optionalString (!stdenv.isAarch32 && stdenv.isLinux) ''
|
|
patchelf --set-interpreter $(cat $NIX_CC/nix-support/dynamic-linker) $out/share/sbcl/sbcl
|
|
'';
|
|
}
|