about summary refs log tree commit diff
path: root/pkgs/development/interpreters/perl
diff options
context:
space:
mode:
authorVladimír Čunát <vcunat@gmail.com>2015-06-18 22:23:55 +0200
committerVladimír Čunát <vcunat@gmail.com>2015-06-18 22:38:08 +0200
commit61596bf405de245c71630101869ea3f4e8f8a20a (patch)
treee712933bc34d25aba42b99907f879b5251585b29 /pkgs/development/interpreters/perl
parent8e19ac8d7cc7018613ff51d9266dea81547df756 (diff)
parentfe75f160324672d639469dc2da69f70d4eb466a4 (diff)
downloadnixlib-61596bf405de245c71630101869ea3f4e8f8a20a.tar
nixlib-61596bf405de245c71630101869ea3f4e8f8a20a.tar.gz
nixlib-61596bf405de245c71630101869ea3f4e8f8a20a.tar.bz2
nixlib-61596bf405de245c71630101869ea3f4e8f8a20a.tar.lz
nixlib-61596bf405de245c71630101869ea3f4e8f8a20a.tar.xz
nixlib-61596bf405de245c71630101869ea3f4e8f8a20a.tar.zst
nixlib-61596bf405de245c71630101869ea3f4e8f8a20a.zip
Merge #8363: pure-darwin stdenv
Diffstat (limited to 'pkgs/development/interpreters/perl')
-rw-r--r--pkgs/development/interpreters/perl/5.16/default.nix11
-rw-r--r--pkgs/development/interpreters/perl/5.20/default.nix11
2 files changed, 22 insertions, 0 deletions
diff --git a/pkgs/development/interpreters/perl/5.16/default.nix b/pkgs/development/interpreters/perl/5.16/default.nix
index 9ed3aa54f517..568025edfd4c 100644
--- a/pkgs/development/interpreters/perl/5.16/default.nix
+++ b/pkgs/development/interpreters/perl/5.16/default.nix
@@ -24,6 +24,17 @@ stdenv.mkDerivation rec {
     ++ lib.optional stdenv.isSunOS  ./ld-shared.patch
     ++ lib.optional stdenv.isDarwin [ ./cpp-precomp.patch ./no-libutil.patch ] ;
 
+  # There's an annoying bug on sandboxed Darwin in Perl's Cwd.pm where it looks for pwd
+  # in /bin/pwd and /usr/bin/pwd and then falls back on just "pwd" if it can't get them
+  # while at the same time erasing the PATH environment variable so it unconditionally
+  # fails. The code in question is guarded by a check for Mac OS, but the patch below
+  # doesn't have any runtime effect on other platforms.
+  postPatch = ''
+    pwd="$(type -P pwd)"
+    substituteInPlace dist/Cwd/Cwd.pm \
+      --replace "pwd_cmd = 'pwd'" "pwd_cmd = '$pwd'"
+  '';
+
   # Build a thread-safe Perl with a dynamic libperls.o.  We need the
   # "installstyle" option to ensure that modules are put under
   # $out/lib/perl5 - this is the general default, but because $out
diff --git a/pkgs/development/interpreters/perl/5.20/default.nix b/pkgs/development/interpreters/perl/5.20/default.nix
index 7651bc15f469..8cb07621ef16 100644
--- a/pkgs/development/interpreters/perl/5.20/default.nix
+++ b/pkgs/development/interpreters/perl/5.20/default.nix
@@ -37,6 +37,17 @@ stdenv.mkDerivation rec {
     ++ optional stdenv.isSunOS ./ld-shared.patch
     ++ stdenv.lib.optional stdenv.isDarwin [ ./cpp-precomp.patch ./no-libutil.patch ] ;
 
+  # There's an annoying bug on sandboxed Darwin in Perl's Cwd.pm where it looks for pwd
+  # in /bin/pwd and /usr/bin/pwd and then falls back on just "pwd" if it can't get them
+  # while at the same time erasing the PATH environment variable so it unconditionally
+  # fails. The code in question is guarded by a check for Mac OS, but the patch below
+  # doesn't have any runtime effect on other platforms.
+  postPatch = ''
+    pwd="$(type -P pwd)"
+    substituteInPlace dist/PathTools/Cwd.pm \
+      --replace "pwd_cmd = 'pwd'" "pwd_cmd = '$pwd'"
+  '';
+
   # Build a thread-safe Perl with a dynamic libperls.o.  We need the
   # "installstyle" option to ensure that modules are put under
   # $out/lib/perl5 - this is the general default, but because $out