1 |
commit: 5325dae5e32f45af0a3c9805d7e37ba3b594f1b6 |
2 |
Author: Lars Wendler <polynomial-c <AT> gentoo <DOT> org> |
3 |
AuthorDate: Sat May 21 08:20:22 2022 +0000 |
4 |
Commit: Lars Wendler <polynomial-c <AT> gentoo <DOT> org> |
5 |
CommitDate: Sat May 21 08:34:59 2022 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=5325dae5 |
7 |
|
8 |
sys-process/htop: Added live ebuild |
9 |
|
10 |
Introducing cap_sys_ptrace file capability for htop |
11 |
|
12 |
Bug: https://bugs.gentoo.org/846635 |
13 |
Signed-off-by: Lars Wendler <polynomial-c <AT> gentoo.org> |
14 |
|
15 |
sys-process/htop/htop-9999.ebuild | 113 ++++++++++++++++++++++++++++++++++++++ |
16 |
1 file changed, 113 insertions(+) |
17 |
|
18 |
diff --git a/sys-process/htop/htop-9999.ebuild b/sys-process/htop/htop-9999.ebuild |
19 |
new file mode 100644 |
20 |
index 000000000000..f8aa53177141 |
21 |
--- /dev/null |
22 |
+++ b/sys-process/htop/htop-9999.ebuild |
23 |
@@ -0,0 +1,113 @@ |
24 |
+# Copyright 1999-2022 Gentoo Authors |
25 |
+# Distributed under the terms of the GNU General Public License v2 |
26 |
+ |
27 |
+EAPI=8 |
28 |
+ |
29 |
+PYTHON_COMPAT=( python3_{8..10} ) |
30 |
+ |
31 |
+inherit autotools fcaps linux-info python-any-r1 xdg-utils |
32 |
+ |
33 |
+DESCRIPTION="interactive process viewer" |
34 |
+HOMEPAGE="https://htop.dev/ https://github.com/htop-dev/htop" |
35 |
+if [[ ${PV} == *9999 ]] ; then |
36 |
+ inherit git-r3 |
37 |
+ EGIT_REPO_URI="https://github.com/htop-dev/htop.git" |
38 |
+else |
39 |
+ SRC_URI="https://github.com/htop-dev/${PN}/archive/${PV/_}.tar.gz -> ${P}.tar.gz" |
40 |
+ KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~loong ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86 ~amd64-linux ~x86-linux ~x64-macos" |
41 |
+fi |
42 |
+ |
43 |
+LICENSE="BSD GPL-2+" |
44 |
+SLOT="0" |
45 |
+IUSE="caps debug delayacct hwloc lm-sensors llvm-libunwind openvz unicode unwind vserver" |
46 |
+ |
47 |
+BDEPEND="virtual/pkgconfig" |
48 |
+RDEPEND=" |
49 |
+ sys-libs/ncurses:=[unicode(+)?] |
50 |
+ hwloc? ( sys-apps/hwloc:= ) |
51 |
+ unwind? ( |
52 |
+ !llvm-libunwind? ( sys-libs/libunwind:= ) |
53 |
+ llvm-libunwind? ( sys-libs/llvm-libunwind:= ) |
54 |
+ ) |
55 |
+ kernel_linux? ( |
56 |
+ caps? ( sys-libs/libcap ) |
57 |
+ delayacct? ( dev-libs/libnl:3 ) |
58 |
+ lm-sensors? ( sys-apps/lm-sensors ) |
59 |
+ ) |
60 |
+" |
61 |
+DEPEND="${RDEPEND} |
62 |
+ ${PYTHON_DEPS}" |
63 |
+ |
64 |
+DOCS=( ChangeLog README ) |
65 |
+ |
66 |
+CONFIG_CHECK="~TASKSTATS ~TASK_XACCT ~TASK_IO_ACCOUNTING ~CGROUPS" |
67 |
+ |
68 |
+S="${WORKDIR}/${P/_}" |
69 |
+ |
70 |
+pkg_setup() { |
71 |
+ if ! has_version sys-process/lsof ; then |
72 |
+ ewarn "To use lsof features in htop (what processes are accessing" |
73 |
+ ewarn "what files), you must have sys-process/lsof installed." |
74 |
+ fi |
75 |
+ |
76 |
+ python-any-r1_pkg_setup |
77 |
+ linux-info_pkg_setup |
78 |
+} |
79 |
+ |
80 |
+src_prepare() { |
81 |
+ default |
82 |
+ |
83 |
+ eautoreconf |
84 |
+} |
85 |
+ |
86 |
+src_configure() { |
87 |
+ if [[ ${CBUILD} != ${CHOST} ]] ; then |
88 |
+ export ac_cv_file__proc_{meminfo,stat}=yes #328971 |
89 |
+ fi |
90 |
+ |
91 |
+ local myeconfargs=( |
92 |
+ --enable-unicode |
93 |
+ $(use_enable debug) |
94 |
+ $(use_enable hwloc) |
95 |
+ $(use_enable !hwloc affinity) |
96 |
+ $(use_enable openvz) |
97 |
+ $(use_enable unicode) |
98 |
+ $(use_enable unwind) |
99 |
+ $(use_enable vserver) |
100 |
+ ) |
101 |
+ |
102 |
+ if use kernel_linux ; then |
103 |
+ myeconfargs+=( |
104 |
+ $(use_enable caps capabilities) |
105 |
+ $(use_enable delayacct) |
106 |
+ $(use_enable lm-sensors sensors) |
107 |
+ ) |
108 |
+ else |
109 |
+ if use kernel_Darwin ; then |
110 |
+ # Upstream default to checking but --enable-affinity |
111 |
+ # overrides this. Simplest to just disable on Darwin |
112 |
+ # given it works on BSD anyway. |
113 |
+ myeconfargs+=( --disable-affinity ) |
114 |
+ fi |
115 |
+ |
116 |
+ myeconfargs+=( |
117 |
+ --disable-capabilities |
118 |
+ --disable-delayacct |
119 |
+ --disable-sensors |
120 |
+ ) |
121 |
+ fi |
122 |
+ |
123 |
+ econf ${myeconfargs[@]} |
124 |
+} |
125 |
+ |
126 |
+pkg_postinst() { |
127 |
+ xdg_desktop_database_update |
128 |
+ xdg_icon_cache_update |
129 |
+ |
130 |
+ fcaps cap_sys_ptrace /usr/bin/${PN} |
131 |
+} |
132 |
+ |
133 |
+pkg_postrm() { |
134 |
+ xdg_desktop_database_update |
135 |
+ xdg_icon_cache_update |
136 |
+} |