summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'sys-process/htop')
-rw-r--r--sys-process/htop/files/htop-2.1.0-MakeHeader-python3.patch29
-rw-r--r--sys-process/htop/files/htop-2.1.0-bashisms.patch37
-rw-r--r--sys-process/htop/files/htop-2.1.0-clear_on_sigwinch.patch21
-rw-r--r--sys-process/htop/files/htop-2.1.0-color_issues.patch87
-rw-r--r--sys-process/htop/files/htop-2.1.0-header_updates.patch42
-rw-r--r--sys-process/htop/files/htop-2.1.0-ldflags.patch21
-rw-r--r--sys-process/htop/files/htop-2.1.0-ncurses_cflags.patch46
-rw-r--r--sys-process/htop/htop-2.1.0-r1.ebuild75
8 files changed, 358 insertions, 0 deletions
diff --git a/sys-process/htop/files/htop-2.1.0-MakeHeader-python3.patch b/sys-process/htop/files/htop-2.1.0-MakeHeader-python3.patch
new file mode 100644
index 000000000000..7c8590a29919
--- /dev/null
+++ b/sys-process/htop/files/htop-2.1.0-MakeHeader-python3.patch
@@ -0,0 +1,29 @@
+https://bugs.gentoo.org/646880
+
+--- a/scripts/MakeHeader.py
++++ b/scripts/MakeHeader.py
+@@ -1,5 +1,5 @@
+ #!/usr/bin/env python
+-import os, sys, string
++import os, sys, string, io
+ try:
+ from cStringIO import StringIO
+ except ImportError:
+@@ -16,7 +16,7 @@ SKIPONE=4
+ state = ANY
+ static = 0
+
+-file = open(sys.argv[1])
++file = io.open(sys.argv[1], "r", errors="ignore")
+ name = sys.argv[1][:-2]
+
+ out = StringIO()
+@@ -94,7 +94,7 @@ out.write( "#endif\n" )
+ # This prevents a lot of recompilation during development
+ out.seek(0)
+ try:
+- with open(name + ".h", "r") as orig:
++ with io.open(name + ".h", "r", errors="ignore") as orig:
+ origcontents = orig.readlines()
+ except:
+ origcontents = ""
diff --git a/sys-process/htop/files/htop-2.1.0-bashisms.patch b/sys-process/htop/files/htop-2.1.0-bashisms.patch
new file mode 100644
index 000000000000..3b5bdabe82fd
--- /dev/null
+++ b/sys-process/htop/files/htop-2.1.0-bashisms.patch
@@ -0,0 +1,37 @@
+From d4ea7cd65ccf8551cabb0706167b2c15aad7866d Mon Sep 17 00:00:00 2001
+From: Jesin <jesin00@gmail.com>
+Date: Mon, 26 Feb 2018 18:07:52 -0500
+Subject: [PATCH] Fix bashisms (#749)
+
+The configure script relied on bash-specific extensions to shell syntax
+and behavior, causing build failures on systems with other /bin/sh
+implementations. This commit replaces those with equivalent constructs
+that should work in all POSIX shells.
+---
+ configure.ac | 6 +++---
+ 1 file changed, 3 insertions(+), 3 deletions(-)
+
+diff --git a/configure.ac b/configure.ac
+index d4bb36b0..3d69756d 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -66,7 +66,7 @@ dnl glibc 2.25 deprecates 'major' and 'minor' in <sys/types.h> and requires to
+ dnl include <sys/sysmacros.h>. However the logic in AC_HEADER_MAJOR has not yet
+ dnl been updated in Autoconf 2.69, so use a workaround:
+ m4_version_prereq([2.70], [],
+-[if test $ac_cv_header_sys_mkdev_h = no; then
++[if test "x$ac_cv_header_sys_mkdev_h" = xno; then
+ AC_CHECK_HEADER(sys/sysmacros.h, [AC_DEFINE(MAJOR_IN_SYSMACROS, 1,
+ [Define to 1 if `major', `minor', and `makedev' are declared in <sys/sysmacros.h>.])])
+ fi])
+@@ -278,8 +278,8 @@ then
+ PKG_PROG_PKG_CONFIG()
+ PKG_CHECK_MODULES(LIBNL3, libnl-3.0, [], [missing_libraries="$missing_libraries libnl-3"])
+ PKG_CHECK_MODULES(LIBNL3GENL, libnl-genl-3.0, [], [missing_libraries="$missing_libraries libnl-genl-3"])
+- CFLAGS+=" $LIBNL3_CFLAGS $LIBNL3GENL_CFLAGS"
+- LIBS+=" $LIBNL3_LIBS $LIBNL3GENL_LIBS"
++ CFLAGS="$CFLAGS $LIBNL3_CFLAGS $LIBNL3GENL_CFLAGS"
++ LIBS="$LIBS $LIBNL3_LIBS $LIBNL3GENL_LIBS"
+ AC_DEFINE(HAVE_DELAYACCT, 1, [Define if delay accounting support should be enabled.])
+ fi
+
diff --git a/sys-process/htop/files/htop-2.1.0-clear_on_sigwinch.patch b/sys-process/htop/files/htop-2.1.0-clear_on_sigwinch.patch
new file mode 100644
index 000000000000..3ba7147e3b4f
--- /dev/null
+++ b/sys-process/htop/files/htop-2.1.0-clear_on_sigwinch.patch
@@ -0,0 +1,21 @@
+From 5fca258f33e08cd7733940391edbf9e22208de83 Mon Sep 17 00:00:00 2001
+From: guoci <zguoci@gmail.com>
+Date: Sat, 17 Feb 2018 13:25:57 -0500
+Subject: [PATCH] call clear() function when SIGWINCH is received. (#660)
+
+---
+ Action.c | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/Action.c b/Action.c
+index a6394ac3..50ab0bb9 100644
+--- a/Action.c
++++ b/Action.c
+@@ -185,6 +185,7 @@ static Htop_Reaction sortBy(State* st) {
+ // ----------------------------------------
+
+ static Htop_Reaction actionResize(State* st) {
++ clear();
+ Panel_resize(st->panel, COLS, LINES-(st->panel->y)-1);
+ return HTOP_REDRAW_BAR;
+ }
diff --git a/sys-process/htop/files/htop-2.1.0-color_issues.patch b/sys-process/htop/files/htop-2.1.0-color_issues.patch
new file mode 100644
index 000000000000..0b4bea8bb956
--- /dev/null
+++ b/sys-process/htop/files/htop-2.1.0-color_issues.patch
@@ -0,0 +1,87 @@
+From ac2dff2881a7ab203750e8edf7a46b69ae492ed0 Mon Sep 17 00:00:00 2001
+From: Hisham Muhammad <hisham@gobolinux.org>
+Date: Mon, 5 Feb 2018 07:01:12 +0100
+Subject: [PATCH] Fix color behavior on some terminals.
+
+Fixes #635.
+---
+ CRT.c | 32 +++++++++++++++++---------------
+ CRT.h | 1 +
+ ColorsPanel.c | 1 +
+ 3 files changed, 19 insertions(+), 15 deletions(-)
+
+diff --git a/CRT.c b/CRT.c
+index 237e30ef..ca9a10dd 100644
+--- a/CRT.c
++++ b/CRT.c
+@@ -37,6 +37,7 @@ in the source distribution for its full text.
+ #define White COLOR_WHITE
+
+ #define ColorPairGrayBlack ColorPair(Magenta,Magenta)
++#define ColorIndexGrayBlack ColorIndex(Magenta,Magenta)
+
+ #define KEY_WHEELUP KEY_F(20)
+ #define KEY_WHEELDOWN KEY_F(21)
+@@ -713,22 +714,23 @@ void CRT_enableDelay() {
+
+ void CRT_setColors(int colorScheme) {
+ CRT_colorScheme = colorScheme;
+- if (colorScheme == COLORSCHEME_BLACKNIGHT) {
+- for (int i = 0; i < 8; i++)
+- for (int j = 0; j < 8; j++) {
+- if (ColorIndex(i,j) != ColorIndex(Magenta,Magenta)) {
+- init_pair(ColorIndex(i,j), i, j);
+- }
+- }
+- init_pair(ColorIndex(Magenta,Magenta), 8, 0);
+- } else {
+- for (int i = 0; i < 8; i++)
+- for (int j = 0; j < 8; j++) {
+- if (ColorIndex(i,j) != ColorIndex(Magenta,Magenta)) {
+- init_pair(ColorIndex(i,j), i, (j==0?-1:j));
+- }
++
++ for (int i = 0; i < 8; i++) {
++ for (int j = 0; j < 8; j++) {
++ if (ColorIndex(i,j) != ColorPairGrayBlack) {
++ int bg = (colorScheme != COLORSCHEME_BLACKNIGHT)
++ ? (j==0 ? -1 : j)
++ : j;
++ init_pair(ColorIndex(i,j), i, bg);
+ }
+- init_pair(ColorIndex(Magenta,Magenta), 8, -1);
++ }
+ }
++
++ int grayBlackFg = COLORS > 8 ? 8 : 0;
++ int grayBlackBg = (colorScheme != COLORSCHEME_BLACKNIGHT)
++ ? -1
++ : 0;
++ init_pair(ColorIndexGrayBlack, grayBlackFg, grayBlackBg);
++
+ CRT_colors = CRT_colorSchemes[colorScheme];
+ }
+diff --git a/CRT.h b/CRT.h
+index 590fff6e..933fe068 100644
+--- a/CRT.h
++++ b/CRT.h
+@@ -26,6 +26,7 @@ in the source distribution for its full text.
+ #define White COLOR_WHITE
+
+ #define ColorPairGrayBlack ColorPair(Magenta,Magenta)
++#define ColorIndexGrayBlack ColorIndex(Magenta,Magenta)
+
+ #define KEY_WHEELUP KEY_F(20)
+ #define KEY_WHEELDOWN KEY_F(21)
+diff --git a/ColorsPanel.c b/ColorsPanel.c
+index 627a516a..2028335f 100644
+--- a/ColorsPanel.c
++++ b/ColorsPanel.c
+@@ -78,6 +78,7 @@ static HandlerResult ColorsPanel_eventHandler(Panel* super, int ch) {
+ this->settings->changed = true;
+ const Header* header = this->scr->header;
+ CRT_setColors(mark);
++ clear();
+ Panel* menu = (Panel*) Vector_get(this->scr->panels, 0);
+ Header_draw(header);
+ RichString_setAttr(&(super->header), CRT_colors[PANEL_HEADER_FOCUS]);
diff --git a/sys-process/htop/files/htop-2.1.0-header_updates.patch b/sys-process/htop/files/htop-2.1.0-header_updates.patch
new file mode 100644
index 000000000000..5c36d8b337e4
--- /dev/null
+++ b/sys-process/htop/files/htop-2.1.0-header_updates.patch
@@ -0,0 +1,42 @@
+From ccd156f8ba68c3c82f9a3afef46e414b2af16613 Mon Sep 17 00:00:00 2001
+From: Hisham Muhammad <hisham@gobolinux.org>
+Date: Mon, 26 Feb 2018 11:44:00 -0300
+Subject: [PATCH] Updates to generated header files
+
+---
+ Process.h | 5 +++++
+ linux/LinuxProcessList.h | 5 +++++
+ 2 files changed, 10 insertions(+)
+
+diff --git a/Process.h b/Process.h
+index 6c41edc2..fda8480a 100644
+--- a/Process.h
++++ b/Process.h
+@@ -9,6 +9,11 @@ Released under the GNU GPL, see the COPYING file
+ in the source distribution for its full text.
+ */
+
++#ifdef MAJOR_IN_MKDEV
++#elif defined(MAJOR_IN_SYSMACROS) || \
++ (defined(HAVE_SYS_SYSMACROS_H) && HAVE_SYS_SYSMACROS_H)
++#endif
++
+ #ifdef __ANDROID__
+ #define SYS_ioprio_get __NR_ioprio_get
+ #define SYS_ioprio_set __NR_ioprio_set
+diff --git a/linux/LinuxProcessList.h b/linux/LinuxProcessList.h
+index 5005220a..0851a102 100644
+--- a/linux/LinuxProcessList.h
++++ b/linux/LinuxProcessList.h
+@@ -9,6 +9,11 @@ Released under the GNU GPL, see the COPYING file
+ in the source distribution for its full text.
+ */
+
++#ifdef MAJOR_IN_MKDEV
++#elif defined(MAJOR_IN_SYSMACROS) || \
++ (defined(HAVE_SYS_SYSMACROS_H) && HAVE_SYS_SYSMACROS_H)
++#endif
++
+ #ifdef HAVE_DELAYACCT
+ #endif
+
diff --git a/sys-process/htop/files/htop-2.1.0-ldflags.patch b/sys-process/htop/files/htop-2.1.0-ldflags.patch
new file mode 100644
index 000000000000..386542f35479
--- /dev/null
+++ b/sys-process/htop/files/htop-2.1.0-ldflags.patch
@@ -0,0 +1,21 @@
+From df9922a67eb8e02ab4cf1ff8f24b40f14094e699 Mon Sep 17 00:00:00 2001
+From: Hisham Muhammad <hisham@gobolinux.org>
+Date: Sat, 17 Feb 2018 14:50:55 -0200
+Subject: [PATCH] Fix preservation of LDFLAGS value during configure script
+
+Fixes #738.
+---
+
+diff --git a/configure.ac b/configure.ac
+index df922e07..44595050 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -167,7 +167,7 @@ m4_define([HTOP_CHECK_SCRIPT],
+ LIBS="$htop_config_script $LIBS "
+ htop_script_success=yes
+ ], [])
+- LDFLAGS="$save_LDFLAGS"
++ LDFLAGS="$htop_save_LDFLAGS"
+ fi
+ if test "x$htop_script_success" = xno; then
+ [$5]
diff --git a/sys-process/htop/files/htop-2.1.0-ncurses_cflags.patch b/sys-process/htop/files/htop-2.1.0-ncurses_cflags.patch
new file mode 100644
index 000000000000..0a25aeb7fa23
--- /dev/null
+++ b/sys-process/htop/files/htop-2.1.0-ncurses_cflags.patch
@@ -0,0 +1,46 @@
+From bc5d46982f3504000567e00f59e4f7a5905597a9 Mon Sep 17 00:00:00 2001
+From: Michael Klein <michael.klein@puffin.lb.shuttle.de>
+Date: Mon, 26 Feb 2018 14:19:01 +0100
+Subject: [PATCH] use CFLAGS from ncurses*-config, if present (#745)
+
+Fixes #695.
+---
+ configure.ac | 18 ++++++++++++------
+ 1 file changed, 12 insertions(+), 6 deletions(-)
+
+diff --git a/configure.ac b/configure.ac
+index 36aebc5e..d4bb36b0 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -164,19 +164,25 @@ m4_define([HTOP_CHECK_SCRIPT],
+ [
+ if test ! -z "m4_toupper($HTOP_[$1]_CONFIG_SCRIPT)"; then
+ # to be used to set the path to ncurses*-config when cross-compiling
+- htop_config_script=$(m4_toupper($HTOP_[$1]_CONFIG_SCRIPT) --libs 2> /dev/null)
++ htop_config_script_libs=$(m4_toupper($HTOP_[$1]_CONFIG_SCRIPT) --libs 2> /dev/null)
++ htop_config_script_cflags=$(m4_toupper($HTOP_[$1]_CONFIG_SCRIPT) --cflags 2> /dev/null)
+ else
+- htop_config_script=$([$4] --libs 2> /dev/null)
++ htop_config_script_libs=$([$4] --libs 2> /dev/null)
++ htop_config_script_cflags=$([$4] --cflags 2> /dev/null)
+ fi
+ htop_script_success=no
+ htop_save_LDFLAGS="$LDFLAGS"
+- if test ! "x$htop_config_script" = x; then
+- LDFLAGS="$htop_config_script $LDFLAGS"
++ htop_save_CFLAGS="$CFLAGS"
++ if test ! "x$htop_config_script_libs" = x; then
++ LDFLAGS="$htop_config_script_libs $LDFLAGS"
++ CFLAGS="$htop_config_script_cflags $CFLAGS"
+ AC_CHECK_LIB([$1], [$2], [
+ AC_DEFINE([$3], 1, [The library is present.])
+- LIBS="$htop_config_script $LIBS "
++ LIBS="$htop_config_script_libs $LIBS "
+ htop_script_success=yes
+- ], [])
++ ], [
++ CFLAGS="$htop_save_CFLAGS"
++ ])
+ LDFLAGS="$htop_save_LDFLAGS"
+ fi
+ if test "x$htop_script_success" = xno; then
diff --git a/sys-process/htop/htop-2.1.0-r1.ebuild b/sys-process/htop/htop-2.1.0-r1.ebuild
new file mode 100644
index 000000000000..a6d93f24ee22
--- /dev/null
+++ b/sys-process/htop/htop-2.1.0-r1.ebuild
@@ -0,0 +1,75 @@
+# Copyright 1999-2018 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+PYTHON_COMPAT=( python2_7 python3_{4,5,6} )
+
+inherit autotools linux-info python-single-r1
+
+DESCRIPTION="interactive process viewer"
+HOMEPAGE="http://hisham.hm/htop/"
+SRC_URI="http://hisham.hm/htop/releases/${PV}/${P}.tar.gz"
+
+LICENSE="BSD GPL-2"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~sh ~sparc ~x86 ~amd64-fbsd ~amd64-linux ~x86-linux"
+IUSE="kernel_FreeBSD kernel_linux openvz unicode vserver"
+
+RDEPEND="sys-libs/ncurses:0=[unicode?]"
+DEPEND="${RDEPEND}
+ ${PYTHON_DEPS}
+ virtual/pkgconfig"
+
+REQUIRED_USE=${PYTHON_REQUIRED_USE}
+
+DOCS=( ChangeLog README )
+
+CONFIG_CHECK="~TASKSTATS ~TASK_XACCT ~TASK_IO_ACCOUNTING ~CGROUPS"
+
+PATCHES=(
+ "${FILESDIR}/${PN}-2.1.0-MakeHeader-python3.patch" #646880
+
+ # Fixes from upstream (can usually be removed with next version bump)
+ "${FILESDIR}/${P}-sysmacros.patch"
+ "${FILESDIR}/${P}-ldflags.patch"
+ "${FILESDIR}/${P}-bashisms.patch"
+ "${FILESDIR}/${P}-ncurses_cflags.patch"
+ "${FILESDIR}/${P}-clear_on_sigwinch.patch"
+ "${FILESDIR}/${P}-header_updates.patch"
+ "${FILESDIR}/${P}-color_issues.patch"
+)
+
+pkg_setup() {
+ if ! has_version sys-process/lsof; then
+ ewarn "To use lsof features in htop(what processes are accessing"
+ ewarn "what files), you must have sys-process/lsof installed."
+ fi
+
+ python-single-r1_pkg_setup
+ linux-info_pkg_setup
+}
+
+src_prepare() {
+ rm missing || die
+
+ default
+ eautoreconf
+ python_fix_shebang scripts/MakeHeader.py
+}
+
+src_configure() {
+ [[ $CBUILD != $CHOST ]] && export ac_cv_file__proc_{meminfo,stat}=yes #328971
+
+ local myeconfargs=(
+ # fails to build against recent hwloc versions
+ --disable-hwloc
+ --enable-taskstats
+ $(use_enable kernel_linux cgroup)
+ $(use_enable kernel_linux linux-affinity)
+ $(use_enable openvz)
+ $(use_enable unicode)
+ $(use_enable vserver)
+ )
+ econf ${myeconfargs[@]}
+}