mirror of
https://github.com/NixOS/nix.git
synced 2025-11-17 16:02:43 +01:00
Integrate perl with the other meson builds
One big dev shell!
This commit is contained in:
parent
e0b4691754
commit
a83d95e26e
20 changed files with 52 additions and 27 deletions
77
src/perl/package.nix
Normal file
77
src/perl/package.nix
Normal file
|
|
@ -0,0 +1,77 @@
|
|||
{ lib
|
||||
, fileset
|
||||
, stdenv
|
||||
, perl
|
||||
, perlPackages
|
||||
, meson
|
||||
, ninja
|
||||
, pkg-config
|
||||
, nix-store
|
||||
, curl
|
||||
, bzip2
|
||||
, xz
|
||||
, boost
|
||||
, libsodium
|
||||
, darwin
|
||||
, versionSuffix ? ""
|
||||
}:
|
||||
|
||||
perl.pkgs.toPerlModule (stdenv.mkDerivation (finalAttrs: {
|
||||
pname = "nix-perl";
|
||||
version = lib.fileContents ./.version + versionSuffix;
|
||||
|
||||
src = fileset.toSource {
|
||||
root = ./.;
|
||||
fileset = fileset.unions ([
|
||||
./MANIFEST
|
||||
./lib
|
||||
./meson.build
|
||||
./meson.options
|
||||
] ++ lib.optionals finalAttrs.doCheck [
|
||||
./.yath.rc.in
|
||||
./t
|
||||
]);
|
||||
};
|
||||
|
||||
nativeBuildInputs = [
|
||||
meson
|
||||
ninja
|
||||
pkg-config
|
||||
];
|
||||
|
||||
buildInputs = [
|
||||
nix-store
|
||||
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
|
||||
];
|
||||
|
||||
preConfigure =
|
||||
# "Inline" .version so its not a symlink, and includes the suffix
|
||||
''
|
||||
echo ${finalAttrs.version} > .version
|
||||
'';
|
||||
|
||||
mesonFlags = [
|
||||
(lib.mesonOption "dbi_path" "${perlPackages.DBI}/${perl.libPrefix}")
|
||||
(lib.mesonOption "dbd_sqlite_path" "${perlPackages.DBDSQLite}/${perl.libPrefix}")
|
||||
(lib.mesonEnable "tests" finalAttrs.doCheck)
|
||||
];
|
||||
|
||||
mesonCheckFlags = [
|
||||
"--print-errorlogs"
|
||||
];
|
||||
|
||||
enableParallelBuilding = true;
|
||||
}))
|
||||
Loading…
Add table
Add a link
Reference in a new issue