summary refs log tree commit diff
path: root/pkgs/tools/system
diff options
context:
space:
mode:
authorMatthias Thym <git@thym.at>2022-08-23 17:43:09 +0200
committerMatthias Thym <git@thym.at>2022-11-23 10:39:37 +0100
commit5822b984c305722b3865ee8c2e1a2ffb14ebe91b (patch)
tree295bf2b20f9c3a9e53c9e597492a09d75349438d /pkgs/tools/system
parent5ab18b18ed158e2daf924b2a40fc91224804abd2 (diff)
downloadnixpkgs-5822b984c305722b3865ee8c2e1a2ffb14ebe91b.tar
nixpkgs-5822b984c305722b3865ee8c2e1a2ffb14ebe91b.tar.gz
nixpkgs-5822b984c305722b3865ee8c2e1a2ffb14ebe91b.tar.bz2
nixpkgs-5822b984c305722b3865ee8c2e1a2ffb14ebe91b.tar.lz
nixpkgs-5822b984c305722b3865ee8c2e1a2ffb14ebe91b.tar.xz
nixpkgs-5822b984c305722b3865ee8c2e1a2ffb14ebe91b.tar.zst
nixpkgs-5822b984c305722b3865ee8c2e1a2ffb14ebe91b.zip
wsysmon: init at 0.1.0
Diffstat (limited to 'pkgs/tools/system')
-rw-r--r--pkgs/tools/system/wsysmon/default.nix53
-rw-r--r--pkgs/tools/system/wsysmon/dependencies.patch14
-rw-r--r--pkgs/tools/system/wsysmon/install.patch14
3 files changed, 81 insertions, 0 deletions
diff --git a/pkgs/tools/system/wsysmon/default.nix b/pkgs/tools/system/wsysmon/default.nix
new file mode 100644
index 00000000000..96c3cc30587
--- /dev/null
+++ b/pkgs/tools/system/wsysmon/default.nix
@@ -0,0 +1,53 @@
+{ lib
+, stdenv
+, fetchFromGitHub
+, substituteAll
+, cmake
+, pkg-config
+, gtkmm3
+, gtk3
+, procps
+, spdlog
+}:
+
+stdenv.mkDerivation rec {
+  pname = "wsysmon";
+  version = "0.1.0";
+
+  src = fetchFromGitHub {
+    owner = "slyfabi";
+    repo = "wsysmon";
+    rev = version;
+    sha256 = "sha256-5kfZT+hm064qXoAzi0RdmUqXi8VaXamlbm+FJOrGh3A=";
+  };
+
+  patches = [
+    # Prevent CMake from trying to fetch libraries from GitHub
+    (substituteAll {
+      src = ./dependencies.patch;
+      spdlog_src = spdlog.src;
+    })
+    # Add an installPhase
+    ./install.patch
+  ];
+
+  nativeBuildInputs = [
+    cmake
+    pkg-config
+  ];
+
+  buildInputs = [
+    gtkmm3
+    gtk3
+    procps
+    spdlog
+  ];
+
+  meta = with lib; {
+    description = "A windows task manager clone for Linux";
+    homepage = "https://github.com/SlyFabi/WSysMon";
+    license = [ licenses.mit ];
+    platforms = platforms.linux;
+    maintainers = with maintainers; [ totoroot ];
+  };
+}
diff --git a/pkgs/tools/system/wsysmon/dependencies.patch b/pkgs/tools/system/wsysmon/dependencies.patch
new file mode 100644
index 00000000000..cc0a2fc709e
--- /dev/null
+++ b/pkgs/tools/system/wsysmon/dependencies.patch
@@ -0,0 +1,14 @@
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index 31e8048..1eec936 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -7,8 +7,7 @@ include(FetchContent)
+ 
+ FetchContent_Declare(
+         spdlog
+-        GIT_REPOSITORY https://github.com/gabime/spdlog.git
+-        GIT_TAG v1.10.0
++        SOURCE_DIR @spdlog_src@
+ )
+ FetchContent_MakeAvailable(spdlog)
+ 
diff --git a/pkgs/tools/system/wsysmon/install.patch b/pkgs/tools/system/wsysmon/install.patch
new file mode 100644
index 00000000000..4b5946a7ab7
--- /dev/null
+++ b/pkgs/tools/system/wsysmon/install.patch
@@ -0,0 +1,14 @@
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index 31e8048..a125b3f 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -20,3 +20,9 @@ include_directories(${GTKMM_INCLUDE_DIRS} ${X11_INCLUDE_DIR})
+ 
+ add_executable(WSysMon src/main.cpp src/ui/MainWindow.cpp src/ui/widgets/GraphWidget.cpp src/ui/widgets/PerformanceButton.cpp src/ui/views/ProcessesView.cpp src/ui/views/PerformanceView.cpp src/ui/views/performance/PerformanceCPUView.cpp src/ui/views/performance/PerformanceGPUView.cpp src/ui/views/performance/PerformanceNetworkView.cpp src/ui/views/performance/PerformanceRAMView.cpp src/utils/DispatcherThread.cpp src/utils/UnitConverter.cpp src/utils/X11Utils.cpp src/api/process/ProcessManager.cpp src/api/process/ProcessNode.cpp src/api/linux/ProcessesApi.cpp src/api/linux/GPUApi.cpp src/api/linux/NetworkApi.cpp src/api/linux/SystemInfoApi.cpp src/api/DiskApi.h src/api/linux/DiskApi.cpp src/ui/views/performance/PerformanceDiskView.cpp src/ui/views/performance/PerformanceDiskView.h src/api/linux/gpu/nvml.h src/api/linux/gpu/nvml_hook_funcs.inl src/api/linux/gpu/NvGpuApi.cpp src/api/linux/gpu/NvGpuApi.h src/api/HwMonApi.h src/api/linux/HwMonApi.cpp)
+ target_link_libraries(WSysMon PRIVATE spdlog::spdlog pthread procps ${CMAKE_DL_LIBS} ${GTKMM_LIBRARIES} ${X11_LIBRARIES})
++
++install(
++    TARGETS
++    WSysMon
++    RUNTIME DESTINATION bin
++)