addpkg(main/libgtop): For showing system info in xfce about dialog

This commit is contained in:
termux-pacman-bot
2024-06-22 16:38:53 +00:00
parent e4bd9b4aa6
commit e2364e180d
6 changed files with 102 additions and 0 deletions

33
packages/libgtop/build.sh Normal file
View File

@@ -0,0 +1,33 @@
TERMUX_PKG_HOMEPAGE=https://gitlab.gnome.org/GNOME/libgtop
TERMUX_PKG_DESCRIPTION="Library for collecting system monitoring data"
TERMUX_PKG_LICENSE="GPL-2.0"
TERMUX_PKG_MAINTAINER="@termux"
TERMUX_PKG_VERSION="2.41.3"
TERMUX_PKG_SRCURL=https://gitlab.gnome.org/GNOME/libgtop/-/archive/${TERMUX_PKG_VERSION}/libgtop-${TERMUX_PKG_VERSION}.tar.gz
TERMUX_PKG_SHA256=2136f5586377706c267b61c04c3f59ada69d59d83fc8967f137813a8503d0fa7
TERMUX_PKG_AUTO_UPDATE=true
TERMUX_PKG_DEPENDS="glib, libandroid-shmem, libxau"
TERMUX_PKG_BUILD_DEPENDS="g-ir-scanner, glib-cross"
TERMUX_PKG_DISABLE_GIR=false
TERMUX_PKG_EXTRA_CONFIGURE_ARGS="
--enable-gtk-doc-html=no
--enable-introspection=yes
--without-examples
"
termux_step_post_get_source() {
sed -i "s|/proc/stat|${TERMUX_PREFIX}/var/libgtop/stat|g" $(grep -rl "/proc/stat")
rm sysdeps/linux/sem_limits.c
cp sysdeps/{stub,linux}/sem_limits.c
}
termux_step_pre_configure() {
TERMUX_PKG_VERSION=. termux_setup_gir
NOCONFIGURE=1 ./autogen.sh
LDFLAGS+=" -landroid-shmem"
}
termux_step_post_make_install() {
mkdir -p $TERMUX_PREFIX/var/libgtop
cp -a $TERMUX_PKG_BUILDER_DIR/procstat $TERMUX_PREFIX/var/libgtop/stat
}

View File

@@ -0,0 +1,10 @@
<?xml version="1.0"?>
<dump>
<boxed name="glibtop" get-type="glibtop_get_type"/>
<boxed name="glibtop_map_entry" get-type="glibtop_map_entry_get_type"/>
<boxed name="glibtop_proc_map" get-type="glibtop_proc_map_get_type"/>
<boxed name="glibtop_open_files_entry" get-type="glibtop_open_files_entry_get_type"/>
<boxed name="glibtop_proc_open_files" get-type="glibtop_proc_open_files_get_type"/>
<boxed name="glibtop_mountlist" get-type="glibtop_mountlist_get_type"/>
<boxed name="glibtop_mountentry" get-type="glibtop_mountentry_get_type"/>
</dump>

View File

@@ -0,0 +1,14 @@
--- a/libgtop-sysdeps.m4
+++ b/libgtop-sysdeps.m4
@@ -33,10 +33,9 @@
linux*)
libgtop_sysdeps_dir=linux
libgtop_have_sysinfo=yes
- libgtop_need_server=yes
+ libgtop_need_server=no
libgtop_sysdeps_private_mountlist=yes
libgtop_sysdeps_private_fsusage=yes
- libgtop_postinstall='chown root $(DESTDIR)$(libexecdir)/libgtop_server2 && chmod 4755 $(DESTDIR)$(libexecdir)/libgtop_server2'
;;
netbsd*|bsdi*)
libgtop_sysdeps_dir=bsd

View File

@@ -0,0 +1,9 @@
cpu 1035 500 702 8510 1547 0 272 0 0 0
cpu0 636 290 372 3891 931 0 200 0 0 0
intr 35286 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 6 0 1779 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
ctxt 256127
btime 1649820629
processes 3837
procs_running 1
procs_blocked 0
softirq 93709 0 7679 0 7721 25554 0 25669 7394 0 19692

View File

@@ -0,0 +1,16 @@
--- a/sysdeps/linux/msg_limits.c
+++ b/sysdeps/linux/msg_limits.c
@@ -48,6 +48,7 @@
memset (buf, 0, sizeof (glibtop_msg_limits));
+#ifndef __ANDROID__
msgctl (0, IPC_INFO, (void*) &msginfo);
buf->msgpool = msginfo.msgpool;
@@ -58,4 +59,5 @@
buf->msgssz = msginfo.msgssz;
buf->msgtql = msginfo.msgtql;
buf->flags = _glibtop_sysdeps_msg_limits;
+#endif
}

View File

@@ -0,0 +1,20 @@
--- a/sysdeps/linux/netload.c
+++ b/sysdeps/linux/netload.c
@@ -158,7 +158,7 @@
else if (IN6_IS_ADDR_SITELOCAL (buf->address6))
buf->scope6 = GLIBTOP_IF_IN6_SCOPE_SITE;
-
+#ifndef __ANDROID__
else if (IN6_IS_ADDR_GLOBAL (buf->address6)
|| IN6_IS_ADDR_MC_ORGLOCAL (buf->address6)
|| IN6_IS_ADDR_V4COMPAT (buf->address6)
@@ -169,7 +169,7 @@
else if (IN6_IS_ADDR_LOOPBACK (buf->address6))
buf->scope6 = GLIBTOP_IF_IN6_SCOPE_HOST;
-
+#endif
else
buf->scope6 = GLIBTOP_IF_IN6_SCOPE_UNKNOWN;