sbcl: Small fixes around the phase definitions

- Remove some debugging output at the start of the `patchPhase` section,
  which appears to have outlived its value.
- Rename `patchPhase` to `postPatch`, to avoid preventing people adding
  patches via the `patches` variable.
- Add `preBuild` and `postBuild` run-hooks to the `buildPhase` section.
- Add `preInstall` and `postInstall` run-hooks to the `installPhase`
  section.
This commit is contained in:
James Fleming 2021-02-17 11:12:47 +01:00
parent 2fe492c198
commit 89d4504939

View File

@ -22,11 +22,7 @@ stdenv.mkDerivation rec {
buildInputs = [texinfo]; buildInputs = [texinfo];
patchPhase = '' postPatch = ''
echo '"${version}.nixos"' > version.lisp-expr
pwd
# SBCL checks whether files are up-to-date in many places.. # SBCL checks whether files are up-to-date in many places..
# Unfortunately, same timestamp is not good enough # Unfortunately, same timestamp is not good enough
sed -e 's@> x y@>= x y@' -i contrib/sb-aclrepl/repl.lisp sed -e 's@> x y@>= x y@' -i contrib/sb-aclrepl/repl.lisp
@ -81,16 +77,24 @@ stdenv.mkDerivation rec {
optionals disableImmobileSpace [ "immobile-space" "immobile-code" "compact-instance-header" ]; optionals disableImmobileSpace [ "immobile-space" "immobile-code" "compact-instance-header" ];
buildPhase = '' buildPhase = ''
runHook preBuild
sh make.sh --prefix=$out --xc-host="${sbclBootstrapHost}" ${ sh make.sh --prefix=$out --xc-host="${sbclBootstrapHost}" ${
lib.concatStringsSep " " lib.concatStringsSep " "
(builtins.map (x: "--with-${x}") enableFeatures ++ (builtins.map (x: "--with-${x}") enableFeatures ++
builtins.map (x: "--without-${x}") disableFeatures) builtins.map (x: "--without-${x}") disableFeatures)
} }
(cd doc/manual ; make info) (cd doc/manual ; make info)
runHook postBuild
''; '';
installPhase = '' installPhase = ''
runHook preInstall
INSTALL_ROOT=$out sh install.sh INSTALL_ROOT=$out sh install.sh
runHook postInstall
'' ''
+ lib.optionalString (!purgeNixReferences) '' + lib.optionalString (!purgeNixReferences) ''
cp -r src $out/lib/sbcl cp -r src $out/lib/sbcl