diff options
author | Jörg Thalheim <joerg@thalheim.io> | 2023-11-24 08:40:52 +0100 |
---|---|---|
committer | adisbladis <adisbladis@gmail.com> | 2023-11-29 03:38:53 +1300 |
commit | c953c85b9ebdd2773f95180254ec9429cb1426f8 (patch) | |
tree | b613b80166b4baf0d2cd5d7e5bef92a3682c3e78 /pkgs/by-name/ni | |
parent | 869da636fea368dccc4331355894778f64c4a9bb (diff) | |
download | nixlib-c953c85b9ebdd2773f95180254ec9429cb1426f8.tar nixlib-c953c85b9ebdd2773f95180254ec9429cb1426f8.tar.gz nixlib-c953c85b9ebdd2773f95180254ec9429cb1426f8.tar.bz2 nixlib-c953c85b9ebdd2773f95180254ec9429cb1426f8.tar.lz nixlib-c953c85b9ebdd2773f95180254ec9429cb1426f8.tar.xz nixlib-c953c85b9ebdd2773f95180254ec9429cb1426f8.tar.zst nixlib-c953c85b9ebdd2773f95180254ec9429cb1426f8.zip |
nix-unit: init at 2.18.0
This is now used by several projects including dream2nix. Having not to compile from source is a big win.
Diffstat (limited to 'pkgs/by-name/ni')
-rw-r--r-- | pkgs/by-name/ni/nix-unit/package.nix | 57 |
1 files changed, 57 insertions, 0 deletions
diff --git a/pkgs/by-name/ni/nix-unit/package.nix b/pkgs/by-name/ni/nix-unit/package.nix new file mode 100644 index 000000000000..a9f1b7105c29 --- /dev/null +++ b/pkgs/by-name/ni/nix-unit/package.nix @@ -0,0 +1,57 @@ +{ stdenv +, lib +, boost +, clang-tools +, cmake +, difftastic +, makeWrapper +, meson +, ninja +, nixVersions +, nlohmann_json +, pkg-config +, fetchFromGitHub +}: + +stdenv.mkDerivation (finalAttrs: { + pname = "nix-unit"; + version = "2.18.0"; + + src = fetchFromGitHub { + owner = "nix-community"; + repo = "nix-unit"; + rev = "v${finalAttrs.version}"; + hash = "sha256-9wq14p+85oW4HlD42NJ0jyA++z3nEYjFQ6uT40xdfbc="; + }; + + buildInputs = [ + nlohmann_json + # We pin the nix version to a known working one here as upgrades can likely break the build. + # Since the nix language is rather stable we don't always need to have the latest and greatest for unit tests + # On each update of nix unit we should re-evaluate what version we need. + nixVersions.nix_2_18 + boost + ]; + + nativeBuildInputs = [ + makeWrapper + meson + pkg-config + ninja + # nlohmann_json can be only discovered via cmake files + cmake + ] ++ lib.optional stdenv.cc.isClang [ clang-tools ]; + + postInstall = '' + wrapProgram "$out/bin/nix-unit" --prefix PATH : ${difftastic}/bin + ''; + + meta = { + description = "Nix unit test runner"; + homepage = "https://github.com/nix-community/nix-unit"; + license = lib.licenses.gpl3; + maintainers = with lib.maintainers; [ mic92 adisbladis ]; + platforms = lib.platforms.unix; + mainProgram = "nix-unit"; + }; +}) |