From 09101274fc3c2553bc9b75c7016dc710be7a5b91 Mon Sep 17 00:00:00 2001 From: Rongsong Shen Date: Tue, 4 Nov 2025 15:20:57 +0800 Subject: [PATCH] add tiny log & unity-test --- default.nix | 2 ++ pkgs/t/tinylog/package.nix | 51 +++++++++++++++++++++++++++++++++++ pkgs/u/unity-test/package.nix | 28 +++++++++++++++++++ 3 files changed, 81 insertions(+) create mode 100644 pkgs/t/tinylog/package.nix create mode 100644 pkgs/u/unity-test/package.nix diff --git a/default.nix b/default.nix index cf604a5..4b2cec1 100644 --- a/default.nix +++ b/default.nix @@ -11,10 +11,12 @@ let zlog_with_pkgconf = callPackage ./pkgs/z/zlog/package.nix { with_pkgconf = true; }; + tinylog = callPackage ./pkgs/t/tinylog/package.nix {}; in { xbuild = xbuild; capnpc = capnpc; cedro = cedro; zlog_with_pkgconf = zlog_with_pkgconf; + tinylog = tinylog; } diff --git a/pkgs/t/tinylog/package.nix b/pkgs/t/tinylog/package.nix new file mode 100644 index 0000000..6d2be9e --- /dev/null +++ b/pkgs/t/tinylog/package.nix @@ -0,0 +1,51 @@ +{ + lib, + stdenv, + fetchFromGitHub, + cmake, + with_pkgconf? false, +}: + +let + meta = with lib; { + description = "Tinylog is a lightweight C-language high performance log component for UNIX environment, It is high performance, asynchronized, thread-safe and process-safe log library for C/C++."; + homepage = "https://github.com/pymumu/tinylog"; + license = lib.licenses.mit; +# maintainers = with lib.maintainers; [ matthiasbeyer ]; +# mainProgram = "zlog-chk-conf"; + platforms = lib.platforms.unix; + }; + pname = "tlog"; + version = "1.0.0"; +in +stdenv.mkDerivation (finalAttrs: { + pname = pname; + version = version; + + src = fetchFromGitHub { + owner = "shen390s"; + repo = "tinylog"; + rev = "master"; + hash = "sha256-hyr9enK/ClO1v6dlGKTBKUvlXX5f166+CS0RyvYBRWI="; + }; + + nativeBuildInputs = [ cmake ]; + + postInstall = '' + mkdir -p $out/lib/pkgconfig + cat >$out/lib/pkgconfig/tinylog.pc <