about summary refs log tree commit diff
path: root/pkgs/by-name/li
diff options
context:
space:
mode:
authorVincent Laporte <Vincent.Laporte@gmail.com>2024-01-10 11:54:02 +0100
committerVincent Laporte <vbgl@users.noreply.github.com>2024-01-17 04:40:29 +0100
commitffe76ea5e23e80c4ea79cf8beba6e59fae975f5b (patch)
tree369032cdb6aaf3cfcb339e6514dbc41f6eff84e9 /pkgs/by-name/li
parent496ad23caa1fbc1ab2769a2c15143d36aa4cd219 (diff)
downloadnixlib-ffe76ea5e23e80c4ea79cf8beba6e59fae975f5b.tar
nixlib-ffe76ea5e23e80c4ea79cf8beba6e59fae975f5b.tar.gz
nixlib-ffe76ea5e23e80c4ea79cf8beba6e59fae975f5b.tar.bz2
nixlib-ffe76ea5e23e80c4ea79cf8beba6e59fae975f5b.tar.lz
nixlib-ffe76ea5e23e80c4ea79cf8beba6e59fae975f5b.tar.xz
nixlib-ffe76ea5e23e80c4ea79cf8beba6e59fae975f5b.tar.zst
nixlib-ffe76ea5e23e80c4ea79cf8beba6e59fae975f5b.zip
likwid: init at 5.3.0
Diffstat (limited to 'pkgs/by-name/li')
-rw-r--r--pkgs/by-name/li/likwid/cat-grep-sort-wc.patch20
-rw-r--r--pkgs/by-name/li/likwid/nosetuid.patch20
-rw-r--r--pkgs/by-name/li/likwid/package.nix45
3 files changed, 85 insertions, 0 deletions
diff --git a/pkgs/by-name/li/likwid/cat-grep-sort-wc.patch b/pkgs/by-name/li/likwid/cat-grep-sort-wc.patch
new file mode 100644
index 000000000000..c94186577031
--- /dev/null
+++ b/pkgs/by-name/li/likwid/cat-grep-sort-wc.patch
@@ -0,0 +1,20 @@
+--- a/src/access-daemon/accessDaemon.c	2024-01-10 14:26:18.519538418 +0100
++++ b/src/access-daemon/accessDaemon.c	2024-01-10 14:30:44.090278291 +0100
+@@ -201,7 +201,7 @@
+ static int getNumberOfCPUs()
+ {
+     FILE* fpipe = NULL;
+-    char cmd[1024] = "cat /proc/cpuinfo | grep \"processor\" | sort -u | wc -l";
++    char cmd[1024] = "@coreutils@cat /proc/cpuinfo | @gnugrep@grep \"processor\" | @coreutils@sort -u | @coreutils@wc -l";
+     char buff[1024];
+     if ( !(fpipe = popen(cmd,"r")) )
+     {
+@@ -219,7 +219,7 @@
+ static int getNumberOfSockets()
+ {
+     FILE* fpipe = NULL;
+-    char cmd[1024] = "cat /proc/cpuinfo | grep \"physical id\" | sort -u | wc -l";
++    char cmd[1024] = "@coreutils@cat /proc/cpuinfo | @gnugrep@grep \"physical id\" | @coreutils@sort -u | @coreutils@wc -l";
+     char buff[1024];
+     if ( !(fpipe = popen(cmd,"r")) )
+     {
diff --git a/pkgs/by-name/li/likwid/nosetuid.patch b/pkgs/by-name/li/likwid/nosetuid.patch
new file mode 100644
index 000000000000..5b583b355a36
--- /dev/null
+++ b/pkgs/by-name/li/likwid/nosetuid.patch
@@ -0,0 +1,20 @@
+--- a/Makefile	2024-01-10 13:49:40.225104028 +0100
++++ b/Makefile	2024-01-10 13:50:25.660033418 +0100
+@@ -393,7 +393,7 @@
+ install_daemon:
+ 	@echo "===> INSTALL access daemon to $(ACCESSDAEMON)"
+ 	@mkdir -p `dirname $(ACCESSDAEMON)`
+-	install -m 4755 $(INSTALL_CHOWN) $(DAEMON_TARGET) $(ACCESSDAEMON)
++	install -m 755 $(DAEMON_TARGET) $(ACCESSDAEMON)
+ move_daemon:
+ 	@echo "===> MOVE access daemon from $(ACCESSDAEMON) to $(INSTALLED_ACCESSDAEMON)"
+ 	@mkdir -p `dirname $(INSTALLED_ACCESSDAEMON)`
+@@ -430,7 +430,7 @@
+ install_freq:
+ 	@echo "===> INSTALL setFrequencies tool to $(SBINPREFIX)/$(FREQ_TARGET)"
+ 	@mkdir -p $(SBINPREFIX)
+-	@install -m 4755 $(INSTALL_CHOWN) $(FREQ_TARGET) $(SBINPREFIX)/$(FREQ_TARGET)
++	@install -m 755 $(FREQ_TARGET) $(SBINPREFIX)/$(FREQ_TARGET)
+ move_freq:
+ 	@echo "===> MOVE setFrequencies tool from $(SBINPREFIX)/$(FREQ_TARGET) to $(INSTALLED_SBINPREFIX)/$(FREQ_TARGET)"
+ 	@mkdir -p $(INSTALLED_SBINPREFIX)
diff --git a/pkgs/by-name/li/likwid/package.nix b/pkgs/by-name/li/likwid/package.nix
new file mode 100644
index 000000000000..95fe029044fa
--- /dev/null
+++ b/pkgs/by-name/li/likwid/package.nix
@@ -0,0 +1,45 @@
+{ lib
+, stdenv
+, fetchurl
+, perl
+, substituteAll
+, coreutils
+, gnugrep
+}:
+
+stdenv.mkDerivation rec {
+  pname = "likwid";
+  version = "5.3.0";
+
+  src = fetchurl {
+    url = "https://ftp.fau.de/pub/likwid/likwid-${version}.tar.gz";
+    hash = "sha256-wpDlVMQlMSSsKriwVuFO5NI5ZrjJ+/oQuoH3WuVDzk4=";
+  };
+
+  nativeBuildInputs = [ perl ];
+
+  hardeningDisable = [ "format" ];
+
+  patches = [
+    ./nosetuid.patch
+    (substituteAll {
+      src = ./cat-grep-sort-wc.patch;
+      coreutils = "${coreutils}/bin/";
+      gnugrep = "${gnugrep}/bin/";
+    })
+  ];
+
+  postPatch = "patchShebangs bench/ perl/";
+
+  makeFlags = [ "PREFIX=$(out)" ];
+
+  meta = with lib; {
+    homepage = "https://hpc.fau.de/research/tools/likwid/";
+    description = "Performance monitoring and benchmarking suite";
+    license = licenses.gpl3Only;
+    # Might work on ARM by appropriately setting COMPILER in config.mk
+    platforms = intersectLists platforms.linux platforms.x86;
+    maintainers = [ maintainers.vbgl ];
+    mainProgram = "likwid-perfctr";
+  };
+}