Commit 532bb82d authored by Rhys-T's avatar Rhys-T
Browse files

picolisp: fix darwin build

Also use the default `buildPhase` to let `makeFlags` etc. work, and
change the deprecated `substituteInPlace --replace` to `--replace-fail`.
parent 576f2c93
Loading
Loading
Loading
Loading
+11 −5
Original line number Diff line number Diff line
@@ -29,9 +29,15 @@ stdenv.mkDerivation {
    readline
  ];
  sourceRoot = ''pil21'';
  buildPhase = ''
  preBuild =
    ''
      cd src
    make
    ''
    + lib.optionalString stdenv.hostPlatform.isDarwin ''
      # Flags taken from instructions at: https://picolisp.com/wiki/?alternativeMacOSRepository
      makeFlagsArray+=(
        SHARED='-dynamiclib -undefined dynamic_lookup'
      )
    '';

  installPhase = ''
@@ -42,7 +48,7 @@ stdenv.mkDerivation {
    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/picolisp.1" "$out/man/picolisp.1"
    substituteInPlace $out/bin/pil --replace /usr $out
    substituteInPlace $out/bin/pil --replace-fail /usr $out
  '';

  meta = with lib; {