From b9049bff6dae594faf5dff17b21587532693848b Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Tue, 11 Jun 2013 18:02:07 +0200 Subject: [PATCH] perl: Split off the manpages (7 MiB) --- pkgs/build-support/multiple-outputs.nix | 31 ++++++++++++++++--- .../interpreters/perl/5.16/default.nix | 6 +++- pkgs/top-level/all-packages.nix | 1 + 3 files changed, 32 insertions(+), 6 deletions(-) diff --git a/pkgs/build-support/multiple-outputs.nix b/pkgs/build-support/multiple-outputs.nix index e72bc7fd3db..edf24a12511 100644 --- a/pkgs/build-support/multiple-outputs.nix +++ b/pkgs/build-support/multiple-outputs.nix @@ -14,7 +14,7 @@ stdenv.mkDerivation (args // { configureFlags="--mandir=$man/share/man $configureFlags" '' + optionalString (elem "bin" outputs) '' - configureFlags="--bindir=$bin/bin --mandir=$bin/share/man $configureFlags" + configureFlags="--bindir=$bin/bin --sbindir=$bin/sbin --mandir=$bin/share/man $configureFlags" '' + optionalString (elem "lib" outputs) '' configureFlags="--libdir=$lib/lib $configureFlags" @@ -52,10 +52,31 @@ stdenv.mkDerivation (args // { propagatedNativeBuildInputs="$lib $propagatedNativeBuildsInputs" fi - for i in $bin $lib; do - prefix="$i" stripDirs "lib lib64 libexec bin sbin" "''${stripDebugFlags:--S}" - prefix="$i" patchELF - patchShebangs "$i" + for i in $bin $lib $man $static; do + if [ -z "$dontStrip" ]; then + prefix="$i" stripDirs "lib lib64 libexec bin sbin" "''${stripDebugFlags:--S}" + fi + if [ "$havePatchELF" = 1 -a -z "$dontPatchELF" ]; then + prefix="$i" patchELF + fi + if [ -z "$dontPatchShebangs" ]; then + patchShebangs "$i" + fi + + # Cut&paste... + if [ -z "$dontGzipMan" ]; then + GLOBIGNORE=.:..:*.gz:*.bz2 + for f in $i/share/man/*/* $i/share/man/*/*/*; do + if [ -f $f ]; then + if gzip -c $f > $f.gz; then + rm $f + else + rm $f.gz + fi + fi + done + unset GLOBIGNORE + fi done runHook postFixupOutputs diff --git a/pkgs/development/interpreters/perl/5.16/default.nix b/pkgs/development/interpreters/perl/5.16/default.nix index 288de63b4ae..f53641c4137 100644 --- a/pkgs/development/interpreters/perl/5.16/default.nix +++ b/pkgs/development/interpreters/perl/5.16/default.nix @@ -14,6 +14,10 @@ stdenv.mkDerivation rec { sha256 = "03nh8bqnjsdd5izjv3n2yfcxw4ck0llwww36jpbjbjgixwpqpy4f"; }; + outputs = [ "out" "man" ]; + + setOutputConfigureFlags = false; + patches = [ # Do not look in /usr etc. for dependencies. ./no-sys-dirs.patch @@ -44,7 +48,7 @@ stdenv.mkDerivation rec { preConfigure = '' - configureFlags="$configureFlags -Dprefix=$out -Dman1dir=$out/share/man/man1 -Dman3dir=$out/share/man/man3" + configureFlags="$configureFlags -Dprefix=$out -Dman1dir=$man/share/man/man1 -Dman3dir=$man/share/man/man3" ${stdenv.lib.optionalString stdenv.isArm '' configureFlagsArray=(-Dldflags="-lm -lrt") diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index d9475684a25..cc7477950f6 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -2969,6 +2969,7 @@ let perl514 = callPackage ../development/interpreters/perl/5.14 { }; perl516 = callPackage ../development/interpreters/perl/5.16 { + stdenv = stdenvMulti; fetchurl = fetchurlBoot; };