1{
2 lib,
3 stdenv,
4 mkMesonDerivation,
5 pkg-config,
6 perl,
7 perlPackages,
8 nix-store,
9 version,
10 curl,
11 bzip2,
12 libsodium,
13}:
14
15perl.pkgs.toPerlModule (
16 mkMesonDerivation (finalAttrs: {
17 pname = "nix-perl";
18 inherit version;
19
20 workDir = ./.;
21
22 nativeBuildInputs = [
23 pkg-config
24 perl
25 curl
26 ];
27
28 buildInputs = [
29 nix-store
30 ]
31 ++ finalAttrs.passthru.externalBuildInputs;
32
33 # Hack for sake of the dev shell
34 passthru.externalBuildInputs = [
35 bzip2
36 libsodium
37 ];
38
39 # `perlPackages.Test2Harness` is marked broken for Darwin
40 doCheck = !stdenv.isDarwin;
41
42 nativeCheckInputs = [
43 perlPackages.Test2Harness
44 ];
45
46 preConfigure =
47 # "Inline" .version so its not a symlink, and includes the suffix
48 ''
49 chmod u+w .version
50 echo ${finalAttrs.version} > .version
51 '';
52
53 mesonFlags = [
54 (lib.mesonOption "dbi_path" "${perlPackages.DBI}/${perl.libPrefix}")
55 (lib.mesonOption "dbd_sqlite_path" "${perlPackages.DBDSQLite}/${perl.libPrefix}")
56 (lib.mesonEnable "tests" finalAttrs.finalPackage.doCheck)
57 ];
58
59 mesonCheckFlags = [
60 "--print-errorlogs"
61 ];
62
63 strictDeps = false;
64 })
65)