2024-04-25 16:20:05 +03:00
|
|
|
{ lib
|
|
|
|
, fileset
|
2023-10-13 18:00:55 +03:00
|
|
|
, stdenv
|
2024-04-25 16:20:05 +03:00
|
|
|
, perl
|
|
|
|
, perlPackages
|
|
|
|
, meson
|
|
|
|
, ninja
|
|
|
|
, pkg-config
|
|
|
|
, nix
|
|
|
|
, curl
|
|
|
|
, bzip2
|
|
|
|
, xz
|
|
|
|
, boost
|
|
|
|
, libsodium
|
|
|
|
, darwin
|
2023-10-13 18:00:55 +03:00
|
|
|
}:
|
|
|
|
|
2024-01-26 22:54:33 +02:00
|
|
|
perl.pkgs.toPerlModule (stdenv.mkDerivation (finalAttrs: {
|
2023-10-13 18:00:55 +03:00
|
|
|
name = "nix-perl-${nix.version}";
|
|
|
|
|
|
|
|
src = fileset.toSource {
|
2024-04-25 16:20:05 +03:00
|
|
|
root = ./.;
|
2024-01-26 22:54:33 +02:00
|
|
|
fileset = fileset.unions ([
|
2023-10-13 18:00:55 +03:00
|
|
|
./MANIFEST
|
|
|
|
./lib
|
2024-04-25 16:20:05 +03:00
|
|
|
./meson.build
|
|
|
|
./meson_options.txt
|
2024-01-26 22:54:33 +02:00
|
|
|
] ++ lib.optionals finalAttrs.doCheck [
|
2024-04-25 23:07:00 +03:00
|
|
|
./.yath.rc.in
|
2024-01-26 22:54:33 +02:00
|
|
|
./t
|
|
|
|
]);
|
2023-10-13 18:00:55 +03:00
|
|
|
};
|
|
|
|
|
2024-04-25 16:20:05 +03: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;
|
2023-10-13 18:00:55 +03:00
|
|
|
|
2024-01-26 22:54:33 +02:00
|
|
|
# `perlPackages.Test2Harness` is marked broken for Darwin
|
|
|
|
doCheck = !stdenv.isDarwin;
|
|
|
|
|
|
|
|
nativeCheckInputs = [
|
|
|
|
perlPackages.Test2Harness
|
|
|
|
];
|
|
|
|
|
2024-04-25 16:20:05 +03: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)
|
2023-10-13 18:00:55 +03:00
|
|
|
];
|
|
|
|
|
2024-04-25 16:20:05 +03:00
|
|
|
mesonCheckFlags = [
|
|
|
|
"--print-errorlogs"
|
|
|
|
];
|
2023-10-13 18:00:55 +03:00
|
|
|
|
2024-04-25 16:20:05 +03:00
|
|
|
enableParallelBuilding = true;
|
2024-01-26 22:54:33 +02:00
|
|
|
}))
|