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