summaryrefslogtreecommitdiff
path: root/sys-process/atop
diff options
context:
space:
mode:
authorroot <root@alpha.trunkmasters.com>2026-06-04 05:48:38 -0500
committerroot <root@alpha.trunkmasters.com>2026-06-04 05:48:38 -0500
commitbfd9c39e4712ebdb442d4ca0673061faed1e70e1 (patch)
tree0d7a74b4463ee387f9cf9368ceb1b757f694f72a /sys-process/atop
parentf716a9fe6455d39eef01e718aae68dae61c19704 (diff)
downloadbaldeagleos-repo-bfd9c39e4712ebdb442d4ca0673061faed1e70e1.tar.gz
baldeagleos-repo-bfd9c39e4712ebdb442d4ca0673061faed1e70e1.tar.xz
baldeagleos-repo-bfd9c39e4712ebdb442d4ca0673061faed1e70e1.zip
Revert "Adding metadata"
This reverts commit f716a9fe6455d39eef01e718aae68dae61c19704.
Diffstat (limited to 'sys-process/atop')
-rw-r--r--sys-process/atop/Manifest2
-rw-r--r--sys-process/atop/atop-2.12.1.ebuild152
-rw-r--r--sys-process/atop/files/atop-2.11.0-build.patch39
-rw-r--r--sys-process/atop/files/atop-2.12.0-atopgpud.patch112
-rw-r--r--sys-process/atop/files/atop-2.12.0-respect-opt.patch12
-rw-r--r--sys-process/atop/files/atopgpud.initd12
-rw-r--r--sys-process/atop/files/netatop-3.2.2-strict-prototype.patch77
-rw-r--r--sys-process/atop/metadata.xml14
8 files changed, 420 insertions, 0 deletions
diff --git a/sys-process/atop/Manifest b/sys-process/atop/Manifest
new file mode 100644
index 000000000000..d54947935b6f
--- /dev/null
+++ b/sys-process/atop/Manifest
@@ -0,0 +1,2 @@
+DIST atop-2.12.1.tar.gz 336538 BLAKE2B 5a7de979f6a919415cea7e68b2410f7d0f75b887ec1841e5061d2db3010f04335b9fa921d1c0fc78866b93e2808a6771a50caede920c465fc294007f88f1a58e SHA512 e01db51bf025598e7bad585f62761e10d23a77f6c7be96418bc8919a72c74628851ae5cbdc0c12ed752f80b44f5b72f2102692dbbb3210cacc59b32340107ce7
+DIST netatop-3.2.2.tar.gz 23977 BLAKE2B cf360071e56593251df4249d2c7ec8a1c823c71a4d96e5b7f5d02ab0dc8388eb22d34c4120924c5a5ecc9b4d610a14785e5002bc3b888aa4c66d8c73454a0900 SHA512 59ff6daf56f73578cfc7b48085747d3f2917589203196396dde6036c33da0dbce4b67b58c141545a785beb31ebeb35936d96bb6ff3b6071e95315a32e20d6093
diff --git a/sys-process/atop/atop-2.12.1.ebuild b/sys-process/atop/atop-2.12.1.ebuild
new file mode 100644
index 000000000000..a49caf19bb44
--- /dev/null
+++ b/sys-process/atop/atop-2.12.1.ebuild
@@ -0,0 +1,152 @@
+# Copyright 1999-2025 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+# Check on bumps of atop
+# https://www.atoptool.nl/downloadnetatop.php
+NETATOP_VER=3.2.2
+
+# Controls 'netatop' kernel module
+MODULES_OPTIONAL_IUSE="modules"
+NETATOP_P=netatop-${NETATOP_VER}
+NETATOP_S="${WORKDIR}"/${NETATOP_P}
+
+PYTHON_COMPAT=( python3_{13..14} )
+
+inherit linux-mod-r1 python-single-r1 systemd toolchain-funcs flag-o-matic
+
+DESCRIPTION="Resource-specific view of processes"
+HOMEPAGE="https://www.atoptool.nl/ https://github.com/Atoptool/atop"
+SRC_URI="
+ https://www.atoptool.nl/download/${P}.tar.gz
+ modules? ( https://www.atoptool.nl/download/${NETATOP_P}.tar.gz )
+"
+
+# Module is GPL-2 as well
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~alpha amd64 ~arm arm64 ~hppa ~mips ppc ~ppc64 ~riscv x86"
+IUSE="video_cards_nvidia"
+REQUIRED_USE="${PYTHON_REQUIRED_USE}"
+
+RDEPEND="
+ dev-libs/glib
+ sys-libs/ncurses:=
+ virtual/zlib:=
+ >=sys-process/acct-6.6.4-r1
+ video_cards_nvidia? (
+ ${PYTHON_DEPS}
+ $(python_gen_cond_dep '
+ dev-python/nvidia-ml-py[${PYTHON_USEDEP}]
+ ')
+ )
+"
+DEPEND="${RDEPEND}"
+BDEPEND="virtual/pkgconfig"
+
+PATCHES=(
+ "${FILESDIR}"/${PN}-2.11.0-build.patch
+ "${FILESDIR}"/${PN}-2.12.0-respect-opt.patch
+ "${FILESDIR}"/${PN}-2.12.0-atopgpud.patch
+)
+
+pkg_setup() {
+ if use modules; then
+ linux-mod-r1_pkg_setup
+ fi
+
+ if use video_cards_nvidia ; then
+ python-single-r1_pkg_setup
+ fi
+}
+
+pkg_pretend() {
+ if use kernel_linux ; then
+ CONFIG_CHECK="~BSD_PROCESS_ACCT"
+ check_extra_config
+ fi
+}
+
+src_prepare() {
+ append-cflags -std=gnu17 # bug #945250
+ default
+
+ if use modules ; then
+ cd "${WORKDIR}"/${NETATOP_P} || die
+ eapply "${FILESDIR}/netatop-3.2.2-strict-prototype.patch"
+
+ sed \
+ -e "s#\`uname -r\`#${KV_FULL}#g" \
+ -e "s#\$(shell uname -r)#${KV_FULL}#g" \
+ -i Makefile || die
+
+ grep -rq "uname -r" && die "found uname calls"
+
+ cd "${S}" || die
+ fi
+
+ tc-export CC PKG_CONFIG
+
+ # bug #191926
+ sed -i 's: root : :' atop.cronsysv || die
+
+ # Prefixify
+ sed -i "s:/\(usr\|etc\|var\):${EPREFIX}/\1:g" Makefile || die
+}
+
+src_compile() {
+ default
+
+ local modlist=( "netatop=:../${NETATOP_P}::netatop.ko" )
+ linux-mod-r1_src_compile
+
+ if use modules ; then
+ # Don't let the Makefile try to build the module for us
+ emake -C "${NETATOP_S}" netatopd
+ fi
+}
+
+src_install() {
+ linux-mod-r1_src_install
+
+ if use modules ; then
+ dosbin "${NETATOP_S}"/netatopd
+ doman "${NETATOP_S}"/man/*
+
+ systemd_dounit "${NETATOP_S}"/netatop.service
+
+ newinitd "${NETATOP_S}"/netatop.rc netatop
+ fi
+
+ emake DESTDIR="${D}" genericinstall
+
+ if use video_cards_nvidia ; then
+ systemd_dounit "${S}"/atopgpu.service
+
+ newinitd "${FILESDIR}"/atopgpud.initd atopgpud
+
+ python_fix_shebang "${ED}/usr/sbin/atopgpud"
+ else
+ rm "${ED}"/usr/sbin/atopgpud || die
+ fi
+
+ # useless -${PV} copies ?
+ rm "${ED}"/usr/bin/atop*-${PV} || die
+
+ newinitd atop.rc.openrc ${PN}
+ newinitd atopacct.rc.openrc atopacct
+
+ systemd_dounit "${S}"/${PN}.service
+ systemd_dounit "${S}"/atopacct.service
+
+ dodoc atop.cronsysv AUTHORS README
+
+ exeinto /usr/share/${PN}
+ doexe ${PN}.daily
+
+ insinto /etc/default
+ newins ${PN}{.default,}
+
+ keepdir /var/log/${PN}
+}
diff --git a/sys-process/atop/files/atop-2.11.0-build.patch b/sys-process/atop/files/atop-2.11.0-build.patch
new file mode 100644
index 000000000000..daca37401814
--- /dev/null
+++ b/sys-process/atop/files/atop-2.11.0-build.patch
@@ -0,0 +1,39 @@
+From 26a85b778ecf45989347ddee256af65f9b26747d Mon Sep 17 00:00:00 2001
+From: Sam James <sam@gentoo.org>
+Date: Sun, 11 Aug 2024 22:04:15 +0100
+Subject: [PATCH] Respect *FLAGS, use pkg-config
+
+* Respect CFLAGS
+* Use pkg-config instead of hardcoding -lncursesw (in particular, this
+ is needed if a distribution has 'split tinfo')
+
+Signed-off-by: Sam James <sam@gentoo.org>
+--- a/Makefile
++++ b/Makefile
+@@ -35,19 +35,19 @@ VERS = $(shell ./atop -V 2>/dev/null| sed -e 's/^[^ ]* //' -e 's/ .*//')
+ all: atop atopsar atopacctd atopconvert atopcat atophide
+
+ atop: atop.o $(ALLMODS) Makefile
+- $(CC) atop.o $(ALLMODS) -o atop -lncursesw -lz -lm -lrt $(LDFLAGS)
++ $(CC) $(CFLAGS) atop.o $(ALLMODS) -o atop $(shell ${PKG_CONFIG} --libs ncurses) -lz -lm -lrt $(LDFLAGS)
+
+ atopsar: atop
+ ln -sf atop atopsar
+
+ atopacctd: atopacctd.o netlink.o
+- $(CC) atopacctd.o netlink.o -o atopacctd $(LDFLAGS)
++ $(CC) $(CFLAGS) atopacctd.o netlink.o -o atopacctd $(LDFLAGS)
+
+ atopconvert: atopconvert.o
+- $(CC) atopconvert.o -o atopconvert -lz $(LDFLAGS)
++ $(CC) $(CFLAGS) atopconvert.o -o atopconvert -lz $(LDFLAGS)
+
+ atopcat: atopcat.o
+- $(CC) atopcat.o -o atopcat $(LDFLAGS)
++ $(CC) $(CFLAGS) atopcat.o -o atopcat $(LDFLAGS)
+
+ atophide: atophide.o
+ $(CC) atophide.o -o atophide -lz $(LDFLAGS)
+--
+2.45.2
+
diff --git a/sys-process/atop/files/atop-2.12.0-atopgpud.patch b/sys-process/atop/files/atop-2.12.0-atopgpud.patch
new file mode 100644
index 000000000000..b6cd86640c46
--- /dev/null
+++ b/sys-process/atop/files/atop-2.12.0-atopgpud.patch
@@ -0,0 +1,112 @@
+https://github.com/Atoptool/atop/pull/345
+
+From aae92fe43b4f3577d7bf84f347514e432071f282 Mon Sep 17 00:00:00 2001
+From: "Z. Liu" <zhixu.liu@gmail.com>
+Date: Thu, 24 Jul 2025 11:47:10 +0800
+Subject: [PATCH 1/2] atopgpud: fork before any thread action
+
+since python 3.12, os.fork now raise a DeprecationWarning, see
+https://docs.python.org/3/whatsnew/3.12.html#deprecated:
+
+> /usr/bin/atopgpud:283: DeprecationWarning: This process (pid=64696)
+> is multi-threaded, use of fork() may lead to deadlocks in the child.
+
+so let's fork as early as possible, before any thread action (gpulock &
+"import pynvml").
+
+Signed-off-by: Z. Liu <zhixu.liu@gmail.com>
+
+diff --git a/atopgpud b/atopgpud
+index 84517fe..4f8f0e5 100755
+--- a/atopgpud
++++ b/atopgpud
+@@ -66,7 +66,7 @@ cliterm = {} # dict with one entry per client (client
+ # that still have to be received by this client
+ # (pid of terminated process as key)
+
+-gpulock = threading.Lock() # mutex for access to gpulist/cliterm
++gpulock = None
+
+
+ # =================================
+@@ -275,15 +275,8 @@ def main():
+ logging.error("Socket binding to port %d fails", GPUDPORT)
+ sys.exit(1)
+
+- # -----------------------------
+- # release parent process
+- # (daemonize)
+- # -----------------------------
+- try:
+- if os.fork():
+- sys.exit(0) # parent process exits; child continues...
+- except Exception:
+- logging.error("Failed to fork child")
++ global gpulock
++ gpulock = threading.Lock() # mutex for access to gpulist/cliterm
+
+ # -----------------------------
+ # initialize GPU access for the
+@@ -589,6 +582,16 @@ lg = logging.getLogger() # root logger
+ lg.addHandler(fh)
+ lg.setLevel(loglevel)
+
++# -----------------------------
++# release parent process
++# (daemonize)
++# -----------------------------
++try:
++ if os.fork():
++ sys.exit(0) # parent process exits; child continues...
++except Exception:
++ logging.error("Failed to fork child")
++
+ # -----------------------------
+ # load module pynvml
+ # -----------------------------
+--
+2.45.2
+
+
+From 1a226186868d806809cc8486eae46f5df28290b6 Mon Sep 17 00:00:00 2001
+From: "Z. Liu" <zhixu.liu@gmail.com>
+Date: Thu, 24 Jul 2025 17:31:44 +0800
+Subject: [PATCH 2/2] atopgpud: don't daemonize if has arg "-f"
+
+so we can handle it by openrc
+
+Signed-off-by: Z. Liu <zhixu.liu@gmail.com>
+
+diff --git a/atopgpud b/atopgpud
+index 4f8f0e5..a0e9a3f 100755
+--- a/atopgpud
++++ b/atopgpud
+@@ -582,15 +582,16 @@ lg = logging.getLogger() # root logger
+ lg.addHandler(fh)
+ lg.setLevel(loglevel)
+
+-# -----------------------------
+-# release parent process
+-# (daemonize)
+-# -----------------------------
+-try:
+- if os.fork():
+- sys.exit(0) # parent process exits; child continues...
+-except Exception:
+- logging.error("Failed to fork child")
++if '-f' not in sys.argv:
++ # -----------------------------
++ # release parent process
++ # (daemonize)
++ # -----------------------------
++ try:
++ if os.fork():
++ sys.exit(0) # parent process exits; child continues...
++ except Exception:
++ logging.error("Failed to fork child")
+
+ # -----------------------------
+ # load module pynvml
+--
+2.45.2
+
diff --git a/sys-process/atop/files/atop-2.12.0-respect-opt.patch b/sys-process/atop/files/atop-2.12.0-respect-opt.patch
new file mode 100644
index 000000000000..eecf2bfa7ac3
--- /dev/null
+++ b/sys-process/atop/files/atop-2.12.0-respect-opt.patch
@@ -0,0 +1,12 @@
+Don't force -O2.
+--- a/Makefile
++++ b/Makefile
+@@ -22,7 +22,7 @@ PMPATHD = /usr/lib/systemd/system-sleep
+
+ PKG_CONFIG ?= pkg-config
+
+-override CFLAGS := -O2 -I. -Wall $(shell $(PKG_CONFIG) --cflags glib-2.0) -Wmissing-prototypes -Wmissing-declarations -Wformat-security $(CFLAGS) # -DNOPERFEVENT # -DHTTPSTATS
++override CFLAGS := -I. -Wall $(shell $(PKG_CONFIG) --cflags glib-2.0) -Wmissing-prototypes -Wmissing-declarations -Wformat-security $(CFLAGS) # -DNOPERFEVENT # -DHTTPSTATS
+
+ CC_CHECK := $(shell echo | $(CC) -dM -E - | grep -q __clang__ && echo clang || echo gcc)
+ ifeq ($(CC_CHECK),gcc)
diff --git a/sys-process/atop/files/atopgpud.initd b/sys-process/atop/files/atopgpud.initd
new file mode 100644
index 000000000000..dbcc52398a28
--- /dev/null
+++ b/sys-process/atop/files/atopgpud.initd
@@ -0,0 +1,12 @@
+#!/sbin/openrc-run
+# Copyright 1999-2025 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+supervisor=supervise-daemon
+name="atopgpud"
+command="/usr/sbin/atopgpud"
+command_args="-f"
+pidfile="/run/${RC_SVCNAME}.pid"
+
+depend() {
+ before atop atopacct
+}
diff --git a/sys-process/atop/files/netatop-3.2.2-strict-prototype.patch b/sys-process/atop/files/netatop-3.2.2-strict-prototype.patch
new file mode 100644
index 000000000000..3cb1d6fc5040
--- /dev/null
+++ b/sys-process/atop/files/netatop-3.2.2-strict-prototype.patch
@@ -0,0 +1,77 @@
+Fix for strict prototypes error: declarations are fine,
+definitions are missing void
+https://bugs.gentoo.org/949835
+--- a/netatop.c 2024-06-01 15:19:08.000000000 +0400
++++ b/netatop.c 2025-02-16 15:48:07.094848633 +0400
+@@ -1053,7 +1053,7 @@
+ ** can be found at the head
+ */
+ static void
+-gctaskexit()
++gctaskexit(void)
+ {
+ unsigned long flags;
+ struct taskinfo *tip;
+@@ -1087,7 +1087,7 @@
+ ** cleanup sockinfo structures that are connected to finished processes
+ */
+ static void
+-gcsockinfo()
++gcsockinfo(void)
+ {
+ int i;
+ struct sockinfo *sip, *sipsave;
+@@ -1300,7 +1300,7 @@
+ ** remove taskinfo structures of finished tasks from hash list
+ */
+ static void
+-gctaskinfo()
++gctaskinfo(void)
+ {
+ int i;
+ struct taskinfo *tip, *tipsave;
+@@ -1376,7 +1376,7 @@
+ ** remove all sockinfo structs
+ */
+ static void
+-wipesockinfo()
++wipesockinfo(void)
+ {
+ struct sockinfo *sip, *sipsave;
+ int i;
+@@ -1404,7 +1404,7 @@
+ ** remove all taskinfo structs from hash list
+ */
+ static void
+-wipetaskinfo()
++wipetaskinfo(void)
+ {
+ struct taskinfo *tip, *tipsave;
+ int i;
+@@ -1432,7 +1432,7 @@
+ ** remove all taskinfo structs from exit list
+ */
+ static void
+-wipetaskexit()
++wipetaskexit(void)
+ {
+ gctaskexit();
+ }
+@@ -1768,7 +1768,7 @@
+ ** called when module loaded
+ */
+ int
+-init_module()
++init_module(void)
+ {
+ int i;
+
+@@ -1869,7 +1869,7 @@
+ ** called when module unloaded
+ */
+ void
+-cleanup_module()
++cleanup_module(void)
+ {
+ /*
+ ** tell kernel daemon to stop
diff --git a/sys-process/atop/metadata.xml b/sys-process/atop/metadata.xml
new file mode 100644
index 000000000000..e51531daee5f
--- /dev/null
+++ b/sys-process/atop/metadata.xml
@@ -0,0 +1,14 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "https://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer type="project">
+ <email>base-system@gentoo.org</email>
+ <name>Gentoo Base System</name>
+ </maintainer>
+ <use>
+ <flag name="modules">Build netatop kernel module and install netatopd daemon.</flag>
+ </use>
+ <upstream>
+ <remote-id type="github">Atoptool/atop</remote-id>
+ </upstream>
+</pkgmetadata>