nix/perl/default.nix

71 lines
1.3 KiB
Nix
Raw Normal View History

2024-04-25 13:20:05 +00:00
{ lib
, fileset
, stdenv
2024-04-25 13:20:05 +00:00
, perl
, perlPackages
, meson
, ninja
, pkg-config
, nix
, curl
, bzip2
, xz
, boost
, libsodium
, darwin
}:
perl.pkgs.toPerlModule (stdenv.mkDerivation (finalAttrs: {
name = "nix-perl-${nix.version}";
src = fileset.toSource {
2024-04-25 13:20:05 +00:00
root = ./.;
fileset = fileset.unions ([
./MANIFEST
./lib
2024-04-25 13:20:05 +00:00
./meson.build
./meson_options.txt
] ++ lib.optionals finalAttrs.doCheck [
./.yath.rc.in
./t
]);
};
2024-04-25 13:20:05 +00:00
nativeBuildInputs = [
meson
ninja
pkg-config
];
buildInputs = [
nix
curl
bzip2
xz
perl
boost
]
++ lib.optional (stdenv.isLinux || stdenv.isDarwin) libsodium
++ lib.optional stdenv.isDarwin darwin.apple_sdk.frameworks.Security;
# `perlPackages.Test2Harness` is marked broken for Darwin
doCheck = !stdenv.isDarwin;
nativeCheckInputs = [
perlPackages.Test2Harness
];
2024-04-25 13:20:05 +00:00
mesonFlags = [
(lib.mesonOption "version" (builtins.readFile ../.version))
(lib.mesonOption "dbi_path" "${perlPackages.DBI}/${perl.libPrefix}")
(lib.mesonOption "dbd_sqlite_path" "${perlPackages.DBDSQLite}/${perl.libPrefix}")
(lib.mesonEnable "tests" finalAttrs.doCheck)
];
2024-04-25 13:20:05 +00:00
mesonCheckFlags = [
"--print-errorlogs"
];
2024-04-25 13:20:05 +00:00
enableParallelBuilding = true;
}))