nix/tests/unit/libutil-support/package.nix

80 lines
1.3 KiB
Nix
Raw Normal View History

{ lib
, stdenv
2024-07-01 18:36:46 +00:00
, mkMesonDerivation
, releaseTools
, meson
, ninja
, pkg-config
, nix-util
, rapidcheck
# Configuration Options
2024-07-06 15:36:31 +00:00
, version
}:
let
inherit (lib) fileset;
in
2024-07-01 18:36:46 +00:00
mkMesonDerivation (finalAttrs: {
pname = "nix-util-test-support";
inherit version;
2024-07-01 18:36:46 +00:00
workDir = ./.;
fileset = fileset.unions [
../../../build-utils-meson
2024-07-01 18:36:46 +00:00
./build-utils-meson
../../../.version
2024-07-01 18:36:46 +00:00
./.version
./meson.build
# ./meson.options
(fileset.fileFilter (file: file.hasExt "cc") ./.)
(fileset.fileFilter (file: file.hasExt "hh") ./.)
];
outputs = [ "out" "dev" ];
nativeBuildInputs = [
meson
ninja
pkg-config
];
propagatedBuildInputs = [
nix-util
2024-06-27 21:44:34 +00:00
rapidcheck
];
preConfigure =
2024-06-27 23:19:32 +00:00
# "Inline" .version so it's not a symlink, and includes the suffix.
# Do the meson utils, without modification.
''
2024-07-01 18:36:46 +00:00
chmod u+w ./.version
echo ${version} > ../../../.version
'';
mesonFlags = [
];
env = lib.optionalAttrs (stdenv.isLinux && !(stdenv.hostPlatform.isStatic && stdenv.system == "aarch64-linux")) {
LDFLAGS = "-fuse-ld=gold";
};
enableParallelBuilding = true;
separateDebugInfo = !stdenv.hostPlatform.isStatic;
2024-07-01 18:36:46 +00:00
strictDeps = true;
hardeningDisable = lib.optional stdenv.hostPlatform.isStatic "pie";
meta = {
platforms = lib.platforms.unix ++ lib.platforms.windows;
};
})