1
1
Fork 0
mirror of https://github.com/NixOS/nix.git synced 2025-12-03 23:51:00 +01:00
nix/src/libstore-test-support/package.nix
Sergei Zimmerman fbffd47fb7 build(lib{expr,store,util}-test-support): depend on -c libraries
Since lib{expr,store,util}-test-support subprojects define nix_api_* helpers
for testing nix c bindings, they need to publicly depend on -c counterparts.
This makes their headers self-sufficient and does not rely on the -tests to add
necessary dependencies.
2024-11-24 09:53:10 +00:00

62 lines
1.1 KiB
Nix

{ lib
, stdenv
, mkMesonLibrary
, nix-util-test-support
, nix-store
, nix-store-c
, rapidcheck
# Configuration Options
, version
}:
let
inherit (lib) fileset;
in
mkMesonLibrary (finalAttrs: {
pname = "nix-store-test-support";
inherit version;
workDir = ./.;
fileset = fileset.unions [
../../build-utils-meson
./build-utils-meson
../../.version
./.version
./meson.build
# ./meson.options
(fileset.fileFilter (file: file.hasExt "cc") ./.)
(fileset.fileFilter (file: file.hasExt "hh") ./.)
];
propagatedBuildInputs = [
nix-util-test-support
nix-store
nix-store-c
rapidcheck
];
preConfigure =
# "Inline" .version so it's not a symlink, and includes the suffix.
# Do the meson utils, without modification.
''
chmod u+w ./.version
echo ${version} > ../../.version
'';
mesonFlags = [
];
env = lib.optionalAttrs (stdenv.isLinux && !(stdenv.hostPlatform.isStatic && stdenv.system == "aarch64-linux")) {
LDFLAGS = "-fuse-ld=gold";
};
meta = {
platforms = lib.platforms.unix ++ lib.platforms.windows;
};
})