nix-perl: Add deps, use mkMesonDerivation

This commit is contained in:
Robert Hensing 2024-07-06 17:47:11 +02:00
parent 4c014e238b
commit efd5f50f5e

View file

@ -1,5 +1,6 @@
{ lib
, stdenv
, mkMesonDerivation
, perl
, perlPackages
, meson
@ -8,19 +9,23 @@
, nix-store
, darwin
, versionSuffix ? ""
, curl
, bzip2
, libsodium
}:
let
inherit (lib) fileset;
in
perl.pkgs.toPerlModule (stdenv.mkDerivation (finalAttrs: {
perl.pkgs.toPerlModule (mkMesonDerivation (finalAttrs: {
pname = "nix-perl";
version = lib.fileContents ./.version + versionSuffix;
src = fileset.toSource {
root = ./.;
workDir = ./.;
fileset = fileset.unions ([
./.version
../../.version
./MANIFEST
./lib
./meson.build
@ -29,17 +34,19 @@ perl.pkgs.toPerlModule (stdenv.mkDerivation (finalAttrs: {
./.yath.rc.in
./t
]);
};
nativeBuildInputs = [
meson
ninja
pkg-config
perl
curl
];
buildInputs = [
nix-store
bzip2
libsodium
];
# `perlPackages.Test2Harness` is marked broken for Darwin
@ -52,6 +59,7 @@ perl.pkgs.toPerlModule (stdenv.mkDerivation (finalAttrs: {
preConfigure =
# "Inline" .version so its not a symlink, and includes the suffix
''
chmod u+w .version
echo ${finalAttrs.version} > .version
'';