Skip to content

Commit

Permalink
Add nixUnstable.perl-bindings
Browse files Browse the repository at this point in the history
  • Loading branch information
edolstra committed Apr 11, 2017
1 parent 3dd66ec commit 29b415d
Showing 1 changed file with 29 additions and 8 deletions.
37 changes: 29 additions & 8 deletions pkgs/tools/package-management/nix/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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 ]
Expand All @@ -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}"
];

Expand Down Expand Up @@ -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";
Expand All @@ -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 {
Expand All @@ -129,6 +150,6 @@ in rec {
sha256 = "0mf7y7hvzw2x5dp482qy8774djr3vzcjaqq58cp82zdil8l7kwjd";
};
fromGit = true;
});
})) // { perl-bindings = perl-bindings { nix = nixUnstable; }; };

}

1 comment on commit 29b415d

@copumpkin
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yay!

Please sign in to comment.