From da33929aab76dcc26871ca4c80efdeca99088bf3 Mon Sep 17 00:00:00 2001 From: Rongsong Shen Date: Tue, 4 Nov 2025 16:40:51 +0800 Subject: [PATCH] use colored unity-test --- flake.lock | 6 +++--- pkgs/u/unity-test/package.nix | 37 +++++++++++++++++++++++++++-------- 2 files changed, 32 insertions(+), 11 deletions(-) diff --git a/flake.lock b/flake.lock index 0c4da0f..b161c00 100644 --- a/flake.lock +++ b/flake.lock @@ -2,11 +2,11 @@ "nodes": { "nixpkgs": { "locked": { - "lastModified": 1755615617, - "narHash": "sha256-HMwfAJBdrr8wXAkbGhtcby1zGFvs+StOp19xNsbqdOg=", + "lastModified": 1762111121, + "narHash": "sha256-4vhDuZ7OZaZmKKrnDpxLZZpGIJvAeMtK6FKLJYUtAdw=", "owner": "nixos", "repo": "nixpkgs", - "rev": "20075955deac2583bb12f07151c2df830ef346b4", + "rev": "b3d51a0365f6695e7dd5cdf3e180604530ed33b4", "type": "github" }, "original": { diff --git a/pkgs/u/unity-test/package.nix b/pkgs/u/unity-test/package.nix index 4e80a92..1f95e70 100644 --- a/pkgs/u/unity-test/package.nix +++ b/pkgs/u/unity-test/package.nix @@ -5,10 +5,20 @@ cmake, }: -stdenv.mkDerivation (finalAttrs: { +let pname = "unity-test"; version = "2.6.1"; - + meta = { + description = "Unity Unit Testing Framework"; + homepage = "https://www.throwtheswitch.org/unity"; + license = lib.licenses.mit; + maintainers = [ lib.maintainers.i01011001 ]; + }; +in +stdenv.mkDerivation (finalAttrs: { + pname = pname; + version = version; + src = fetchFromGitHub { owner = "ThrowTheSwitch"; repo = "Unity"; @@ -20,10 +30,21 @@ stdenv.mkDerivation (finalAttrs: { makeFlags = [ "UNITY_OUTPUT_COLOR=1" ]; doCheck = true; - meta = { - description = "Unity Unit Testing Framework"; - homepage = "https://www.throwtheswitch.org/unity"; - license = lib.licenses.mit; - maintainers = [ lib.maintainers.i01011001 ]; - }; + postInstall = '' + mkdir -p $out/lib/pkgconfig + cat >$out/lib/pkgconfig/unity.pc <