From b0f20dad57200c86f6b13b7780eedf6196884d42 Mon Sep 17 00:00:00 2001 From: Robert Scott Date: Sun, 7 Nov 2021 22:32:06 +0000 Subject: [PATCH] moarvm: fix build for darwin --- pkgs/development/interpreters/rakudo/moarvm.nix | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/pkgs/development/interpreters/rakudo/moarvm.nix b/pkgs/development/interpreters/rakudo/moarvm.nix index e4c070107bde..b8ed60c69a99 100644 --- a/pkgs/development/interpreters/rakudo/moarvm.nix +++ b/pkgs/development/interpreters/rakudo/moarvm.nix @@ -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