summary refs log tree commit diff
path: root/pkgs/os-specific
diff options
context:
space:
mode:
authorRobert Helgesson <robert@rycee.net>2015-01-01 16:47:24 +0100
committerRobert Helgesson <robert@rycee.net>2015-01-03 21:18:54 +0100
commitf9afb8e6cbf8deb9e6b46352d42ea3509a02074b (patch)
treeee2c490a8c5783371c14e1d5e61b345ed01f7139 /pkgs/os-specific
parent597373bbd5ca3237f3b198c150cf7dbb63183fb1 (diff)
downloadnixpkgs-f9afb8e6cbf8deb9e6b46352d42ea3509a02074b.tar
nixpkgs-f9afb8e6cbf8deb9e6b46352d42ea3509a02074b.tar.gz
nixpkgs-f9afb8e6cbf8deb9e6b46352d42ea3509a02074b.tar.bz2
nixpkgs-f9afb8e6cbf8deb9e6b46352d42ea3509a02074b.tar.lz
nixpkgs-f9afb8e6cbf8deb9e6b46352d42ea3509a02074b.tar.xz
nixpkgs-f9afb8e6cbf8deb9e6b46352d42ea3509a02074b.tar.zst
nixpkgs-f9afb8e6cbf8deb9e6b46352d42ea3509a02074b.zip
Add package 'radeontop'.
Diffstat (limited to 'pkgs/os-specific')
-rw-r--r--pkgs/os-specific/linux/radeontop/default.nix39
-rw-r--r--pkgs/os-specific/linux/radeontop/install-paths.patch36
-rw-r--r--pkgs/os-specific/linux/radeontop/version-header.patch21
3 files changed, 96 insertions, 0 deletions
diff --git a/pkgs/os-specific/linux/radeontop/default.nix b/pkgs/os-specific/linux/radeontop/default.nix
new file mode 100644
index 00000000000..ed159bbf37f
--- /dev/null
+++ b/pkgs/os-specific/linux/radeontop/default.nix
@@ -0,0 +1,39 @@
+{ stdenv, fetchurl, substituteAll, pkgconfig
+, gettext, ncurses, libdrm, libpciaccess }:
+
+stdenv.mkDerivation rec {
+  name = "radeontop-${version}";
+  version = "0.8";
+
+  src = fetchurl {
+    url = "https://github.com/clbr/radeontop/archive/v${version}.tar.gz";
+    sha256 = "12c4kpr9zy2a21k8mck9cbfwm54x1l0i96va97m70pc9ramf2c24";
+  };
+
+  buildInputs = [ pkgconfig gettext ncurses libdrm libpciaccess ];
+
+  patches = [
+    ./install-paths.patch
+
+    # The default generation of version.h expects a git clone.
+    (substituteAll {
+      src = ./version-header.patch;
+      inherit version;
+    })
+  ];
+
+  postPatch = ''
+    substituteInPlace radeontop.c \
+      --replace /usr/share/locale $out/share/locale
+  '';
+
+  makeFlags = "DESTDIR=$(out)";
+
+  meta = with stdenv.lib; {
+    description = "Top-like tool for viewing AMD Radeon GPU utilization";
+    homepage = https://github.com/clbr/radeontop;
+    platforms = platforms.linux;
+    license = licenses.gpl3;
+    maintainers = [ maintainers.rycee ];
+  };
+}
diff --git a/pkgs/os-specific/linux/radeontop/install-paths.patch b/pkgs/os-specific/linux/radeontop/install-paths.patch
new file mode 100644
index 00000000000..59aee99d0bc
--- /dev/null
+++ b/pkgs/os-specific/linux/radeontop/install-paths.patch
@@ -0,0 +1,36 @@
+diff -Nurp radeontop-0.8-orig/Makefile radeontop-0.8/Makefile
+--- radeontop-0.8-orig/Makefile	2015-01-03 09:34:30.205507608 +0100
++++ radeontop-0.8/Makefile	2015-01-03 09:43:22.835174006 +0100
+@@ -7,7 +7,6 @@
+ #	nostrip	disable stripping, default off
+ #	plain	apply neither -g nor -s.
+ 
+-PREFIX ?= /usr
+ INSTALL ?= install
+ 
+ nls ?= 1
+@@ -74,10 +73,10 @@ trans:
+ 	--package-name radeontop
+ 
+ install: all
+-	$(INSTALL) -D -m755 $(bin) $(DESTDIR)/$(PREFIX)/sbin/$(bin)
+-	$(INSTALL) -D -m644 radeontop.1 $(DESTDIR)/$(PREFIX)/share/man/man1/radeontop.1
++	$(INSTALL) -D -m755 $(bin) $(DESTDIR)/sbin/$(bin)
++	$(INSTALL) -D -m644 radeontop.1 $(DESTDIR)/share/man/man1/radeontop.1
+ ifeq ($(nls), 1)
+-	$(MAKE) -C translations install PREFIX=$(PREFIX)
++	$(MAKE) -C translations install DESTDIR=$(DESTDIR)
+ endif
+ 
+ man:
+diff -Nurp radeontop-0.8-orig/translations/Makefile radeontop-0.8/translations/Makefile
+--- radeontop-0.8-orig/translations/Makefile	2015-01-03 09:34:30.205507608 +0100
++++ radeontop-0.8/translations/Makefile	2015-01-03 09:43:40.235309691 +0100
+@@ -15,6 +15,6 @@ $(obj): $(src)
+ 	$(MSGFMT) -o $@ $<
+ 
+ %.inst: %.mo
+-	$(INSTALL) -D -m 644 $< $(DESTDIR)/$(PREFIX)/share/locale/$*/LC_MESSAGES/radeontop.mo
++	$(INSTALL) -D -m 644 $< $(DESTDIR)/share/locale/$*/LC_MESSAGES/radeontop.mo
+ 
+ install: all $(inst)
diff --git a/pkgs/os-specific/linux/radeontop/version-header.patch b/pkgs/os-specific/linux/radeontop/version-header.patch
new file mode 100644
index 00000000000..784464794d7
--- /dev/null
+++ b/pkgs/os-specific/linux/radeontop/version-header.patch
@@ -0,0 +1,21 @@
+diff -Nurp radeontop-0.8-orig/include/version.h radeontop-0.8/include/version.h
+--- radeontop-0.8-orig/include/version.h	1970-01-01 01:00:00.000000000 +0100
++++ radeontop-0.8/include/version.h	2015-01-03 09:34:58.114335049 +0100
+@@ -0,0 +1,6 @@
++#ifndef VER_H
++#define VER_H
++
++#define VERSION "@version@"
++
++#endif
+diff -Nurp radeontop-0.8-orig/Makefile radeontop-0.8/Makefile
+--- radeontop-0.8-orig/Makefile	2015-01-03 09:34:30.205507608 +0100
++++ radeontop-0.8/Makefile	2015-01-03 09:38:36.765881422 +0100
+@@ -67,7 +67,6 @@ clean:
+ .git:
+ 
+ $(verh): .git
+-	./getver.sh
+ 
+ trans:
+ 	xgettext -o translations/radeontop.pot -k_ *.c \