Perl generic builder: Put man pages in a separate output

This commit is contained in:
Eelco Dolstra 2013-08-26 12:04:56 +02:00
parent 977a1df79a
commit a7b1aa429e
2 changed files with 13 additions and 4 deletions

View File

@ -28,6 +28,13 @@ preConfigure() {
perl Makefile.PL PREFIX=$out INSTALLDIRS=site $makeMakerFlags
}
preFixup() {
if [ -n "$man" ]; then
mkdir -p $man/share
if [ -d $out/man ]; then mv $out/man $man/share/; fi
fi
}
postFixup() {
# If a user installs a Perl package, she probably also wants its
# dependencies in the user environment (since Perl modules don't

View File

@ -1,13 +1,15 @@
perl:
{ buildInputs ? [], ... } @ attrs:
{ buildInputs ? [], name, ... } @ attrs:
perl.stdenv.mkDerivation (
{
outputs = [ "out" "man" ];
doCheck = true;
checkTarget = "test";
# Prevent CPAN downloads.
PERL_AUTOINSTALL = "--skipdeps";
@ -20,7 +22,7 @@ perl.stdenv.mkDerivation (
attrs
//
{
name = "perl-" + attrs.name;
name = "perl-" + name;
builder = ./builder.sh;
buildInputs = buildInputs ++ [ perl ];
}