summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHunter Sezen <orbea@fredslev.dk>2018-12-15 06:56:57 +0700
committerWilly Sudiarto Raharjo <willysr@slackbuilds.org>2018-12-15 06:56:57 +0700
commitca2703577e4c8ee2a48314cecb0c5e84601d43dc (patch)
tree81af73f5114e272b30347551afe987d5ebaa137d
parent8224731b8f9dc8f30cf679a6b558f8d4bbbd278d (diff)
downloadslackbuilds-ca2703577e4c8ee2a48314cecb0c5e84601d43dc.tar.gz
system/radeontop: Added (Radeon cards monitoring utility).
Signed-off-by: Willy Sudiarto Raharjo <willysr@slackbuilds.org>
-rw-r--r--system/radeontop/README5
-rw-r--r--system/radeontop/git.patch24
-rw-r--r--system/radeontop/man.patch32
-rw-r--r--system/radeontop/radeontop.SlackBuild108
-rw-r--r--system/radeontop/radeontop.info10
-rw-r--r--system/radeontop/slack-desc19
6 files changed, 198 insertions, 0 deletions
diff --git a/system/radeontop/README b/system/radeontop/README
new file mode 100644
index 0000000000..c023fbd4a3
--- /dev/null
+++ b/system/radeontop/README
@@ -0,0 +1,5 @@
+Radeon cards monitoring utilty for viewing GPU utilization, show both
+for the total activity percent and individual blocks.
+
+R600 and more recent cards are supported. Works with both the open
+drivers and AMD Catalyst.
diff --git a/system/radeontop/git.patch b/system/radeontop/git.patch
new file mode 100644
index 0000000000..e3fbfc5042
--- /dev/null
+++ b/system/radeontop/git.patch
@@ -0,0 +1,24 @@
+From c7518550fc8b0e62f1c7ea96495eec621bc395ef Mon Sep 17 00:00:00 2001
+From: orbea <orbea@fredslev.dk>
+Date: Sun, 9 Dec 2018 13:42:49 -0800
+Subject: [PATCH] getver.sh: Only use git if its a git repo.
+
+---
+ getver.sh | 4 +++-
+ 1 file changed, 3 insertions(+), 1 deletion(-)
+
+diff --git a/getver.sh b/getver.sh
+index 7bb1889..45261dd 100755
+--- a/getver.sh
++++ b/getver.sh
+@@ -2,7 +2,9 @@
+
+ ver=unknown
+
+-[ -n "`which git`" ] && ver=`git describe`
++if [ -n "`which git`" ] && git rev-parse HEAD 2>/dev/null; then
++ ver=`git describe`
++fi
+
+ cat > include/version.h << EOF
+ #ifndef VER_H
diff --git a/system/radeontop/man.patch b/system/radeontop/man.patch
new file mode 100644
index 0000000000..b9f26245a9
--- /dev/null
+++ b/system/radeontop/man.patch
@@ -0,0 +1,32 @@
+From dfbff6274ce25814a4357a8a788c404425cecb69 Mon Sep 17 00:00:00 2001
+From: orbea <orbea@fredslev.dk>
+Date: Sat, 1 Dec 2018 07:43:12 -0800
+Subject: [PATCH] Makefile: Add MANDIR.
+
+Not all Linux distros install manpages to $(PREFIX)/share/man.
+For example Slackware installs manpages to /usr/man/.
+---
+ Makefile | 3 ++-
+ 1 file changed, 2 insertions(+), 1 deletion(-)
+
+diff --git a/Makefile b/Makefile
+index 6010bc9..4cb7093 100644
+--- a/Makefile
++++ b/Makefile
+@@ -13,6 +13,7 @@
+ PREFIX ?= /usr
+ INSTALL ?= install
+ LIBDIR ?= lib
++MANDIR ?= share/man
+
+ nls ?= 1
+ xcb ?= 1
+@@ -103,7 +104,7 @@ install: all
+ ifeq ($(xcb), 1)
+ $(INSTALL) -D -m755 $(xcblib) $(DESTDIR)/$(PREFIX)/$(LIBDIR)/$(xcblib)
+ endif
+- $(INSTALL) -D -m644 radeontop.1 $(DESTDIR)/$(PREFIX)/share/man/man1/radeontop.1
++ $(INSTALL) -D -m644 radeontop.1 $(DESTDIR)/$(PREFIX)/$(MANDIR)/man1/radeontop.1
+ ifeq ($(nls), 1)
+ $(MAKE) -C translations install PREFIX=$(PREFIX)
+ endif
diff --git a/system/radeontop/radeontop.SlackBuild b/system/radeontop/radeontop.SlackBuild
new file mode 100644
index 0000000000..15718a8317
--- /dev/null
+++ b/system/radeontop/radeontop.SlackBuild
@@ -0,0 +1,108 @@
+#!/bin/sh
+
+# Slackware build script for radeontop
+
+# Copyright 2018 Hunter Sezen California, USA
+# All rights reserved.
+#
+# Redistribution and use of this script, with or without modification, is
+# permitted provided that the following conditions are met:
+#
+# 1. Redistributions of this script must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+#
+# THIS SOFTWARE IS PROVIDED BY THE AUTHOR "AS IS" AND ANY EXPRESS OR IMPLIED
+# WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+# MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
+# EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
+# OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
+# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+PRGNAM=radeontop
+VERSION=${VERSION:-1.1}
+BUILD=${BUILD:-1}
+TAG=${TAG:-_SBo}
+
+if [ -z "$ARCH" ]; then
+ case "$( uname -m )" in
+ i?86) ARCH=i586 ;;
+ arm*) ARCH=arm ;;
+ *) ARCH=$( uname -m ) ;;
+ esac
+fi
+
+CWD=$(pwd)
+TMP=${TMP:-/tmp/SBo}
+PKG=$TMP/package-$PRGNAM
+OUTPUT=${OUTPUT:-/tmp}
+
+if [ "$ARCH" = "i586" ]; then
+ SLKCFLAGS="-O2 -march=i586 -mtune=i686"
+ LIBDIRSUFFIX=""
+elif [ "$ARCH" = "i686" ]; then
+ SLKCFLAGS="-O2 -march=i686 -mtune=i686"
+ LIBDIRSUFFIX=""
+elif [ "$ARCH" = "x86_64" ]; then
+ SLKCFLAGS="-O2 -fPIC"
+ LIBDIRSUFFIX="64"
+else
+ SLKCFLAGS="-O2"
+ LIBDIRSUFFIX=""
+fi
+
+set -eu
+
+rm -rf $PKG
+mkdir -p $TMP $PKG $OUTPUT
+cd $TMP
+rm -rf $PRGNAM-$VERSION
+tar xvf $CWD/$PRGNAM-$VERSION.tar.gz
+cd $PRGNAM-$VERSION
+chown -R root:root .
+find -L . \
+ \( -perm 777 -o -perm 775 -o -perm 750 -o -perm 711 -o -perm 555 \
+ -o -perm 511 \) -exec chmod 755 {} \; -o \
+ \( -perm 666 -o -perm 664 -o -perm 640 -o -perm 600 -o -perm 444 \
+ -o -perm 440 -o -perm 400 \) -exec chmod 644 {} \;
+
+# Include the correct version number.
+sed -i "s/ver=unknown/ver=$VERSION/" ./getver.sh
+
+# Makefile: Add MANDIR.
+# https://github.com/clbr/radeontop/commit/dfbff6274ce25814a4357a8a788c404425cecb69
+# https://github.com/clbr/radeontop/pull/79
+patch -p1 < $CWD/man.patch
+
+# getver.sh: Only use git if its a git repo.
+# https://github.com/clbr/radeontop/commit/c7518550fc8b0e62f1c7ea96495eec621bc395ef
+# https://github.com/clbr/radeontop/pull/80
+patch -p1 < $CWD/git.patch
+
+CFLAGS="$SLKCFLAGS" \
+make amdgpu=1
+
+make install \
+ PREFIX=/usr \
+ LIBDIR=lib${LIBDIRSUFFIX} \
+ MANDIR=man \
+ DESTDIR=$PKG
+
+find $PKG -print0 | xargs -0 file | grep -e "executable" -e "shared object" |
+ grep ELF | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null || true
+
+find $PKG/usr/man -type f -exec gzip -9 {} \;
+for i in $( find $PKG/usr/man -type l ) ; do ln -s $( readlink $i ).gz $i.gz ; rm $i ; done
+
+mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
+cp -a COPYING README.md $PKG/usr/doc/$PRGNAM-$VERSION
+cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild
+
+mkdir -p $PKG/install
+cat $CWD/slack-desc > $PKG/install/slack-desc
+
+cd $PKG
+/sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.${PKGTYPE:-tgz}
diff --git a/system/radeontop/radeontop.info b/system/radeontop/radeontop.info
new file mode 100644
index 0000000000..7813cb81a2
--- /dev/null
+++ b/system/radeontop/radeontop.info
@@ -0,0 +1,10 @@
+PRGNAM="radeontop"
+VERSION="1.1"
+HOMEPAGE="https://github.com/clbr/radeontop"
+DOWNLOAD="https://github.com/clbr/radeontop/archive/v1.1/radeontop-1.1.tar.gz"
+MD5SUM="51bbca383b72855ff1c6d4e7d1f4f657"
+DOWNLOAD_x86_64=""
+MD5SUM_x86_64=""
+REQUIRES=""
+MAINTAINER="Hunter Sezen"
+EMAIL="orbea@fredslev.dk"
diff --git a/system/radeontop/slack-desc b/system/radeontop/slack-desc
new file mode 100644
index 0000000000..96b4e6623e
--- /dev/null
+++ b/system/radeontop/slack-desc
@@ -0,0 +1,19 @@
+# HOW TO EDIT THIS FILE:
+# The "handy ruler" below makes it easier to edit a package description.
+# Line up the first '|' above the ':' following the base package name, and
+# the '|' on the right side marks the last column you can put a character in.
+# You must make exactly 11 lines for the formatting to be correct. It's also
+# customary to leave one space after the ':' except on otherwise blank lines.
+
+ |-----handy-ruler------------------------------------------------------|
+radeontop: radeontop (Radeon cards monitoring utility)
+radeontop:
+radeontop: Radeon cards monitoring utilty for viewing GPU utilization, show both
+radeontop: for the total activity percent and individual blocks.
+radeontop:
+radeontop: Homepage: https://github.com/clbr/radeontop
+radeontop:
+radeontop:
+radeontop:
+radeontop:
+radeontop: