pkgsrc-Changes archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

CVS commit: pkgsrc/sysutils/btop



Module Name:    pkgsrc
Committed By:   wiz
Date:           Wed Oct 15 23:22:29 UTC 2025

Modified Files:
        pkgsrc/sysutils/btop: Makefile distinfo
Added Files:
        pkgsrc/sysutils/btop/patches: patch-src_btop.cpp

Log Message:
btop: help it find its themes

Based on a patch by RVP in PR 59702.

Bump PKGREVISION.


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 pkgsrc/sysutils/btop/Makefile
cvs rdiff -u -r1.5 -r1.6 pkgsrc/sysutils/btop/distinfo
cvs rdiff -u -r0 -r1.1 pkgsrc/sysutils/btop/patches/patch-src_btop.cpp

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: pkgsrc/sysutils/btop/Makefile
diff -u pkgsrc/sysutils/btop/Makefile:1.6 pkgsrc/sysutils/btop/Makefile:1.7
--- pkgsrc/sysutils/btop/Makefile:1.6   Sat Oct 11 09:29:30 2025
+++ pkgsrc/sysutils/btop/Makefile       Wed Oct 15 23:22:28 2025
@@ -1,7 +1,7 @@
-# $NetBSD: Makefile,v 1.6 2025/10/11 09:29:30 wiz Exp $
+# $NetBSD: Makefile,v 1.7 2025/10/15 23:22:28 wiz Exp $
 
 DISTNAME=      btop-1.4.5
-PKGREVISION=   1
+PKGREVISION=   2
 CATEGORIES=    sysutils
 MASTER_SITES=  ${MASTER_SITE_GITHUB:=aristocratos/}
 GITHUB_TAG=    v${PKGVERSION_NOREV}
@@ -23,6 +23,14 @@ INSTALLATION_DIRS=   ${PKGMANDIR}/man1
 CXXFLAGS+=     -DNDEBUG
 MAKE_ENV+=     STRIP=true VERBOSE=true
 
+SUBST_CLASSES+=                themes
+SUBST_SED.themes+=     -e 's,/usr/local/share/btop/themes,${PREFIX}/share/btop/themes,'
+SUBST_SED.themes+=     -e 's,/usr/.local/.share/btop/themes,${PREFIX}/share/btop/themes,'
+SUBST_FILES.themes+=   src/btop_menu.cpp
+SUBST_FILES.themes+=   src/btop.cpp
+SUBST_STAGE.themes=    pre-configure
+SUBST_MESSAGE.themes=  Fixing hardcoded paths to themes.
+
 .include "../../graphics/hicolor-icon-theme/buildlink3.mk"
 .include "../../mk/atomic64.mk"
 .include "../../mk/pthread.buildlink3.mk"

Index: pkgsrc/sysutils/btop/distinfo
diff -u pkgsrc/sysutils/btop/distinfo:1.5 pkgsrc/sysutils/btop/distinfo:1.6
--- pkgsrc/sysutils/btop/distinfo:1.5   Sat Oct 11 09:29:30 2025
+++ pkgsrc/sysutils/btop/distinfo       Wed Oct 15 23:22:28 2025
@@ -1,7 +1,8 @@
-$NetBSD: distinfo,v 1.5 2025/10/11 09:29:30 wiz Exp $
+$NetBSD: distinfo,v 1.6 2025/10/15 23:22:28 wiz Exp $
 
 BLAKE2s (btop-1.4.5.tar.gz) = fc3729f7eb9c9b339c6521f938e2196afff3239d529d2dbf6b6e093cc0fa47cd
 SHA512 (btop-1.4.5.tar.gz) = 36e278c832d984e5d882dcf861855945edc31dd00cbe0a6c16b09de42b2416d865585985e999302a470068037fdecca754c8ee9e25940c9ae1df5196893f93a8
 Size (btop-1.4.5.tar.gz) = 1250099 bytes
 SHA1 (patch-Makefile) = 87cd9333e786899109df3a931c6d0e99fbd017de
+SHA1 (patch-src_btop.cpp) = a85b0fea001b233914ca757ba736ad4a50381ba6
 SHA1 (patch-src_netbsd_btop__collect.cpp) = f8eb343ae32c4b6e5c9d3ea712471c74d1edfb68

Added files:

Index: pkgsrc/sysutils/btop/patches/patch-src_btop.cpp
diff -u /dev/null pkgsrc/sysutils/btop/patches/patch-src_btop.cpp:1.1
--- /dev/null   Wed Oct 15 23:22:29 2025
+++ pkgsrc/sysutils/btop/patches/patch-src_btop.cpp     Wed Oct 15 23:22:28 2025
@@ -0,0 +1,39 @@
+$NetBSD: patch-src_btop.cpp,v 1.1 2025/10/15 23:22:28 wiz Exp $
+
+Help btop find its themes.
+
+--- src/btop.cpp.orig  2025-09-19 20:29:22.000000000 +0000
++++ src/btop.cpp
+@@ -46,6 +46,12 @@ tab-size = 4
+       #include <limits.h>
+ #endif
+ 
++#ifdef __NetBSD__
++      #include <sys/param.h>
++      #include <sys/sysctl.h>
++      #include <unistd.h>
++#endif
++
+ #include "btop_cli.hpp"
+ #include "btop_shared.hpp"
+ #include "btop_tools.hpp"
+@@ -877,6 +883,19 @@ int main(const int argc, const char** ar
+               if(!_NSGetExecutablePath(buf, &bufsize))
+                       Global::self_path = fs::path(buf).remove_filename();
+       }
++#elif __NetBSD__
++      {
++              int mib[4];
++              char buf[PATH_MAX];
++              size_t bufsize = sizeof buf;
++
++              mib[0] = CTL_KERN;
++              mib[1] = KERN_PROC_ARGS;
++              mib[2] = getpid();
++              mib[3] = KERN_PROC_PATHNAME;
++              if (sysctl(mib, 4, buf, &bufsize, NULL, 0) == 0)
++                      Global::self_path = fs::path(buf).remove_filename();
++      }
+ #endif
+       if (std::error_code ec; not Global::self_path.empty()) {
+               Theme::theme_dir = fs::canonical(Global::self_path / "../share/btop/themes", ec);



Home | Main Index | Thread Index | Old Index