picolisp: fix darwin build

Also use the default `buildPhase` to let `makeFlags` etc. work, and
change the deprecated `substituteInPlace --replace` to `--replace-fail`.
This commit is contained in:
Rhys-T 2025-02-26 14:54:07 -05:00
parent 576f2c9301
commit 532bb82d5a

View file

@ -29,10 +29,16 @@ stdenv.mkDerivation {
readline readline
]; ];
sourceRoot = ''pil21''; sourceRoot = ''pil21'';
buildPhase = '' preBuild =
cd src ''
make cd src
''; ''
+ lib.optionalString stdenv.hostPlatform.isDarwin ''
# Flags taken from instructions at: https://picolisp.com/wiki/?alternativeMacOSRepository
makeFlagsArray+=(
SHARED='-dynamiclib -undefined dynamic_lookup'
)
'';
installPhase = '' installPhase = ''
cd .. cd ..
@ -42,7 +48,7 @@ stdenv.mkDerivation {
ln -s "$out/lib/picolisp/bin/pil" "$out/bin/pil" ln -s "$out/lib/picolisp/bin/pil" "$out/bin/pil"
ln -s "$out/lib/picolisp/man/man1/pil.1" "$out/man/pil.1" ln -s "$out/lib/picolisp/man/man1/pil.1" "$out/man/pil.1"
ln -s "$out/lib/picolisp/man/man1/picolisp.1" "$out/man/picolisp.1" ln -s "$out/lib/picolisp/man/man1/picolisp.1" "$out/man/picolisp.1"
substituteInPlace $out/bin/pil --replace /usr $out substituteInPlace $out/bin/pil --replace-fail /usr $out
''; '';
meta = with lib; { meta = with lib; {