Add nixUnstable.perl-bindings

This commit is contained in:
Eelco Dolstra 2017-04-11 15:36:51 +02:00
parent 3dd66ec6e9
commit 29b415dcdb
No known key found for this signature in database
GPG Key ID: 8170B4726D7198DE

View File

@ -16,7 +16,8 @@ let
outputs = [ "out" "dev" "man" "doc" ]; outputs = [ "out" "dev" "man" "doc" ];
nativeBuildInputs = nativeBuildInputs =
[ perl pkgconfig ] [ pkgconfig ]
++ lib.optionals (!lib.versionAtLeast version "1.12pre") [ perl ]
++ lib.optionals fromGit [ autoreconfHook autoconf-archive bison flex libxml2 libxslt docbook5 docbook5_xsl ]; ++ lib.optionals fromGit [ autoreconfHook autoconf-archive bison flex libxml2 libxslt docbook5 docbook5_xsl ];
buildInputs = [ curl openssl sqlite xz ] buildInputs = [ curl openssl sqlite xz ]
@ -43,12 +44,12 @@ let
[ "--with-store-dir=${storeDir}" [ "--with-store-dir=${storeDir}"
"--localstatedir=${stateDir}" "--localstatedir=${stateDir}"
"--sysconfdir=/etc" "--sysconfdir=/etc"
"--with-dbi=${perlPackages.DBI}/${perl.libPrefix}"
"--with-dbd-sqlite=${perlPackages.DBDSQLite}/${perl.libPrefix}"
"--disable-init-state" "--disable-init-state"
"--enable-gc" "--enable-gc"
] ]
++ lib.optional (!lib.versionAtLeast version "1.12pre") [ ++ lib.optionals (!lib.versionAtLeast version "1.12pre") [
"--with-dbi=${perlPackages.DBI}/${perl.libPrefix}"
"--with-dbd-sqlite=${perlPackages.DBDSQLite}/${perl.libPrefix}"
"--with-www-curl=${perlPackages.WWWCurl}/${perl.libPrefix}" "--with-www-curl=${perlPackages.WWWCurl}/${perl.libPrefix}"
]; ];
@ -97,13 +98,33 @@ let
maintainers = [ stdenv.lib.maintainers.eelco ]; maintainers = [ stdenv.lib.maintainers.eelco ];
platforms = stdenv.lib.platforms.all; platforms = stdenv.lib.platforms.all;
}; };
passthru = { inherit fromGit; };
};
perl-bindings = { nix }: stdenv.mkDerivation {
name = "nix-perl-" + nix.version;
inherit (nix) src;
postUnpack = "sourceRoot=$sourceRoot/perl";
nativeBuildInputs =
[ perl pkgconfig curl nix libsodium ]
++ lib.optionals nix.fromGit [ autoreconfHook autoconf-archive ];
configureFlags =
[ "--with-dbi=${perlPackages.DBI}/${perl.libPrefix}"
"--with-dbd-sqlite=${perlPackages.DBDSQLite}/${perl.libPrefix}"
"--with-www-curl=${perlPackages.WWWCurl}/${perl.libPrefix}"
];
}; };
in rec { in rec {
nix = nixStable; nix = nixStable;
nixStable = common rec { nixStable = (common rec {
name = "nix-1.11.8"; name = "nix-1.11.8";
src = fetchurl { src = fetchurl {
url = "http://nixos.org/releases/nix/${name}/${name}.tar.xz"; url = "http://nixos.org/releases/nix/${name}/${name}.tar.xz";
@ -117,9 +138,9 @@ in rec {
--replace 'std::less<Symbol>, gc_allocator<Value *>' \ --replace 'std::less<Symbol>, gc_allocator<Value *>' \
'std::less<Symbol>, gc_allocator<std::pair<const Symbol, Value *> >' 'std::less<Symbol>, gc_allocator<std::pair<const Symbol, Value *> >'
''; '';
}; }) // { perl-bindings = nixStable; };
nixUnstable = lib.lowPrio (common rec { nixUnstable = (lib.lowPrio (common rec {
name = "nix-1.12${suffix}"; name = "nix-1.12${suffix}";
suffix = "pre5152_915f62fa"; suffix = "pre5152_915f62fa";
src = fetchFromGitHub { src = fetchFromGitHub {
@ -129,6 +150,6 @@ in rec {
sha256 = "0mf7y7hvzw2x5dp482qy8774djr3vzcjaqq58cp82zdil8l7kwjd"; sha256 = "0mf7y7hvzw2x5dp482qy8774djr3vzcjaqq58cp82zdil8l7kwjd";
}; };
fromGit = true; fromGit = true;
}); })) // { perl-bindings = perl-bindings { nix = nixUnstable; }; };
} }