summaryrefslogtreecommitdiff
path: root/sys-process/htop
diff options
context:
space:
mode:
authorV3n3RiX <venerix@redcorelinux.org>2018-03-02 15:59:12 +0000
committerV3n3RiX <venerix@redcorelinux.org>2018-03-02 15:59:12 +0000
commit06a7b5647e11a8ddf69b1c3d3ded6a8ba28b923e (patch)
tree8d58c1f4b049da677b33209b072f2b3057268fe0 /sys-process/htop
parent99abbc5e5a6ecd3fc981b45646fd8cb5d320377b (diff)
gentoo resync : 02.03.2018
Diffstat (limited to 'sys-process/htop')
-rw-r--r--sys-process/htop/Manifest10
-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/files/htop-2.1.0-sysmacros.patch91
-rw-r--r--sys-process/htop/htop-2.1.0-r1.ebuild76
10 files changed, 434 insertions, 26 deletions
diff --git a/sys-process/htop/Manifest b/sys-process/htop/Manifest
index 5f5364b2be29..32e9f6ec46cb 100644
--- a/sys-process/htop/Manifest
+++ b/sys-process/htop/Manifest
@@ -1,7 +1,15 @@
AUX htop-2.0.2-tinfo.patch 3655 BLAKE2B 505aacb774b54e4c7d9238942ff74cc96d0f5c93c7b74e9531e41e2ffa994b4d475b16620b65b824c28da2856294ef7fcd3562d9c318d4adbcc30bb512431b0f SHA512 33273ddcb89e955ef499854fb9361b65bafa83cce8e91f4ef62dd70fc29e58e169148c957d9cd0c5a123b9e5fe66f838212c8066bff12ada38c430087d02b210
-AUX htop-2.1.0-sysmacros.patch 1124 BLAKE2B 4fa3ef919eb6e814d2bab2b749edd36a805a7b3369c311cc6a4b0aae8da7b15c14aa3e3b7ff6f8b9ce9426c06942b96e31ee7e370ed6bac08f5ff8f67654aaed SHA512 08c24d7c720059b25acf6c107c53f47b1253f49fed4734af2ede1886b2f193a0fe76814b552862faea7ea11478ee3431463b8778be4240515cfb225681fb4340
+AUX htop-2.1.0-MakeHeader-python3.patch 710 BLAKE2B 26da173c3582436157175c46efd3f8c3571b9d02a96d8fa66e410dfc0db75cb9811f9171ff26cab503360f6252077e77bbd81ad180fc7521a413e4b71e866233 SHA512 caf2e9fe36b0d0f1f76d0d352c7cd11aab4c6b4196f2281f026257a695350541b62e23ae1db5906fb21f9360042c2d4b7ebf5b8a9ebcfb1c276dc44f690d0479
+AUX htop-2.1.0-bashisms.patch 1697 BLAKE2B 56af3d8931780a6e0e7a6f530267d295f7a94ec3f60847d1bef2897bc6f06a2aceb4290c2a1efc4747794887a9ab218f06dcf3c0176fc3e26c417315c33f6599 SHA512 92bbda50297971704f81d47284b6775bcd24a9f7a1698d66c029efdf74b9487ef92cec526829ba2f6e866f630817839776b7bd51bb588dd5c4a2340773801b80
+AUX htop-2.1.0-clear_on_sigwinch.patch 621 BLAKE2B a17551f19f48f57924e440e605dd893822b43068d12bb9d32eb11357d0431a785016d74b0c33234a68da265a530f8488c63510d4f69f205ff4c6fbfa35aa864e SHA512 b3fc6775549bb0e3c4a6f0d90a658e1b129bbc70d10d042dddc1bff9d8a35764ae6dbee69e83f61cc0d3d8a54d3ef78fb55312f4a3bb7750e4e2be1f421257fd
+AUX htop-2.1.0-color_issues.patch 2923 BLAKE2B ca204caed20c5ade062e78b8b3950424d771a9674b17f14cb892edf6c690af15d4d49776ddfe92b4bbf967281bd92e5033180fe372292480a4097ccec705366c SHA512 40c3bf80d051408fda9df4a98b9c8f3f909521549cdfca96e0468feadf53ffdf5ce62a61d6a55a91708c8db33c34a2389ecbcd6b7a8a34a1e9c0e69ce1bfb733
+AUX htop-2.1.0-header_updates.patch 1213 BLAKE2B 4bf06329ee553b29c40c46b8dd0a267d19d17c0b19e8f7938b9276cfced5ba734924c2228408e7e2bee8088250c85d9cfa1cee508c1f3b4f8554d4be8e47cd2b SHA512 63644982da6a92a5477286df4c2cc16097aee8b6f8fcee6c37448d36074770b2f5f8f5a1dbac32728db79dbfb4a094fdd31128cec1ba322ada0b6a0968e53f98
+AUX htop-2.1.0-ldflags.patch 635 BLAKE2B 7f35a75f9e35007029c05dacc8f5198b924b19e3ef28235bd0feae4d87f4d8016803f094f485030831725df6b2b7140e7c755b70e4118eee98d1acdaf16368ed SHA512 3500ba9182f2739327d0b6db1e273ab7d4d09f5c902ec78d852dba0168f30ad138aaf81fbe11b8a21848eedba394b32b0f3f2a78747c61f1fab4464f7fb44fdd
+AUX htop-2.1.0-ncurses_cflags.patch 1827 BLAKE2B 1881d0de7a8e1e16eb55280fc25d66bf00aabd3ee3ba06f74bc1f56222e324cd54c6e0458951507d296ba7573e7417b4c57c2d14f31b36487bfffbbd4cce8633 SHA512 cd3bcfd59f84828ce7842ef58ed37ed7fd376c841d7d54c634eb46bad7a5b86f02355a17a85e93c67d63382cefc51adce41ed9dbf355bd3083013c3cde38630f
+AUX htop-2.1.0-sysmacros.patch 2913 BLAKE2B 85ab3ffb0892c676a2c00519872faa898a2baad45948ac3d794eacc5bd045f592e0b46be7477c4ba27f1019f54911c11ee18cd90de433e11820cfd018c5aa7bc SHA512 ed4b05923ab4597afe6abd0c39107c858b2e9af7938625aefa23a300cfb12cf11f7f13704133d085c5bd8c64c70cc28d2db2f80a68e7a76ad4af3a9cc8c3bffa
DIST htop-2.0.2.tar.gz 476364 BLAKE2B f5519977b4bd6d189cb7f379a9f9b535a4b67a575b30056a43e259ab39a69f84083d310bbefefe8408c7ca99918f1ea9ae775808b9afe9d0f78097ac6bb88dc7 SHA512 1c9bf71a36c56b301667aa6d03756fc757fbcb63e848d9581d10db3df6193cdeb00e55ceb6e2392794ac03ea034b04459a8fe550b3ac2318cd86263a74c78cda
DIST htop-2.1.0.tar.gz 302938 BLAKE2B 3e290a3dbb0bf5424780ba5dcb9de8ea478bf4cabbbde202c19eb3db7e0f8d1e108ec3ea41544ac095097c39100417c72477dab96f104a6317f4edd06d69199f SHA512 203e8f4abd63334330fc673f6c9609adbeab763d80f553d8b48670091d18dd347599a9ce2dbbac374fa4a13fa904948711a441fa676f52ab1612bd2b4ee4c6eb
EBUILD htop-2.0.2.ebuild 1390 BLAKE2B d38a5264ba9f0f2c8467f3dc2ad61440c50945a2ae2b8782879e93084b405253899a8430aff263181b9b11bc74376d8a9f087bcbf4e29908e3c9bdd607cf8d6d SHA512 82e5bc99fe341b7492f219193fb74c241ba035455e0faae7cea42635a99069c6d195157d8bb6e13277483e47d5df37a579dcf57c0a6e0a33ec31d983b9b9f5c7
+EBUILD htop-2.1.0-r1.ebuild 1979 BLAKE2B 43e3bbfcae759dcbe92f57e8d745a09170a2110ea8b3aef0f76e73c5e07098a589df3194aee217a98b109701c72568403d57562c426d141066a4aa409dcf776d SHA512 69685c882193112e4dfea70f19d61e56a75a4e5cea1a3f39598e87cad6cb97cc8323bdb8477045e363db1cea8ea844ad13bc2e50fd8f59fe5e10828bfea0d53b
EBUILD htop-2.1.0.ebuild 1379 BLAKE2B 28b200bb48a064344f3608bf9664c875e1822221ced53ec4ede8dae44fa7e945826ead71532a286e25408ff64c50e2f5ecf4d9091ede63ec2224e54046723cea SHA512 b82a6c3c7bdc507f1e7ac2aad70472d5e237f218af2c7564dbd1070c45c90d093e0a5bfac40f7b9629e7ff4d4595065dd5f1e903902428a03eeb25d12548acc7
MISC metadata.xml 750 BLAKE2B 57d419667fbc0053cb2f24908a4e43fefecca832bd86e8d562a4a43090b82f049c62457388ffe8bc4c1f3d49e1119da50f8221686b69956f4ea9426259fb6f3a SHA512 e35d8a5177f9e5bb3136759a7c4c0de5dee4366e3380952c8d72dbdfab46be5f880b77450046f02846c7baa1892e88835c8480808333934ec1bec04c34cd9072
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/files/htop-2.1.0-sysmacros.patch b/sys-process/htop/files/htop-2.1.0-sysmacros.patch
index 63677dd35fa9..0ab1bb0c02a0 100644
--- a/sys-process/htop/files/htop-2.1.0-sysmacros.patch
+++ b/sys-process/htop/files/htop-2.1.0-sysmacros.patch
@@ -1,40 +1,81 @@
-From 7fd09c08b5b50e5c0a2aebb66072deda4ac503fb Mon Sep 17 00:00:00 2001
-From: Lars Wendler <polynomial-c@gentoo.org>
-Date: Mon, 5 Feb 2018 16:02:19 +0100
-Subject: [PATCH] Add <sys/sysmacros.h> to two files.
+From d2d413161bbdf009f232faa5789131326225f838 Mon Sep 17 00:00:00 2001
+From: Explorer09 <explorer09@gmail.com>
+Date: Sat, 24 Feb 2018 11:57:18 +0800
+Subject: [PATCH] Fix build failure ('major' undefined) in glibc 2.28.
->=glibc-2.28 will no longer include sysmacros implicitly.
+glibc 2.28 no longer defines 'major' and 'minor' in <sys/types.h> and
+requires us to include <sys/sysmacros.h>. (glibc 2.25 starts
+deprecating the macros in <sys/types.h>.) Now do include the latter if
+found on the system.
+
+At the moment, let's also utilize AC_HEADER_MAJOR in configure script.
+However as Autoconf 2.69 has not yet updated the AC_HEADER_MAJOR macro
+to reflect the glibc change [1], so add a workaround code.
+
+Fixes #663. Supersedes pull request #729.
+
+Reference:
+[1] https://git.savannah.gnu.org/gitweb/?p=autoconf.git;a=commit;h=e17a30e987d7ee695fb4294a82d987ec3dc9b974
+
+Signed-off-by: Kang-Che Sung <explorer09@gmail.com>
---
- Process.c | 3 +++
- linux/LinuxProcessList.c | 1 +
- 2 files changed, 4 insertions(+)
+ Process.c | 6 ++++++
+ configure.ac | 10 ++++++++++
+ linux/LinuxProcessList.c | 6 ++++++
+ 3 files changed, 22 insertions(+)
diff --git a/Process.c b/Process.c
-index 2ff778d..e135c60 100644
+index 2ff778df..845ca54b 100644
--- a/Process.c
+++ b/Process.c
-@@ -19,6 +19,9 @@ in the source distribution for its full text.
- #include <sys/param.h>
- #include <sys/stat.h>
- #include <sys/types.h>
-+#ifdef HAVE_SYS_SYSMACROS_H
-+# include <sys/sysmacros.h> /* for major, minor */
+@@ -28,6 +28,12 @@ in the source distribution for its full text.
+ #include <time.h>
+ #include <assert.h>
+ #include <math.h>
++#ifdef MAJOR_IN_MKDEV
++#include <sys/mkdev.h>
++#elif defined(MAJOR_IN_SYSMACROS) || \
++ (defined(HAVE_SYS_SYSMACROS_H) && HAVE_SYS_SYSMACROS_H)
++#include <sys/sysmacros.h>
+#endif
- #include <unistd.h>
- #include <stdlib.h>
- #include <signal.h>
+
+ #ifdef __ANDROID__
+ #define SYS_ioprio_get __NR_ioprio_get
+diff --git a/configure.ac b/configure.ac
+index 44595050..36aebc5e 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -61,6 +61,16 @@ AC_CHECK_HEADERS([stdlib.h string.h strings.h sys/param.h sys/time.h unistd.h],[
+ ])
+ AC_CHECK_HEADERS([execinfo.h],[:],[:])
+
++AC_HEADER_MAJOR
++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
++ 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])
++
+ # Checks for typedefs, structures, and compiler characteristics.
+ # ----------------------------------------------------------------------
+ AC_HEADER_STDBOOL
diff --git a/linux/LinuxProcessList.c b/linux/LinuxProcessList.c
-index c8ba89d..fb95440 100644
+index c8ba89d2..158a7ea2 100644
--- a/linux/LinuxProcessList.c
+++ b/linux/LinuxProcessList.c
-@@ -25,6 +25,7 @@ in the source distribution for its full text.
- #include <time.h>
+@@ -26,6 +26,12 @@ in the source distribution for its full text.
#include <assert.h>
#include <sys/types.h>
-+#include <sys/sysmacros.h>
#include <fcntl.h>
++#ifdef MAJOR_IN_MKDEV
++#include <sys/mkdev.h>
++#elif defined(MAJOR_IN_SYSMACROS) || \
++ (defined(HAVE_SYS_SYSMACROS_H) && HAVE_SYS_SYSMACROS_H)
++#include <sys/sysmacros.h>
++#endif
#ifdef HAVE_DELAYACCT
---
-2.16.2
-
+ #include <netlink/attr.h>
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..14a9ecd0dfb1
--- /dev/null
+++ b/sys-process/htop/htop-2.1.0-r1.ebuild
@@ -0,0 +1,76 @@
+# 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=(
+
+ # 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
+ use python_single_target_python2_7 || \
+ eapply "${FILESDIR}/${PN}-2.1.0-MakeHeader-python3.patch" #646880
+ 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[@]}
+}