Skip to content

Commit

Permalink
Support arbitrary stores in Perl bindings
Browse files Browse the repository at this point in the history
Fix NixOS#9859

It's a breaking change but that's fine; we can just update Hydra to use
the new bindings.
  • Loading branch information
Ericson2314 committed Jan 26, 2024
1 parent 30bdee5 commit 06ed01a
Show file tree
Hide file tree
Showing 6 changed files with 189 additions and 79 deletions.
2 changes: 2 additions & 0 deletions perl/.yath.rc
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[test]
-I=rel(lib/Nix)
17 changes: 13 additions & 4 deletions perl/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@
, nix, curl, bzip2, xz, boost, libsodium, darwin
}:

perl.pkgs.toPerlModule (stdenv.mkDerivation {
perl.pkgs.toPerlModule (stdenv.mkDerivation (finalAttrs: {
name = "nix-perl-${nix.version}";

src = fileset.toSource {
root = ../.;
fileset = fileset.unions [
fileset = fileset.unions ([
../.version
../m4
../mk
Expand All @@ -20,7 +20,10 @@ perl.pkgs.toPerlModule (stdenv.mkDerivation {
./configure.ac
./lib
./local.mk
];
] ++ lib.optionals finalAttrs.doCheck [
./.yath.rc
./t
]);
};

nativeBuildInputs =
Expand All @@ -40,6 +43,12 @@ perl.pkgs.toPerlModule (stdenv.mkDerivation {
++ lib.optional (stdenv.isLinux || stdenv.isDarwin) libsodium
++ lib.optional stdenv.isDarwin darwin.apple_sdk.frameworks.Security;

doCheck = true;

nativeCheckInputs = [
perlPackages.Test2Harness
];

configureFlags = [
"--with-dbi=${perlPackages.DBI}/${perl.libPrefix}"
"--with-dbd-sqlite=${perlPackages.DBDSQLite}/${perl.libPrefix}"
Expand All @@ -48,4 +57,4 @@ perl.pkgs.toPerlModule (stdenv.mkDerivation {
enableParallelBuilding = true;

postUnpack = "sourceRoot=$sourceRoot/perl";
})
}))
19 changes: 11 additions & 8 deletions perl/lib/Nix/Store.pm
Original file line number Diff line number Diff line change
Expand Up @@ -12,17 +12,20 @@ our %EXPORT_TAGS = ( 'all' => [ qw( ) ] );
our @EXPORT_OK = ( @{ $EXPORT_TAGS{'all'} } );

our @EXPORT = qw(
setVerbosity
isValidPath queryReferences queryPathInfo queryDeriver queryPathHash
queryPathFromHashPart
topoSortPaths computeFSClosure followLinksToStorePath exportPaths importPaths
Store
Store::new
Store::isValidPath Store::queryReferences Store::queryPathInfo Store::queryDeriver Store::queryPathHash
Store::queryPathFromHashPart
Store::topoSortPaths Store::computeFSClosure followLinksToStorePath Store::exportPaths Store::importPaths
Store::addToStore Store::makeFixedOutputPath
Store::derivationFromPath
Store::addTempRoot
Store::queryRawRealisation
hashPath hashFile hashString convertHash
signString checkSignature
addToStore makeFixedOutputPath
derivationFromPath
addTempRoot
getBinDir getStoreDir
queryRawRealisation
setVerbosity
);

our $VERSION = '0.15';
Expand Down
Loading

0 comments on commit 06ed01a

Please sign in to comment.