2024-06-28 01:09:32 +03:00
|
|
|
{ lib
|
|
|
|
, stdenv
|
2024-07-01 21:36:46 +03:00
|
|
|
, mkMesonDerivation
|
2024-06-28 01:09:32 +03:00
|
|
|
, releaseTools
|
|
|
|
|
|
|
|
, meson
|
|
|
|
, ninja
|
|
|
|
, pkg-config
|
|
|
|
|
|
|
|
, nix-fetchers
|
|
|
|
, nix-store-test-support
|
|
|
|
|
|
|
|
, rapidcheck
|
|
|
|
, gtest
|
|
|
|
, runCommand
|
|
|
|
|
|
|
|
# Configuration Options
|
|
|
|
|
|
|
|
, versionSuffix ? ""
|
|
|
|
}:
|
|
|
|
|
|
|
|
let
|
|
|
|
inherit (lib) fileset;
|
|
|
|
|
|
|
|
version = lib.fileContents ./.version + versionSuffix;
|
|
|
|
in
|
|
|
|
|
2024-07-01 21:36:46 +03:00
|
|
|
mkMesonDerivation (finalAttrs: {
|
2024-06-29 17:31:08 +03:00
|
|
|
pname = "nix-fetchers-tests";
|
2024-06-28 01:09:32 +03:00
|
|
|
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-28 01:09:32 +03:00
|
|
|
|
|
|
|
outputs = [ "out" "dev" ];
|
|
|
|
|
|
|
|
nativeBuildInputs = [
|
|
|
|
meson
|
|
|
|
ninja
|
|
|
|
pkg-config
|
|
|
|
];
|
|
|
|
|
|
|
|
buildInputs = [
|
|
|
|
nix-fetchers
|
|
|
|
nix-store-test-support
|
|
|
|
rapidcheck
|
|
|
|
gtest
|
|
|
|
];
|
|
|
|
|
|
|
|
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-28 01:09:32 +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-28 01:09:32 +03:00
|
|
|
'';
|
|
|
|
|
|
|
|
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 21:36:46 +03:00
|
|
|
strictDeps = true;
|
2024-06-28 01:09:32 +03:00
|
|
|
|
|
|
|
hardeningDisable = lib.optional stdenv.hostPlatform.isStatic "pie";
|
|
|
|
|
|
|
|
passthru = {
|
|
|
|
tests = {
|
|
|
|
run = runCommand "${finalAttrs.pname}-run" {
|
|
|
|
} ''
|
|
|
|
PATH="${lib.makeBinPath [ finalAttrs.finalPackage ]}:$PATH"
|
|
|
|
export _NIX_TEST_UNIT_DATA=${./data}
|
2024-06-29 17:31:08 +03:00
|
|
|
nix-fetchers-tests
|
2024-06-28 01:09:32 +03:00
|
|
|
touch $out
|
|
|
|
'';
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
meta = {
|
|
|
|
platforms = lib.platforms.unix ++ lib.platforms.windows;
|
|
|
|
};
|
|
|
|
|
|
|
|
})
|