mirror of
https://github.com/NixOS/nix
synced 2025-07-04 15:31:47 +02:00
Fix a footgun. In my case, I had a couple of build ("output") directories sitting around. rm -rf build-* Was confused for a bit why a meson.build file was missing. Probably also helps with autocompletion. I tried meson-build-support first, but I had to add something like a nix- prefix, in order to make meson happy. They've reserved the meson- prefix.
62 lines
1.1 KiB
Nix
62 lines
1.1 KiB
Nix
{ lib
|
|
, stdenv
|
|
, mkMesonLibrary
|
|
|
|
, nix-store-test-support
|
|
, nix-expr
|
|
, nix-expr-c
|
|
|
|
, rapidcheck
|
|
|
|
# Configuration Options
|
|
|
|
, version
|
|
}:
|
|
|
|
let
|
|
inherit (lib) fileset;
|
|
in
|
|
|
|
mkMesonLibrary (finalAttrs: {
|
|
pname = "nix-util-test-support";
|
|
inherit version;
|
|
|
|
workDir = ./.;
|
|
fileset = fileset.unions [
|
|
../../nix-meson-build-support
|
|
./nix-meson-build-support
|
|
../../.version
|
|
./.version
|
|
./meson.build
|
|
# ./meson.options
|
|
(fileset.fileFilter (file: file.hasExt "cc") ./.)
|
|
(fileset.fileFilter (file: file.hasExt "hh") ./.)
|
|
];
|
|
|
|
propagatedBuildInputs = [
|
|
nix-store-test-support
|
|
nix-expr
|
|
nix-expr-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;
|
|
};
|
|
|
|
})
|