@@ -10,6 +10,17 @@ stdenv.mkDerivation rec {
1010 sha256 = "sha256-fzSHpw6Ld74OTi8SsUxJ9qAdA3jglAyGlYyQFsSVrXU=";
1111 };
1212
13+ postPatch = ''
14+ patchShebangs .
15+ '' + lib.optionalString stdenv.isDarwin ''
16+ substituteInPlace Configure.pl \
17+ --replace '`/usr/bin/arch`' '"${stdenv.hostPlatform.darwinArch}"' \
18+ --replace '/usr/bin/arch' "$(type -P true)" \
19+ --replace '/usr/' '/nope/'
20+ substituteInPlace 3rdparty/dyncall/configure \
21+ --replace '`sw_vers -productVersion`' '"$MACOSX_DEPLOYMENT_TARGET"'
22+ '';
23+
1324 buildInputs = [ perl ] ++ lib.optionals stdenv.isDarwin [ CoreServices ApplicationServices ];
1425 doCheck = false; # MoarVM does not come with its own test suite
1526