diff options
Diffstat (limited to 'pkgs/development/interpreters/perl/5.16/default.nix')
-rw-r--r-- | pkgs/development/interpreters/perl/5.16/default.nix | 35 |
1 files changed, 31 insertions, 4 deletions
diff --git a/pkgs/development/interpreters/perl/5.16/default.nix b/pkgs/development/interpreters/perl/5.16/default.nix index a3ab0ef4b96f..a8c175453037 100644 --- a/pkgs/development/interpreters/perl/5.16/default.nix +++ b/pkgs/development/interpreters/perl/5.16/default.nix @@ -6,6 +6,10 @@ let in +with { + inherit (stdenv.lib) optional optionalString; +}; + stdenv.mkDerivation rec { name = "perl-5.16.3"; @@ -18,7 +22,8 @@ stdenv.mkDerivation rec { [ # Do not look in /usr etc. for dependencies. ./no-sys-dirs.patch ] - ++ stdenv.lib.optionals stdenv.isDarwin [ ./cpp-precomp.patch ./no-libutil.patch ] ; + ++ optional stdenv.isSunOS ./ld-shared.patch + ++ stdenv.lib.optional stdenv.isDarwin [ ./cpp-precomp.patch ./no-libutil.patch ] ; # Build a thread-safe Perl with a dynamic libperls.o. We need the # "installstyle" option to ensure that modules are put under @@ -34,7 +39,7 @@ stdenv.mkDerivation rec { "-Dlocincpth=${libc}/include" "-Dloclibpth=${libc}/lib" ] - ++ stdenv.lib.optional (stdenv ? glibc) "-Dusethreads"; + ++ optional (stdenv ? glibc) "-Dusethreads"; configureScript = "${stdenv.shell} ./Configure"; @@ -46,12 +51,12 @@ stdenv.mkDerivation rec { '' configureFlags="$configureFlags -Dprefix=$out -Dman1dir=$out/share/man/man1 -Dman3dir=$out/share/man/man3" - ${stdenv.lib.optionalString stdenv.isArm '' + ${optionalString stdenv.isArm '' configureFlagsArray=(-Dldflags="-lm -lrt") ''} ''; - preBuild = stdenv.lib.optionalString (!(stdenv ? gcc && stdenv.gcc.nativeTools)) + preBuild = optionalString (!(stdenv ? gcc && stdenv.gcc.nativeTools)) '' # Make Cwd work on NixOS (where we don't have a /bin/pwd). substituteInPlace dist/Cwd/Cwd.pm --replace "'/bin/pwd'" "'$(type -tP pwd)'" @@ -59,5 +64,27 @@ stdenv.mkDerivation rec { setupHook = ./setup-hook.sh; + doCheck = !stdenv.isDarwin; + + # some network-related tests don't work, mostly probably due to our sandboxing + testsToSkip = '' + lib/Net/hostent.t \ + dist/IO/t/{io_multihomed.t,io_sock.t} \ + t/porting/{maintainers.t,regen.t} \ + cpan/Socket/t/get{name,addr}info.t \ + '' + optionalString stdenv.isFreeBSD '' + cpan/CPANPLUS/t/04_CPANPLUS-Module.t \ + cpan/CPANPLUS/t/20_CPANPLUS-Dist-MM.t \ + '' + " "; + + postPatch = optionalString (!stdenv.isDarwin) /* this failed on Darwin, no idea why */ '' + for test in ${testsToSkip}; do + echo "Removing test" $test + rm "$test" + pat=`echo "$test" | sed 's,/,\\\\/,g'` # just escape slashes + sed "/^$pat/d" -i MANIFEST + done + ''; + passthru.libPrefix = "lib/perl5/site_perl"; } |