Skip to content

Conversation

@laffer1
Copy link
Contributor

@laffer1 laffer1 commented Nov 4, 2024

This build works on MidnightBSD 3.2.1+ (stable/3.2 branch or current)

@CarterLi
Copy link
Member

CarterLi commented Nov 5, 2024

Does GCC on MidnightBSD define __FreeBSD__? Does this patch work (as what I did for DragonFly)?

diff --git a/CMakeLists.txt b/CMakeLists.txt
index cc33bf5b..e3481ec0 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -25,6 +25,9 @@ elseif("${CMAKE_SYSTEM_NAME}" STREQUAL "NetBSD")
 elseif("${CMAKE_SYSTEM_NAME}" STREQUAL "DragonFly")
     set(FreeBSD TRUE CACHE BOOL "..." FORCE)
     set(DragonFly TRUE CACHE BOOL "..." FORCE)
+elseif("${CMAKE_SYSTEM_NAME}" STREQUAL "MidnightBSD")
+    set(FreeBSD TRUE CACHE BOOL "..." FORCE)
+    set(MidnightBSD TRUE CACHE BOOL "..." FORCE)
 elseif("${CMAKE_SYSTEM_NAME}" STREQUAL "SunOS")
     set(SunOS TRUE CACHE BOOL "..." FORCE)
 elseif(NOT APPLE AND NOT WIN32)

@CarterLi
Copy link
Member

CarterLi commented Nov 5, 2024

Does GCC define __MidnightBSD__ or something similar?

endif()
if(FreeBSD AND EXISTS "/usr/local/bin/objdump")
if((FreeBSD OR MidnightBSD) AND EXISTS "/usr/local/bin/objdump")
execute_process(COMMAND /bin/sh -c "/usr/local/bin/objdump -T /lib/libc.so.* | grep 'FBSD_[0-9][0-9]*\\.[0-9][0-9]*' -o | sort -Vru | head -1"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does MidnightBSD use FreeBSD libc?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

MidnightBSD uses FreeBSD libc with some additions. So there are FBSD symbol versions and also MBSD versions.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess using MBSD versions is better.

@laffer1
Copy link
Contributor Author

laffer1 commented Nov 5, 2024

MidnightBSD defines both __MidnightBSD__ and __FreeBSD__ in current versions.

Add libzfs check as MidnightBSD does have zfs.
@CarterLi
Copy link
Member

CarterLi commented Nov 5, 2024

If you use set(FreeBSD TRUE CACHE BOOL "..." FORCE), all those OR MidnightBSD check can be omitted.

@CarterLi
Copy link
Member

CarterLi commented Nov 5, 2024

diff --git a/src/detection/version/version.c b/src/detection/version/version.c
index 8b230eec..1f1deb34 100644
--- a/src/detection/version/version.c
+++ b/src/detection/version/version.c
@@ -28,6 +28,8 @@
     #define FF_SYSNAME "Linux"
 #elif defined(__DragonFly__) // We define `__FreeBSD__` on DragonFly BSD for simplification
     #define FF_SYSNAME "DragonFly"
+#elif defined(__MidnightBSD__)
+    #define FF_SYSNAME "MidnightBSD"
 #elif defined(__FreeBSD__)
     #define FF_SYSNAME "FreeBSD"
 #elif defined(__APPLE__)

@CarterLi CarterLi merged commit f69a9da into fastfetch-cli:dev Nov 5, 2024
16 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants