DeltaPorts icon indicating copy to clipboard operation
DeltaPorts copied to clipboard

Request for btop port from FreeBSD (similar to bashtop)

Open MikeKlem opened this issue 1 year ago • 1 comments

[email protected] is the bashtop port maintainer The repo is available at https://github.com/aristocratos/btop

The hope is that it's just a Makefile change, and copying over the FreeBSD port src

MikeKlem avatar Feb 27 '24 20:02 MikeKlem

Hello @MikeKlem

sorry for the delay, did try to build the FreeBSD port with some minors modifications in Makefile

--- Makefile.ori	2024-08-06 17:11:54.264234000 +0200
+++ Makefile	2024-08-06 17:13:08.095553000 +0200
@@ -94,6 +94,12 @@ ifeq ($(PLATFORM_LC),linux)
 	PLATFORM_DIR := linux
 	THREADS	:= $(shell getconf _NPROCESSORS_ONLN 2>/dev/null || echo 1)
 	SU_GROUP := root
+else ifeq ($(PLATFORM_LC),dragonfly)
+	PLATFORM_DIR := freebsd
+	THREADS	:= $(shell getconf NPROCESSORS_ONLN 2>/dev/null || echo 1)
+	SU_GROUP := wheel
+	override ADDFLAGS += -lstdc++ -lm -lkvm -ldevstat -Wl,-rpath=/usr/local/lib/gcc11
+	export MAKE = gmake
 else ifeq ($(PLATFORM_LC),freebsd)
 	PLATFORM_DIR := freebsd
 	THREADS	:= $(shell getconf NPROCESSORS_ONLN 2>/dev/null || echo 1)

and in src/btop.cpp

--- src/btop.cpp.ori	2024-08-06 17:13:24.435836000 +0200
+++ src/btop.cpp	2024-08-06 19:30:57.245485000 +0200
@@ -19,7 +19,7 @@ tab-size = 4
 #include <csignal>
 #include <clocale>
 #include <pthread.h>
-#ifdef __FreeBSD__
+#if defined(__FreeBSD__) || defined(__DragonFly__)
 	#include <pthread_np.h>
 #endif
 #include <thread>

I also had to use USE_GCC_VERSION= 11 but the build process stops at :

src/freebsd/btop_collect.cpp:22:10: fatal error: libproc.h: No such file or directory
   22 | #include <libproc.h>
      |          ^~~~~~~~~~~
compilation terminated.
gmake[2]: *** [Makefile:280: obj/freebsd/btop_collect.o] Error 1

So this port will probably require a little bit of patching.

daftaupe avatar Aug 06 '24 17:08 daftaupe