Merge pull request #145020 from risicle/ris-moarvm-darwin

moarvm: fix build for darwin
This commit is contained in:
Domen Kožar 2021-11-09 23:01:29 -06:00 committed by GitHub
commit f86959efea
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

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