1
0
Fork 0
mirror of https://github.com/NixOS/nix synced 2025-07-06 21:41:48 +02:00

perl: Rewrite build system using Meson

This commit is contained in:
polar 2024-04-25 14:20:05 +01:00 committed by John Ericson
parent b406cf9b81
commit fc1d9023a2
9 changed files with 299 additions and 201 deletions

View file

@ -1,47 +1,52 @@
{ lib, fileset
{ lib
, fileset
, stdenv
, perl, perlPackages
, autoconf-archive, autoreconfHook, pkg-config
, nix, curl, bzip2, xz, boost, libsodium, darwin
, 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 {
root = ../.;
root = ./.;
fileset = fileset.unions ([
../.version
../m4
../mk
./MANIFEST
./Makefile
./Makefile.config.in
./configure.ac
./lib
./local.mk
./meson.build
./meson_options.txt
] ++ lib.optionals finalAttrs.doCheck [
./.yath.rc
./t
]);
};
nativeBuildInputs =
[ autoconf-archive
autoreconfHook
pkg-config
];
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;
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;
@ -50,12 +55,16 @@ perl.pkgs.toPerlModule (stdenv.mkDerivation (finalAttrs: {
perlPackages.Test2Harness
];
configureFlags = [
"--with-dbi=${perlPackages.DBI}/${perl.libPrefix}"
"--with-dbd-sqlite=${perlPackages.DBDSQLite}/${perl.libPrefix}"
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)
];
mesonCheckFlags = [
"--print-errorlogs"
];
enableParallelBuilding = true;
postUnpack = "sourceRoot=$sourceRoot/perl";
}))