[ports] build fixes for *BSD make

Signed-off-by: lizzie <lizzie@eden-emu.dev>
This commit is contained in:
lizzie 2026-02-08 00:45:06 +00:00
parent 71e035f83b
commit cf0cc6117e
4 changed files with 21 additions and 4 deletions

View File

@ -91,7 +91,7 @@ After configuration, you may need to modify `externals/ffmpeg/CMakeFiles/ffmpeg-
`-lc++-experimental` doesn't exist in OpenBSD but the LLVM driver still tries to link against it, to solve just symlink `ln -s /usr/lib/libc++.a /usr/lib/libc++experimental.a`. Builds are currently not working due to lack of `std::jthread` and such, either compile libc++ manually or wait for ports to catch up. `-lc++-experimental` doesn't exist in OpenBSD but the LLVM driver still tries to link against it, to solve just symlink `ln -s /usr/lib/libc++.a /usr/lib/libc++experimental.a`. Builds are currently not working due to lack of `std::jthread` and such, either compile libc++ manually or wait for ports to catch up.
If clang has errors, try using `g++-11`. If clang has errors, try using `g++11`.
## FreeBSD ## FreeBSD
@ -107,6 +107,8 @@ hw.usb.usbhid.enable="0"
## NetBSD ## NetBSD
2026-02-07: `vulkan-headers` must not be installed, since the version found in `pkgsrc` is older than required. Either wait for binary packages to update or build newer versions from source.
Install `pkgin` if not already `pkg_add pkgin`, see also the general [pkgsrc guide](https://www.netbsd.org/docs/pkgsrc/using.html). For NetBSD 10.1 provide `echo 'PKG_PATH="https://cdn.netbsd.org/pub/pkgsrc/packages/NetBSD/amd64/10.1/All/"' >/etc/pkg_install.conf`. If `pkgin` is taking too much time consider adding the following to `/etc/rc.conf`: Install `pkgin` if not already `pkg_add pkgin`, see also the general [pkgsrc guide](https://www.netbsd.org/docs/pkgsrc/using.html). For NetBSD 10.1 provide `echo 'PKG_PATH="https://cdn.netbsd.org/pub/pkgsrc/packages/NetBSD/amd64/10.1/All/"' >/etc/pkg_install.conf`. If `pkgin` is taking too much time consider adding the following to `/etc/rc.conf`:
```sh ```sh
@ -116,7 +118,7 @@ ip6addrctl_policy=ipv4_prefer
System provides a default `g++-10` which doesn't support the current C++ codebase; install `clang-19` with `pkgin install clang-19`. Or install `gcc14` (or `gcc15` with current pkgsrc). Provided that, the following CMake commands may work: System provides a default `g++-10` which doesn't support the current C++ codebase; install `clang-19` with `pkgin install clang-19`. Or install `gcc14` (or `gcc15` with current pkgsrc). Provided that, the following CMake commands may work:
- `cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++ -Bbuild` - `cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++ -Bbuild` (Recommended)
- `cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_C_COMPILER=/usr/pkg/gcc14/bin/gcc -DCMAKE_CXX_COMPILER=/usr/pkg/gcc14/bin/g++ -Bbuild` - `cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_C_COMPILER=/usr/pkg/gcc14/bin/gcc -DCMAKE_CXX_COMPILER=/usr/pkg/gcc14/bin/g++ -Bbuild`
- `cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_C_COMPILER=/usr/pkg/gcc15/bin/gcc -DCMAKE_CXX_COMPILER=/usr/pkg/gcc15/bin/g++ -Bbuild` - `cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_C_COMPILER=/usr/pkg/gcc15/bin/gcc -DCMAKE_CXX_COMPILER=/usr/pkg/gcc15/bin/g++ -Bbuild`
@ -138,8 +140,12 @@ cmake --install build
However, pkgsrc is highly recommended, see [getting pkgsrc](https://iso.us.netbsd.org/pub/pkgsrc/current/pkgsrc/doc/pkgsrc.html#getting). You must get `current` not the `2025Q2` version. However, pkgsrc is highly recommended, see [getting pkgsrc](https://iso.us.netbsd.org/pub/pkgsrc/current/pkgsrc/doc/pkgsrc.html#getting). You must get `current` not the `2025Q2` version.
`QtCore` on NetBSD is included, but due to misconfigurations(!) we MUST include one of the standard headers that include `bits/c++config.h`, since source_location (required by `QtCore`) isn't properly configured to intake `bits/c++config.h` (none of the experimental library is). This is a bug with NetBSD packaging and not our fault, but alas.
## DragonFlyBSD ## DragonFlyBSD
2026-02-07: `vulkan-headers` and `vulkan-utility-libraries` must NOT be uninstalled, since they're too old: `1.3.289`. Either wait for binary packages to update or build newer versions from source.
If `libstdc++.so.6` is not found (`GLIBCXX_3.4.30`) then attempt: If `libstdc++.so.6` is not found (`GLIBCXX_3.4.30`) then attempt:
```sh ```sh

View File

@ -19,10 +19,12 @@
#include <windows.h> #include <windows.h>
#include "common/string_util.h" #include "common/string_util.h"
#else #else
#if defined(__Bitrig__) || defined(__DragonFly__) || defined(__FreeBSD__) || defined(__OpenBSD__) #if defined(__FreeBSD__)
#include <sys/cpuset.h> #include <sys/cpuset.h>
#include <sys/_cpuset.h> #include <sys/_cpuset.h>
#include <pthread_np.h> #include <pthread_np.h>
#elif defined(__DragonFly__) || defined(__OpenBSD__) || defined(__Bitrig__)
#include <pthread_np.h>
#endif #endif
#include <pthread.h> #include <pthread.h>
#include <sched.h> #include <sched.h>

View File

@ -87,7 +87,10 @@ if (NOT APPLE AND ENABLE_OPENGL)
endif() endif()
if (UNIX AND NOT APPLE) if (UNIX AND NOT APPLE)
if (DEFINED Qt6Gui_PRIVATE_INCLUDE_DIRS) if (PLATFORM_NETBSD)
# QtGui6 has improper pkg-config configuration under NetBSD
target_include_directories(qt_common PRIVATE "${CMAKE_SYSROOT}/usr/pkg/qt6/include/QtGui/6.10.1/QtGui")
elseif (DEFINED Qt6Gui_PRIVATE_INCLUDE_DIRS)
target_include_directories(qt_common PRIVATE ${Qt6Gui_PRIVATE_INCLUDE_DIRS}) target_include_directories(qt_common PRIVATE ${Qt6Gui_PRIVATE_INCLUDE_DIRS})
else() else()
target_link_libraries(qt_common PRIVATE Qt6::GuiPrivate) target_link_libraries(qt_common PRIVATE Qt6::GuiPrivate)

View File

@ -118,6 +118,8 @@ if (NOT GLSLANG_ERROR STREQUAL "")
set(QUIET_FLAG "") set(QUIET_FLAG "")
endif() endif()
# Shader files must depend on their directory otherwise *BSD make will spontaneously combust
file(MAKE_DIRECTORY "${SHADER_DIR}")
foreach(SOURCE_FILE IN ITEMS ${SHADER_FILES}) foreach(SOURCE_FILE IN ITEMS ${SHADER_FILES})
get_filename_component(FILENAME ${SOURCE_FILE} NAME) get_filename_component(FILENAME ${SOURCE_FILE} NAME)
string(REPLACE "." "_" SHADER_NAME ${FILENAME}) string(REPLACE "." "_" SHADER_NAME ${FILENAME})
@ -133,6 +135,7 @@ foreach(SOURCE_FILE IN ITEMS ${SHADER_FILES})
${SOURCE_FILE} ${SOURCE_FILE}
DEPENDS DEPENDS
${INPUT_FILE} ${INPUT_FILE}
${SHADER_DIR}
# HEADER_GENERATOR should be included here but msbuild seems to assume it's always modified # HEADER_GENERATOR should be included here but msbuild seems to assume it's always modified
) )
set(SHADER_HEADERS ${SHADER_HEADERS} ${SOURCE_HEADER_FILE}) set(SHADER_HEADERS ${SHADER_HEADERS} ${SOURCE_HEADER_FILE})
@ -148,6 +151,8 @@ foreach(SOURCE_FILE IN ITEMS ${SHADER_FILES})
${GLSLANGVALIDATOR} -V ${QUIET_FLAG} -I"${FIDELITYFX_INCLUDE_DIR}" ${GLSL_FLAGS} --variable-name ${SPIRV_VARIABLE_NAME} -o ${SPIRV_HEADER_FILE} ${SOURCE_FILE} --target-env ${SPIR_V_VERSION} ${GLSLANGVALIDATOR} -V ${QUIET_FLAG} -I"${FIDELITYFX_INCLUDE_DIR}" ${GLSL_FLAGS} --variable-name ${SPIRV_VARIABLE_NAME} -o ${SPIRV_HEADER_FILE} ${SOURCE_FILE} --target-env ${SPIR_V_VERSION}
MAIN_DEPENDENCY MAIN_DEPENDENCY
${SOURCE_FILE} ${SOURCE_FILE}
DEPENDS
${SHADER_DIR}
) )
set(SHADER_HEADERS ${SHADER_HEADERS} ${SPIRV_HEADER_FILE}) set(SHADER_HEADERS ${SHADER_HEADERS} ${SPIRV_HEADER_FILE})
endif() endif()
@ -167,6 +172,7 @@ foreach(FILEPATH IN ITEMS ${FIDELITYFX_FILES})
${SOURCE_FILE} ${SOURCE_FILE}
DEPENDS DEPENDS
${INPUT_FILE} ${INPUT_FILE}
${SHADER_DIR}
# HEADER_GENERATOR should be included here but msbuild seems to assume it's always modified # HEADER_GENERATOR should be included here but msbuild seems to assume it's always modified
) )
set(SHADER_HEADERS ${SHADER_HEADERS} ${SOURCE_HEADER_FILE}) set(SHADER_HEADERS ${SHADER_HEADERS} ${SOURCE_HEADER_FILE})