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" ];
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 ];
buildInputs = [ curl openssl sqlite xz ]
@ -43,12 +44,12 @@ let
[ "--with-store-dir=${storeDir}"
"--localstatedir=${stateDir}"
"--sysconfdir=/etc"
"--with-dbi=${perlPackages.DBI}/${perl.libPrefix}"
"--with-dbd-sqlite=${perlPackages.DBDSQLite}/${perl.libPrefix}"
"--disable-init-state"
"--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}"
];
@ -97,13 +98,33 @@ let
maintainers = [ stdenv.lib.maintainers.eelco ];
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 {
nix = nixStable;
nixStable = common rec {
nixStable = (common rec {
name = "nix-1.11.8";
src = fetchurl {
url = "http://nixos.org/releases/nix/${name}/${name}.tar.xz";
@ -117,9 +138,9 @@ in rec {
--replace 'std::less<Symbol>, gc_allocator<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}";
suffix = "pre5152_915f62fa";
src = fetchFromGitHub {
@ -129,6 +150,6 @@ in rec {
sha256 = "0mf7y7hvzw2x5dp482qy8774djr3vzcjaqq58cp82zdil8l7kwjd";
};
fromGit = true;
});
})) // { perl-bindings = perl-bindings { nix = nixUnstable; }; };
}