From 89d450493911948489d8334a0d815e8ff2b46c05 Mon Sep 17 00:00:00 2001 From: James Fleming Date: Wed, 17 Feb 2021 11:12:47 +0100 Subject: [PATCH 1/4] 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. --- pkgs/development/compilers/sbcl/common.nix | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/pkgs/development/compilers/sbcl/common.nix b/pkgs/development/compilers/sbcl/common.nix index 2e162ed5a2ef..fac39d6c2ce1 100644 --- a/pkgs/development/compilers/sbcl/common.nix +++ b/pkgs/development/compilers/sbcl/common.nix @@ -22,11 +22,7 @@ stdenv.mkDerivation rec { buildInputs = [texinfo]; - patchPhase = '' - echo '"${version}.nixos"' > version.lisp-expr - - pwd - + postPatch = '' # SBCL checks whether files are up-to-date in many places.. # Unfortunately, same timestamp is not good enough 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" ]; buildPhase = '' + runHook preBuild + sh make.sh --prefix=$out --xc-host="${sbclBootstrapHost}" ${ lib.concatStringsSep " " (builtins.map (x: "--with-${x}") enableFeatures ++ builtins.map (x: "--without-${x}") disableFeatures) } (cd doc/manual ; make info) + + runHook postBuild ''; installPhase = '' + runHook preInstall + INSTALL_ROOT=$out sh install.sh + + runHook postInstall '' + lib.optionalString (!purgeNixReferences) '' cp -r src $out/lib/sbcl From 6aa7dbe16116076ed5206fa77b0bfccd5642db65 Mon Sep 17 00:00:00 2001 From: James Fleming Date: Sat, 20 Feb 2021 11:36:55 +0100 Subject: [PATCH 2/4] sbcl: Remove substution of 'gcc' with 'cc' This substitution produces a nix-build warning, because the target string was removed in commit 7b225df9a492977b8fff0948ce93c5ab31766f64 in 2016. Remove the substition from the `postPatch` phase in `sbcl/common.nix`. --- pkgs/development/compilers/sbcl/common.nix | 3 --- 1 file changed, 3 deletions(-) diff --git a/pkgs/development/compilers/sbcl/common.nix b/pkgs/development/compilers/sbcl/common.nix index fac39d6c2ce1..669b9bc480bd 100644 --- a/pkgs/development/compilers/sbcl/common.nix +++ b/pkgs/development/compilers/sbcl/common.nix @@ -40,9 +40,6 @@ stdenv.mkDerivation rec { sed -e '5,$d' -i contrib/sb-bsd-sockets/tests.lisp sed -e '5,$d' -i contrib/sb-simple-streams/*test*.lisp - # Use whatever `cc` the stdenv provides - substituteInPlace src/runtime/Config.x86-64-darwin --replace gcc cc - substituteInPlace src/runtime/Config.x86-64-darwin \ --replace mmacosx-version-min=10.4 mmacosx-version-min=10.5 '' From 7485a007d941ca6e3f3388343869363b10b35d79 Mon Sep 17 00:00:00 2001 From: James Fleming Date: Sat, 20 Feb 2021 11:40:09 +0100 Subject: [PATCH 3/4] sbcl: Remove substitution of mmacosx-verson-min This substition produces a nixos-build error, because the target string was removed in commit 323891ea5964d54aba2d272ddddbf748ce353176 in 2018. Remove the substition from the `postPatch` phase of `sbcl/common.nix`. --- pkgs/development/compilers/sbcl/common.nix | 3 --- 1 file changed, 3 deletions(-) diff --git a/pkgs/development/compilers/sbcl/common.nix b/pkgs/development/compilers/sbcl/common.nix index 669b9bc480bd..207fc54d70cb 100644 --- a/pkgs/development/compilers/sbcl/common.nix +++ b/pkgs/development/compilers/sbcl/common.nix @@ -39,9 +39,6 @@ stdenv.mkDerivation rec { # Fix the tests sed -e '5,$d' -i contrib/sb-bsd-sockets/tests.lisp sed -e '5,$d' -i contrib/sb-simple-streams/*test*.lisp - - substituteInPlace src/runtime/Config.x86-64-darwin \ - --replace mmacosx-version-min=10.4 mmacosx-version-min=10.5 '' + (if purgeNixReferences then From 2b20453a39d3278d97c7f224a81588c8ffd88661 Mon Sep 17 00:00:00 2001 From: James Fleming Date: Sat, 20 Feb 2021 15:08:23 +0100 Subject: [PATCH 4/4] sbcl: Resume creating version.lisp-expr file Reverse the recent commit that removed this line. --- pkgs/development/compilers/sbcl/common.nix | 2 ++ 1 file changed, 2 insertions(+) diff --git a/pkgs/development/compilers/sbcl/common.nix b/pkgs/development/compilers/sbcl/common.nix index 207fc54d70cb..11ae960a5317 100644 --- a/pkgs/development/compilers/sbcl/common.nix +++ b/pkgs/development/compilers/sbcl/common.nix @@ -23,6 +23,8 @@ stdenv.mkDerivation rec { buildInputs = [texinfo]; postPatch = '' + echo '"${version}.nixos"' > version.lisp-expr + # SBCL checks whether files are up-to-date in many places.. # Unfortunately, same timestamp is not good enough sed -e 's@> x y@>= x y@' -i contrib/sb-aclrepl/repl.lisp