From 4dcd0829d119b20a482e077ba26a343927ef3e30 Mon Sep 17 00:00:00 2001 From: rewine Date: Fri, 26 Jul 2024 21:13:57 +0800 Subject: [PATCH] deepin.dtklog: init at 0.0.1 --- pkgs/desktops/deepin/default.nix | 1 + .../deepin/library/dtklog/default.nix | 50 +++++++++++++++++++ 2 files changed, 51 insertions(+) create mode 100644 pkgs/desktops/deepin/library/dtklog/default.nix diff --git a/pkgs/desktops/deepin/default.nix b/pkgs/desktops/deepin/default.nix index 891fe71baec9..75fc349a571d 100644 --- a/pkgs/desktops/deepin/default.nix +++ b/pkgs/desktops/deepin/default.nix @@ -10,6 +10,7 @@ let dtkgui = callPackage ./library/dtkgui { }; dtkwidget = callPackage ./library/dtkwidget { }; dtkdeclarative = callPackage ./library/dtkdeclarative { }; + dtklog = callPackage ./library/dtklog { }; deepin-pdfium = callPackage ./library/deepin-pdfium { }; qt5platform-plugins = callPackage ./library/qt5platform-plugins { }; qt5integration = callPackage ./library/qt5integration { }; diff --git a/pkgs/desktops/deepin/library/dtklog/default.nix b/pkgs/desktops/deepin/library/dtklog/default.nix new file mode 100644 index 000000000000..043999f614a9 --- /dev/null +++ b/pkgs/desktops/deepin/library/dtklog/default.nix @@ -0,0 +1,50 @@ +{ + stdenv, + lib, + fetchFromGitHub, + cmake, + pkg-config, + libsForQt5, + spdlog, + systemd, + withSystemd ? lib.meta.availableOn stdenv.hostPlatform systemd, +}: + +stdenv.mkDerivation (finalAttrs: { + pname = "dtklog"; + version = "0.0.1"; + + src = fetchFromGitHub { + owner = "linuxdeepin"; + repo = "dtklog"; + rev = finalAttrs.version; + hash = "sha256-8c3KL6pjAFPC4jRpOpPEbEDRBMWnDptwBSbEtcQcf5E="; + }; + + nativeBuildInputs = [ + cmake + pkg-config + libsForQt5.wrapQtAppsHook + ]; + + dontWrapQtApps = true; + + buildInputs = [ + libsForQt5.qtbase + spdlog + ] ++ lib.optional withSystemd systemd; + + cmakeFlags = [ + (lib.cmakeBool "BUILD_WITH_SYSTEMD" withSystemd) + (lib.cmakeFeature "CMAKE_INSTALL_LIBDIR" "lib") + (lib.cmakeFeature "CMAKE_INSTALL_INCLUDEDIR" "include") + ]; + + meta = { + description = "Simple, convinient and thread safe logger for Qt-based C++ apps"; + homepage = "https://github.com/linuxdeepin/dtklog"; + license = lib.licenses.lgpl21Plus; + platforms = lib.platforms.linux; + maintainers = lib.teams.deepin.members; + }; +})