Hi ports@
update for sysutils/btop to the latest version 1.4.7
Changelog: https://github.com/aristocratos/btop/releases/tag/v1.4.7
This version contains fix for OpenBSD
(https://github.com/aristocratos/btop/pull/1619) => remove patch added for
port's version 1.4.6p0
Build and tests OK on current/amd64.
Tests welcome and please commit if OK.
Laurent
Index: Makefile
===================================================================
RCS file: /cvs/ports/sysutils/btop/Makefile,v
diff -u -p -r1.9 Makefile
--- Makefile 19 Apr 2026 20:37:52 -0000 1.9
+++ Makefile 1 May 2026 17:14:29 -0000
@@ -2,9 +2,7 @@ COMMENT= resource monitor
GH_ACCOUNT= aristocratos
GH_PROJECT= btop
-GH_TAGNAME= v1.4.6
-
-REVISION= 0
+GH_TAGNAME= v1.4.7
CATEGORIES= sysutils
Index: distinfo
===================================================================
RCS file: /cvs/ports/sysutils/btop/distinfo,v
diff -u -p -r1.8 distinfo
--- distinfo 28 Dec 2025 05:40:27 -0000 1.8
+++ distinfo 1 May 2026 17:14:29 -0000
@@ -1,2 +1,2 @@
-SHA256 (btop-1.4.6.tar.gz) = S+uQFyxqyqwIwbSlES+2FncuIUp++ZK8vUYUUylaWL4=
-SIZE (btop-1.4.6.tar.gz) = 1261873
+SHA256 (btop-1.4.7.tar.gz) = kz3i5NGyIRpji+Rj626GFokb+6c67104BgvYMZuu78Y=
+SIZE (btop-1.4.7.tar.gz) = 1280005
Index: patches/patch-Makefile
===================================================================
RCS file: /cvs/ports/sysutils/btop/patches/patch-Makefile,v
diff -u -p -r1.5 patch-Makefile
--- patches/patch-Makefile 28 Dec 2025 05:40:27 -0000 1.5
+++ patches/patch-Makefile 1 May 2026 17:14:29 -0000
@@ -1,16 +1,16 @@
Index: Makefile
--- Makefile.orig
+++ Makefile
-@@ -63,7 +63,7 @@ ifeq ($(DEBUG),true)
+@@ -66,7 +66,7 @@ ifeq ($(DEBUG),true)
endif
-
+
#? Any flags added to TESTFLAGS must not contain whitespace for the testing to work
-override TESTFLAGS := -fexceptions -fstack-clash-protection -fcf-protection
+override TESTFLAGS := -fexceptions -fcf-protection
ifneq ($(PLATFORM) $(ARCH),macos arm64)
override TESTFLAGS += -fstack-protector
endif
-@@ -120,7 +120,7 @@ else ifeq ($(PLATFORM_LC),macos)
+@@ -123,7 +123,7 @@ else ifeq ($(PLATFORM_LC),macos)
else ifeq ($(PLATFORM_LC),openbsd)
PLATFORM_DIR := openbsd
THREADS := $(shell sysctl -n hw.ncpu || echo 1)
@@ -19,25 +19,25 @@ Index: Makefile
export MAKE = gmake
SU_GROUP := wheel
else ifeq ($(PLATFORM_LC),netbsd)
-@@ -135,9 +135,6 @@ endif
-
+@@ -138,9 +138,6 @@ endif
+
#? Use all CPU cores (will only be set if using Make 4.3+)
MAKEFLAGS := --jobs=$(THREADS)
-ifeq ($(THREADS),1)
- override THREADS := auto
-endif
-
+
#? LTO command line
ifeq ($(BUILD_TYPE),Release)
-@@ -245,7 +242,6 @@ info:
+@@ -248,7 +245,6 @@ info:
endif
-
+
info-quiet: | info rocm_smi
- @printf "\n\033[1;92mBuilding btop++ \033[91m(\033[97mv$(BTOP_VERSION)\033[91m) \033[93m$(PLATFORM) \033[96m$(ARCH)\033[0m\n"
-
+
help:
@printf " $(BANNER)\n"
-@@ -278,7 +274,6 @@ $(BUILDDIR)/config.h: $(SRCDIR)/config.h.in | director
+@@ -281,7 +277,6 @@ $(BUILDDIR)/config.h: $(SRCDIR)/config.h.in | director
#? Man page
btop.1: manpage.md | directories
ifeq ($(shell command -v lowdown >/dev/null; echo $$?),0)
@@ -45,9 +45,9 @@ Index: Makefile
lowdown -s -Tman -o $@ $<
else
@printf "\n\033[1;93mCommand 'lowdown' not found: skipping generating man page $@\033[0m\n"
-@@ -297,29 +292,22 @@ distclean: clean
+@@ -300,29 +295,22 @@ distclean: clean
@test -e lib/rocm_smi_lib/build && rm -rf lib/rocm_smi_lib/build || true
-
+
install:
- @printf "\033[1;92mInstalling binary to: \033[1;97m$(DESTDIR)$(PREFIX)/bin/btop\033[0m\n"
@mkdir -p $(DESTDIR)$(PREFIX)/bin
@@ -75,9 +75,9 @@ Index: Makefile
+ @mkdir -p $(DESTDIR)$(PREFIX)/man/man1
+ @cp -p btop.1 $(DESTDIR)$(PREFIX)/man/man1/btop.1
endif
-
+
#? Set SUID bit for btop as $SU_USER in $SU_GROUP
-@@ -383,33 +371,23 @@ endif
+@@ -386,33 +374,23 @@ endif
#? Link
.ONESHELL:
btop: $(OBJECTS) | rocm_smi directories
@@ -88,7 +88,7 @@ Index: Makefile
@$(CXX) -o $(TARGETDIR)/btop $^ $(LDFLAGS) || exit 1
- @printf "\033[1;92m100$(P) -> \033[1;37m$(TARGETDIR)/btop \033[100D\033[38C\033[1;93m(\033[1;97m$$(du -ah $(TARGETDIR)/btop | cut -f1)iB\033[1;93m) \033[92m(\033[97m$$($(DATE_CMD) -d @$$(expr $$(date +%s 2>/dev/null || echo "0") - $${TSTAMP} 2>/dev/null) -u +%Mm:%Ss 2>/dev/null | sed 's/^00m://' || echo '')\033[92m)\033[0m\n"
- @printf "\n\033[1;92mBuild complete in \033[92m(\033[97m$$($(DATE_CMD) -d @$$(expr $$(date +%s 2>/dev/null || echo "0") - $(TIMESTAMP) 2>/dev/null) -u +%Mm:%Ss 2>/dev/null | sed 's/^00m://' || echo "unknown")\033[92m)\033[0m\n"
-
+
#? Compile
.ONESHELL:
$(BUILDDIR)/%.$(OBJEXT): $(SRCDIR)/%.$(SRCEXT) | rocm_smi directories config.h
@@ -98,7 +98,7 @@ Index: Makefile
@$(VERBOSE) || printf "$(CXX) $(CXXFLAGS) $(INC) -MMD -c -o $@ $<\n"
@$(CXX) $(CXXFLAGS) $(INC) -MMD -c -o $@ $< || exit 1
- @printf "\033[1;92m$$($(PROGRESS))$(P)\033[10D\033[5C-> \033[1;37m$@ \033[100D\033[38C\033[1;93m(\033[1;97m$$(du -ah $@ | cut -f1)iB\033[1;93m) \033[92m(\033[97m$$($(DATE_CMD) -d @$$(expr $$($(DATE_CMD) +%s 2>/dev/null || echo "0") - $${TSTAMP} 2>/dev/null) -u +%Mm:%Ss 2>/dev/null | sed 's/^00m://' || echo '')\033[92m)\033[0m\n"
-
+
#? Compile intel_gpu_top C sources for Intel GPU support
.ONESHELL:
$(BUILDDIR)/%.c.o: $(SRCDIR)/$(PLATFORM_DIR)/intel_gpu_top/%.c | directories
@@ -108,6 +108,6 @@ Index: Makefile
@$(VERBOSE) || printf "$(CC) $(INC) -c -o $@ $<\n"
@$(CC) $(INC) -w -c -o $@ $< || exit 1
- @printf "\033[1;92m$$($(PROGRESS))$(P)\033[10D\033[5C-> \033[1;37m$@ \033[100D\033[38C\033[1;93m(\033[1;97m$$(du -ah $@ | cut -f1)iB\033[1;93m) \033[92m(\033[97m$$($(DATE_CMD) -d @$$(expr $$($(DATE_CMD) +%s 2>/dev/null || echo "0") - $${TSTAMP} 2>/dev/null) -u +%Mm:%Ss 2>/dev/null | sed 's/^00m://' || echo '')\033[92m)\033[0m\n"
-
-
+
+
#? Non-File Targets
Index: patches/patch-src_openbsd_btop_collect.cpp
===================================================================
RCS file: patches/patch-src_openbsd_btop_collect.cpp
diff -N patches/patch-src_openbsd_btop_collect.cpp
--- patches/patch-src_openbsd_btop_collect.cpp 19 Apr 2026 20:37:52 -0000 1.1
+++ /dev/null 1 Jan 1970 00:00:00 -0000
@@ -1,86 +0,0 @@
-Fix OpenBSD display of online CPUs
-from https://github.com/aristocratos/btop/pull/1587
-
---- src/openbsd/btop_collect.cpp.orig Sun Apr 19 15:11:15 2026
-+++ src/openbsd/btop_collect.cpp Sun Apr 19 15:11:29 2026
-@@ -124,7 +124,7 @@
- //? Shared global variables init
- int mib[2];
- mib[0] = CTL_HW;
-- mib[1] = HW_NCPU;
-+ mib[1] = HW_NCPUONLINE;
- int ncpu;
- size_t len = sizeof(ncpu);
- if (sysctl(mib, 2, &ncpu, &len, nullptr, 0) == -1) {
-@@ -389,13 +389,22 @@
- Logger::error("failed to get load averages");
- }
-
-+ //? Read total physical CPU count for sysctl iteration
-+ //? (may differ from coreCount when SMT is disabled via hw.smt=0).
-+ int ncpu_total = Shared::coreCount;
-+ {
-+ int mib[] = {CTL_HW, HW_NCPU};
-+ size_t len = sizeof(ncpu_total);
-+ sysctl(mib, 2, &ncpu_total, &len, nullptr, 0);
-+ }
-+
- auto cp_time = std::unique_ptr<struct cpustats[]>{
-- new struct cpustats[Shared::coreCount]
-+ new struct cpustats[ncpu_total]
- };
-- size_t size = Shared::coreCount * sizeof(struct cpustats);
-+ size_t size = sizeof(struct cpustats);
- static int cpustats_mib[] = {CTL_KERN, KERN_CPUSTATS, /*fillme*/0};
-- for (int i = 0; i < Shared::coreCount; i++) {
-- cpustats_mib[2] = i / 2;
-+ for (int i = 0; i < ncpu_total; i++) {
-+ cpustats_mib[2] = i;
- if (sysctl(cpustats_mib, 3, &cp_time[i], &size, NULL, 0) == -1) {
- Logger::error("sysctl kern.cpustats failed");
- }
-@@ -404,11 +413,16 @@
- long long global_idles = 0;
- vector<long long> times_summed = {0, 0, 0, 0};
-
-- for (long i = 0; i < Shared::coreCount; i++) {
-+ //? j iterates all physical CPUs; offline ones are skipped
-+ //? i is the display slot index, incremented only for online CPUs
-+ for (long i = 0, j = 0; j < ncpu_total; j++) {
-+ if (!(cp_time[j].cs_flags & CPUSTATS_ONLINE))
-+ continue;
-+
- vector<long long> times;
- //? 0=user, 1=nice, 2=system, 3=idle
- for (int x = 0; const unsigned int c_state : {CP_USER, CP_NICE, CP_SYS, CP_IDLE}) {
-- auto val = cp_time[i].cs_time[c_state];
-+ auto val = cp_time[j].cs_time[c_state];
- times.push_back(val);
- times_summed.at(x++) += val;
- }
-@@ -423,7 +437,6 @@
- global_idles += idles;
-
- //? Calculate cpu total for each core
-- if (i > Shared::coreCount) break;
- const long long calc_totals = max(0ll, totals - core_old_totals.at(i));
- const long long calc_idles = max(0ll, idles - core_old_idles.at(i));
- core_old_totals.at(i) = totals;
-@@ -438,7 +451,7 @@
- Logger::error("Cpu::collect() : " + (string)e.what());
- throw std::runtime_error("collect() : " + (string)e.what());
- }
--
-+ i++;
- }
-
- const long long calc_totals = max(1ll, global_totals - cpu_old.at("totals"));
-@@ -1218,7 +1231,7 @@
- }
- toggle_children = -1;
- }
--
-+
- if (auto find_pid = (collapse != -1 ? collapse : expand); find_pid != -1) {
- auto collapser = rng::find(current_procs, find_pid, &proc_info::pid);
- if (collapser != current_procs.end()) {
Index: pkg/PLIST
===================================================================
RCS file: /cvs/ports/sysutils/btop/pkg/PLIST,v
diff -u -p -r1.4 PLIST
--- pkg/PLIST 28 Dec 2025 05:40:27 -0000 1.4
+++ pkg/PLIST 1 May 2026 17:14:29 -0000
@@ -16,6 +16,8 @@ share/btop/themes/everforest-dark-medium
share/btop/themes/everforest-light-medium.theme
share/btop/themes/flat-remix-light.theme
share/btop/themes/flat-remix.theme
+share/btop/themes/flexoki-dark.theme
+share/btop/themes/flexoki-light.theme
share/btop/themes/gotham.theme
share/btop/themes/greyscale.theme
share/btop/themes/gruvbox_dark.theme
@@ -23,6 +25,7 @@ share/btop/themes/gruvbox_dark_v2.theme
share/btop/themes/gruvbox_light.theme
share/btop/themes/gruvbox_material_dark.theme
share/btop/themes/horizon.theme
+share/btop/themes/kanagawa-dragon.theme
share/btop/themes/kanagawa-lotus.theme
share/btop/themes/kanagawa-wave.theme
share/btop/themes/kyli0x.theme
@@ -31,6 +34,7 @@ share/btop/themes/monokai.theme
share/btop/themes/night-owl.theme
share/btop/themes/nord.theme
share/btop/themes/onedark.theme
+share/btop/themes/orange.theme
share/btop/themes/paper.theme
share/btop/themes/phoenix-night.theme
share/btop/themes/solarized_dark.theme
@@ -38,6 +42,7 @@ share/btop/themes/solarized_light.theme
share/btop/themes/tokyo-night.theme
share/btop/themes/tokyo-storm.theme
share/btop/themes/tomorrow-night.theme
+share/btop/themes/twilight.theme
share/btop/themes/whiteout.theme
share/doc/btop/
share/doc/btop/README.md