summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTimothy Redaelli <drizzt@gentoo.org>2009-03-04 21:51:08 +0000
committerTimothy Redaelli <drizzt@gentoo.org>2009-03-04 21:51:08 +0000
commit82e257c15d11d14b25d39d7bb268c0c059b9b3f3 (patch)
tree969b954d29674edd07ece9044039b3099e1a20af /sys-process
parentBump KDE 4.2.1 (diff)
downloadgentoo-2-82e257c15d11d14b25d39d7bb268c0c059b9b3f3.tar.gz
gentoo-2-82e257c15d11d14b25d39d7bb268c0c059b9b3f3.tar.bz2
gentoo-2-82e257c15d11d14b25d39d7bb268c0c059b9b3f3.zip
Patch for not-Linux hosts.
Authorized by gentoofan23 (Portage version: 2.2_rc23/cvs/Linux x86_64)
Diffstat (limited to 'sys-process')
-rw-r--r--sys-process/htop/ChangeLog8
-rw-r--r--sys-process/htop/files/htop-0.8.1-no-plpa.patch111
-rw-r--r--sys-process/htop/htop-0.8.1-r1.ebuild22
3 files changed, 130 insertions, 11 deletions
diff --git a/sys-process/htop/ChangeLog b/sys-process/htop/ChangeLog
index db6eba2561b1..0378d68ea600 100644
--- a/sys-process/htop/ChangeLog
+++ b/sys-process/htop/ChangeLog
@@ -1,6 +1,10 @@
# ChangeLog for sys-process/htop
-# Copyright 2000-2008 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/sys-process/htop/ChangeLog,v 1.71 2008/12/01 15:39:42 ranger Exp $
+# Copyright 2000-2009 Gentoo Foundation; Distributed under the GPL v2
+# $Header: /var/cvsroot/gentoo-x86/sys-process/htop/ChangeLog,v 1.72 2009/03/04 21:51:08 drizzt Exp $
+
+ 04 Mar 2009; Timothy Redaelli <drizzt@gentoo.org>
+ +files/htop-0.8.1-no-plpa.patch, htop-0.8.1-r1.ebuild:
+ Patch for not-Linux hosts. Authorized by gentoofan23
01 Dec 2008; Brent Baude <ranger@gentoo.org> htop-0.8.1-r1.ebuild:
Marking htop-0.8.1-r1 ppc64 for bug 245966
diff --git a/sys-process/htop/files/htop-0.8.1-no-plpa.patch b/sys-process/htop/files/htop-0.8.1-no-plpa.patch
new file mode 100644
index 000000000000..ee89da35bd4b
--- /dev/null
+++ b/sys-process/htop/files/htop-0.8.1-no-plpa.patch
@@ -0,0 +1,111 @@
+Not-linux hosts does not support PLPA.
+Since htop works also without it, why not?
+
+Original patch from FreeBSD by Yi-Jheng Lin <yzlin@cs.nctu.edu.tw>
+Modified to be conditional by Timothy Redaelli <drizzt@gentoo.org>
+
+https://bugs.gentoo.org/220469
+
+--- configure.ac
++++ configure.ac
+@@ -97,8 +97,9 @@
+
+ PLPA_INCLUDED(plpa-1.1)
+ PLPA_INIT(plpa_happy=yes, plpa_happy=no)
+-if test "x$plpa_happy" = xno; then
+- AC_MSG_ERROR([Failed to initialize PLPA.])
++AM_CONDITIONAL([HAVE_PLPA], [test "$plpa_happy" = "yes"])
++if test "$plpa_happy" = "yes"; then
++ AC_DEFINE([HAVE_PLPA], [1], [Have plpa])
+ fi
+
+ AC_CONFIG_FILES([Makefile])
+--- htop.c
++++ htop.c
+@@ -112,9 +112,11 @@
+ mvaddstr(15, 0, " F9 k: kill process/tagged processes P: sort by CPU%");
+ mvaddstr(16, 0, " + [ F7: lower priority (+ nice) M: sort by MEM%");
+ mvaddstr(17, 0, " - ] F8: higher priority (root only) T: sort by TIME");
++#ifdef HAVE_PLPA
+ if (pl->processorCount > 1)
+ mvaddstr(18, 0, " a: set CPU affinity F4 I: invert sort order");
+ else
++#endif
+ mvaddstr(18, 0, " F4 I: invert sort order");
+ mvaddstr(19, 0, " F2 S: setup F6 >: select sort column");
+ mvaddstr(20, 0, " F1 h: show this help screen");
+@@ -131,8 +133,10 @@
+ mvaddstr(16, 0, " + [ F7"); mvaddstr(16,40, " M");
+ mvaddstr(17, 0, " - ] F8"); mvaddstr(17,40, " T");
+ mvaddstr(18,40, " F4 I");
++#if HAVE_PLPA
+ if (pl->processorCount > 1)
+ mvaddstr(18, 0, " a:");
++#endif
+ mvaddstr(19, 0, " F2 S"); mvaddstr(19,40, " F6 >");
+ mvaddstr(20, 0, " F1 h");
+ mvaddstr(21, 0, " F10 q"); mvaddstr(21,40, " s");
+@@ -630,6 +634,7 @@
+ refreshTimeout = 0;
+ break;
+ }
++#ifdef HAVE_PLPA
+ case 'a':
+ {
+ if (pl->processorCount == 1)
+@@ -665,6 +670,7 @@
+ refreshTimeout = 0;
+ break;
+ }
++#endif
+ case KEY_F(10):
+ case 'q':
+ quit = 1;
+--- Process.c
++++ Process.c
+@@ -28,7 +28,9 @@
+ #include <pwd.h>
+ #include <sched.h>
+
++#ifdef HAVE_PLPA
+ #include <plpa.h>
++#endif
+
+ // This works only with glibc 2.1+. On earlier versions
+ // the behavior is similar to have a hardcoded page size.
+@@ -493,6 +495,7 @@
+ return (err == 0);
+ }
+
++#ifdef HAVE_PLPA
+ unsigned long Process_getAffinity(Process* this) {
+ unsigned long mask = 0;
+ plpa_sched_getaffinity(this->pid, sizeof(unsigned long), (plpa_cpu_set_t*) &mask);
+@@ -502,6 +505,7 @@
+ bool Process_setAffinity(Process* this, unsigned long mask) {
+ return (plpa_sched_setaffinity(this->pid, sizeof(unsigned long), (plpa_cpu_set_t*) &mask) == 0);
+ }
++#endif
+
+ void Process_sendSignal(Process* this, int signal) {
+ kill(this->pid, signal);
+--- Makefile.am
++++ Makefile.am
+@@ -1,5 +1,7 @@
+
++if HAVE_PLPA
+ SUBDIRS = plpa-1.1
++endif
+
+ bin_PROGRAMS = htop
+ dist_man_MANS = htop.1
+@@ -35,7 +37,9 @@
+
+ BUILT_SOURCES = $(myhtopheaders)
+ htop_SOURCES = $(myhtopheaders) $(myhtopsources) config.h debug.h
++if HAVE_PLPA
+ htop_LDADD = $(top_builddir)/plpa-1.1/src/libplpa_included.la
++endif
+
+ profile:
+ $(MAKE) all CFLAGS="-pg -O2"
diff --git a/sys-process/htop/htop-0.8.1-r1.ebuild b/sys-process/htop/htop-0.8.1-r1.ebuild
index 6e9646e60afc..27f12086e38f 100644
--- a/sys-process/htop/htop-0.8.1-r1.ebuild
+++ b/sys-process/htop/htop-0.8.1-r1.ebuild
@@ -1,8 +1,8 @@
-# Copyright 1999-2008 Gentoo Foundation
+# Copyright 1999-2009 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/sys-process/htop/htop-0.8.1-r1.ebuild,v 1.7 2008/12/07 11:01:34 vapier Exp $
+# $Header: /var/cvsroot/gentoo-x86/sys-process/htop/htop-0.8.1-r1.ebuild,v 1.8 2009/03/04 21:51:08 drizzt Exp $
-inherit eutils flag-o-matic
+inherit autotools eutils flag-o-matic
IUSE="debug unicode"
DESCRIPTION="interactive process viewer"
@@ -14,12 +14,13 @@ KEYWORDS="~alpha amd64 arm hppa ia64 ~mips ppc ppc64 sh sparc x86 ~x86-fbsd"
DEPEND="sys-libs/ncurses"
pkg_setup() {
- if use elibc_FreeBSD ; then
- elog
- elog "htop needs /proc mounted to work, to mount it type"
- elog "mount -t linprocfs none /proc"
- elog "or uncomment the example in /etc/fstab"
- elog
+ if use elibc_FreeBSD && ! [[ -f "${ROOT}"/proc/stat && -f "${ROOT}"/proc/meminfo ]] ; then
+ eerror
+ eerror "htop needs /proc mounted to compile and work, to mount it type"
+ eerror "mount -t linprocfs none /proc"
+ eerror "or uncomment the example in /etc/fstab"
+ eerror
+ die "htop needs /proc mounted"
fi
}
@@ -28,6 +29,9 @@ src_unpack() {
cd "${S}"
epatch "${FILESDIR}"/${P}-desktop-entry.patch
epatch "${FILESDIR}"/${P}-non-printable-char-filter.patch
+ epatch "${FILESDIR}"/${P}-no-plpa.patch
+
+ eautoreconf
}
src_compile() {