Gentoo Archives: gentoo-commits

From: Lars Wendler <polynomial-c@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: sys-process/htop/files/
Date: Mon, 26 Feb 2018 12:36:02
Message-Id: 1519648495.711f07a43b5e011123a93e7b09edcdce1008f4cd.polynomial-c@gentoo
1 commit: 711f07a43b5e011123a93e7b09edcdce1008f4cd
2 Author: Lars Wendler <polynomial-c <AT> gentoo <DOT> org>
3 AuthorDate: Mon Feb 26 12:34:55 2018 +0000
4 Commit: Lars Wendler <polynomial-c <AT> gentoo <DOT> org>
5 CommitDate: Mon Feb 26 12:34:55 2018 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=711f07a4
7
8 sys-process/htop: Replaced sysmacros patch with a much better one.
9
10 See https://github.com/hishamhm/htop/pull/746
11
12 Closes: https://bugs.gentoo.org/648630
13 Package-Manager: Portage-2.3.24, Repoman-2.3.6
14
15 sys-process/htop/files/htop-2.1.0-sysmacros.patch | 91 ++++++++++++++++-------
16 1 file changed, 66 insertions(+), 25 deletions(-)
17
18 diff --git a/sys-process/htop/files/htop-2.1.0-sysmacros.patch b/sys-process/htop/files/htop-2.1.0-sysmacros.patch
19 index 63677dd35fa..0ab1bb0c02a 100644
20 --- a/sys-process/htop/files/htop-2.1.0-sysmacros.patch
21 +++ b/sys-process/htop/files/htop-2.1.0-sysmacros.patch
22 @@ -1,40 +1,81 @@
23 -From 7fd09c08b5b50e5c0a2aebb66072deda4ac503fb Mon Sep 17 00:00:00 2001
24 -From: Lars Wendler <polynomial-c@g.o>
25 -Date: Mon, 5 Feb 2018 16:02:19 +0100
26 -Subject: [PATCH] Add <sys/sysmacros.h> to two files.
27 +From d2d413161bbdf009f232faa5789131326225f838 Mon Sep 17 00:00:00 2001
28 +From: Explorer09 <explorer09@×××××.com>
29 +Date: Sat, 24 Feb 2018 11:57:18 +0800
30 +Subject: [PATCH] Fix build failure ('major' undefined) in glibc 2.28.
31
32 ->=glibc-2.28 will no longer include sysmacros implicitly.
33 +glibc 2.28 no longer defines 'major' and 'minor' in <sys/types.h> and
34 +requires us to include <sys/sysmacros.h>. (glibc 2.25 starts
35 +deprecating the macros in <sys/types.h>.) Now do include the latter if
36 +found on the system.
37 +
38 +At the moment, let's also utilize AC_HEADER_MAJOR in configure script.
39 +However as Autoconf 2.69 has not yet updated the AC_HEADER_MAJOR macro
40 +to reflect the glibc change [1], so add a workaround code.
41 +
42 +Fixes #663. Supersedes pull request #729.
43 +
44 +Reference:
45 +[1] https://git.savannah.gnu.org/gitweb/?p=autoconf.git;a=commit;h=e17a30e987d7ee695fb4294a82d987ec3dc9b974
46 +
47 +Signed-off-by: Kang-Che Sung <explorer09@×××××.com>
48 ---
49 - Process.c | 3 +++
50 - linux/LinuxProcessList.c | 1 +
51 - 2 files changed, 4 insertions(+)
52 + Process.c | 6 ++++++
53 + configure.ac | 10 ++++++++++
54 + linux/LinuxProcessList.c | 6 ++++++
55 + 3 files changed, 22 insertions(+)
56
57 diff --git a/Process.c b/Process.c
58 -index 2ff778d..e135c60 100644
59 +index 2ff778df..845ca54b 100644
60 --- a/Process.c
61 +++ b/Process.c
62 -@@ -19,6 +19,9 @@ in the source distribution for its full text.
63 - #include <sys/param.h>
64 - #include <sys/stat.h>
65 - #include <sys/types.h>
66 -+#ifdef HAVE_SYS_SYSMACROS_H
67 -+# include <sys/sysmacros.h> /* for major, minor */
68 +@@ -28,6 +28,12 @@ in the source distribution for its full text.
69 + #include <time.h>
70 + #include <assert.h>
71 + #include <math.h>
72 ++#ifdef MAJOR_IN_MKDEV
73 ++#include <sys/mkdev.h>
74 ++#elif defined(MAJOR_IN_SYSMACROS) || \
75 ++ (defined(HAVE_SYS_SYSMACROS_H) && HAVE_SYS_SYSMACROS_H)
76 ++#include <sys/sysmacros.h>
77 +#endif
78 - #include <unistd.h>
79 - #include <stdlib.h>
80 - #include <signal.h>
81 +
82 + #ifdef __ANDROID__
83 + #define SYS_ioprio_get __NR_ioprio_get
84 +diff --git a/configure.ac b/configure.ac
85 +index 44595050..36aebc5e 100644
86 +--- a/configure.ac
87 ++++ b/configure.ac
88 +@@ -61,6 +61,16 @@ AC_CHECK_HEADERS([stdlib.h string.h strings.h sys/param.h sys/time.h unistd.h],[
89 + ])
90 + AC_CHECK_HEADERS([execinfo.h],[:],[:])
91 +
92 ++AC_HEADER_MAJOR
93 ++dnl glibc 2.25 deprecates 'major' and 'minor' in <sys/types.h> and requires to
94 ++dnl include <sys/sysmacros.h>. However the logic in AC_HEADER_MAJOR has not yet
95 ++dnl been updated in Autoconf 2.69, so use a workaround:
96 ++m4_version_prereq([2.70], [],
97 ++[if test $ac_cv_header_sys_mkdev_h = no; then
98 ++ AC_CHECK_HEADER(sys/sysmacros.h, [AC_DEFINE(MAJOR_IN_SYSMACROS, 1,
99 ++ [Define to 1 if `major', `minor', and `makedev' are declared in <sys/sysmacros.h>.])])
100 ++fi])
101 ++
102 + # Checks for typedefs, structures, and compiler characteristics.
103 + # ----------------------------------------------------------------------
104 + AC_HEADER_STDBOOL
105 diff --git a/linux/LinuxProcessList.c b/linux/LinuxProcessList.c
106 -index c8ba89d..fb95440 100644
107 +index c8ba89d2..158a7ea2 100644
108 --- a/linux/LinuxProcessList.c
109 +++ b/linux/LinuxProcessList.c
110 -@@ -25,6 +25,7 @@ in the source distribution for its full text.
111 - #include <time.h>
112 +@@ -26,6 +26,12 @@ in the source distribution for its full text.
113 #include <assert.h>
114 #include <sys/types.h>
115 -+#include <sys/sysmacros.h>
116 #include <fcntl.h>
117 ++#ifdef MAJOR_IN_MKDEV
118 ++#include <sys/mkdev.h>
119 ++#elif defined(MAJOR_IN_SYSMACROS) || \
120 ++ (defined(HAVE_SYS_SYSMACROS_H) && HAVE_SYS_SYSMACROS_H)
121 ++#include <sys/sysmacros.h>
122 ++#endif
123
124 #ifdef HAVE_DELAYACCT
125 ---
126 -2.16.2
127 -
128 + #include <netlink/attr.h>