janet: the nix sandbox doesn't have /usr/bin/env

This commit is contained in:
Peter Hoeg 2021-07-05 18:29:16 +08:00
parent b7f6d6d344
commit 11b1684c8e

View file

@ -11,7 +11,20 @@ stdenv.mkDerivation rec {
sha256 = "sha256-TzJbHmHIySlf3asQ02HOdehMR+s0KkPifBiaQ4FvFCg=";
};
# we don't have /usr/bin/env in the sandbox, so substitute for a proper,
# absolute path to janet
postPatch = ''
substituteInPlace jpm \
--replace '/usr/bin/env janet' $out/bin/janet \
--replace /usr/local/lib/janet $out/lib \
--replace /usr/local $out
substituteInPlace janet.1 \
--replace /usr/local/lib/janet $out/lib
'';
nativeBuildInputs = [ meson ninja ];
mesonFlags = [ "-Dgit_hash=release" ];
doCheck = true;
@ -20,7 +33,7 @@ stdenv.mkDerivation rec {
description = "Janet programming language";
homepage = "https://janet-lang.org/";
license = licenses.mit;
maintainers = with maintainers; [ andrewchambers peterhoeg ];
platforms = platforms.all;
maintainers = with maintainers; [ andrewchambers ];
};
}