diff --git a/devel/corrade/Makefile b/devel/corrade/Makefile --- a/devel/corrade/Makefile +++ b/devel/corrade/Makefile @@ -11,7 +11,7 @@ LICENSE= MIT LICENSE_FILE= ${WRKSRC}/COPYING -USES= cmake compiler:c++14-lang +USES= cmake:testing compiler:c++14-lang USE_LDCONFIG= yes USE_GITHUB= yes @@ -20,4 +20,7 @@ CMAKE_ARGS= -DLIB_SUFFIX:STRING="" +OPTIONS_DEFINE= TEST +TEST_CMAKE_BOOL= CORRADE_BUILD_TESTS + .include diff --git a/devel/corrade/files/patch-src_Corrade_Cpu.h b/devel/corrade/files/patch-src_Corrade_Cpu.h new file mode 100644 --- /dev/null +++ b/devel/corrade/files/patch-src_Corrade_Cpu.h @@ -0,0 +1,38 @@ +--- src/Corrade/Cpu.h.orig 2023-05-22 12:04:59 UTC ++++ src/Corrade/Cpu.h +@@ -1357,7 +1357,7 @@ equivalent: + */ + template constexpr T tag() { return T{Implementation::Init}; } + +-#if defined(CORRADE_TARGET_ARM) && defined(__linux__) && !(defined(CORRADE_TARGET_ANDROID) && __ANDROID_API__ < 18) ++#if defined(CORRADE_TARGET_ARM) && (defined(__linux__) && !(defined(CORRADE_TARGET_ANDROID) && __ANDROID_API__ < 18) || defined(__FreeBSD__)) + namespace Implementation { + /* Needed for a friend declaration, implementation is at the very end of + the header */ +@@ -1496,7 +1496,7 @@ class Features { + #endif + Features runtimeFeatures(); + #endif +- #if defined(CORRADE_TARGET_ARM) && defined(__linux__) && !(defined(CORRADE_TARGET_ANDROID) && __ANDROID_API__ < 18) ++ #if defined(CORRADE_TARGET_ARM) && (defined(__linux__) && !(defined(CORRADE_TARGET_ANDROID) && __ANDROID_API__ < 18) || defined(__FreeBSD__)) + friend Features Implementation::runtimeFeatures(unsigned long); + #endif + +@@ -1775,7 +1775,7 @@ value is equal to @ref Scalar, which in turn is equiva + default-constructed) @ref Features. + @see @ref DefaultBase, @ref DefaultExtra, @ref Default + */ +-#if (defined(CORRADE_TARGET_X86) && (defined(CORRADE_TARGET_MSVC) || defined(CORRADE_TARGET_GCC))) || (defined(CORRADE_TARGET_ARM) && ((defined(__linux__) && !(defined(CORRADE_TARGET_ANDROID) && __ANDROID_API__ < 18)) || defined(CORRADE_TARGET_APPLE))) || defined(DOXYGEN_GENERATING_OUTPUT) ++#if (defined(CORRADE_TARGET_X86) && (defined(CORRADE_TARGET_MSVC) || defined(CORRADE_TARGET_GCC))) || (defined(CORRADE_TARGET_ARM) && ((defined(__linux__) && !(defined(CORRADE_TARGET_ANDROID) && __ANDROID_API__ < 18)) || defined(CORRADE_TARGET_APPLE) || defined(__FreeBSD__))) || defined(DOXYGEN_GENERATING_OUTPUT) + #ifdef CORRADE_TARGET_ARM + CORRADE_UTILITY_EXPORT /* Inlined on x86 at the very end of the header */ + #endif +@@ -3214,7 +3214,7 @@ inline Features runtimeFeatures() { + /** @todo If AT_HWCAP2 or other bits are needed, it's passed to ifunc resolvers + only since glibc 2.30 (and Android API 30+, which is the same as before): + https://github.com/bminor/glibc/commit/2b8a3c86e7606cf1b0a997dad8af2d45ae8989c3 */ +-#if defined(CORRADE_TARGET_ARM) && defined(__linux__) && !(defined(CORRADE_TARGET_ANDROID) && __ANDROID_API__ < 18) ++#if defined(CORRADE_TARGET_ARM) && (defined(__linux__) && !(defined(CORRADE_TARGET_ANDROID) && __ANDROID_API__ < 18) || defined(__FreeBSD__)) + namespace Implementation { + inline Features runtimeFeatures(const unsigned long caps) { + unsigned int out = 0; diff --git a/devel/corrade/files/patch-src_Corrade_Cpu.cpp b/devel/corrade/files/patch-src_Corrade_Cpu.cpp new file mode 100644 --- /dev/null +++ b/devel/corrade/files/patch-src_Corrade_Cpu.cpp @@ -0,0 +1,34 @@ +--- src/Corrade/Cpu.cpp.orig 2023-05-22 11:59:16 UTC ++++ src/Corrade/Cpu.cpp +@@ -34,7 +34,7 @@ + /** @todo these are indented to work around acme.py extracting them to the top, + fix properly */ + /* getauxval() for ARM on Linux and Android with API level 18+ */ +-#if defined(CORRADE_TARGET_ARM) && defined(__linux__) && !(defined(CORRADE_TARGET_ANDROID) && __ANDROID_API__ < 18) ++#if defined(CORRADE_TARGET_ARM) && (defined(__linux__) && !(defined(CORRADE_TARGET_ANDROID) && __ANDROID_API__ < 18) || defined(__FreeBSD__)) + #include + /* sysctlbyname() for ARM on macOS / iOS */ + #elif defined(CORRADE_TARGET_ARM) && defined(CORRADE_TARGET_APPLE) +@@ -80,7 +80,7 @@ int appleSysctlByName(const char* name) { + } + #endif + +-#if defined(CORRADE_TARGET_ARM) && ((defined(__linux__) && !(defined(CORRADE_TARGET_ANDROID) && __ANDROID_API__ < 18)) || defined(CORRADE_TARGET_APPLE)) ++#if defined(CORRADE_TARGET_ARM) && ((defined(__linux__) && !(defined(CORRADE_TARGET_ANDROID) && __ANDROID_API__ < 18)) || defined(CORRADE_TARGET_APPLE) || defined(__FreeBSD__)) + Features runtimeFeatures() { + /* Use getauxval() on ARM on Linux and Android */ + #if defined(CORRADE_TARGET_ARM) && defined(__linux__) && !(defined(CORRADE_TARGET_ANDROID) && __ANDROID_API__ < 18) +@@ -130,6 +130,13 @@ Features runtimeFeatures() { + /* No other (deinlined) implementation at the moment. The function should + not be even defined here in that case -- it's inlined in the header + instead, including the x86 implementation. */ ++ #elif defined(CORRADE_TARGET_ARM) && defined(__FreeBSD__) ++ /* use elf_aux_info() on ARM on FreeBSD */ ++ unsigned long hwcap = 0; ++ ++ elf_aux_info(AT_HWCAP, &hwcap, sizeof hwcap); ++ ++ return Implementation::runtimeFeatures(hwcap); + #else + #error + #endif diff --git a/devel/corrade/files/patch-src_Corrade_Utility_Path.cpp b/devel/corrade/files/patch-src_Corrade_Utility_Path.cpp new file mode 100644 --- /dev/null +++ b/devel/corrade/files/patch-src_Corrade_Utility_Path.cpp @@ -0,0 +1,33 @@ +--- src/Corrade/Utility/Path.cpp.orig 2023-01-12 11:52:02 UTC ++++ src/Corrade/Utility/Path.cpp +@@ -89,6 +89,11 @@ + #include + #endif + ++#ifdef __FreeBSD__ ++#include ++#include ++#endif ++ + #include "Corrade/configure.h" + #include "Corrade/Containers/Array.h" + #include "Corrade/Containers/GrowableArray.h" +@@ -540,6 +545,18 @@ Containers::Optional executableLoc + /* hardcoded for Emscripten */ + #elif defined(CORRADE_TARGET_EMSCRIPTEN) + return Containers::String{"/app.js"_s}; ++ ++ #elif defined(__FreeBSD__) ++ Containers::Array path; ++ size_t size; ++ const int mib[4] = { CTL_KERN, KERN_PROC, KERN_PROC_PATHNAME, -1 }; ++ ++ sysctl(mib, 4, nullptr, &size, NULL, 0); ++ arrayResize(path, NoInit, size + 1); ++ sysctl(mib, 4, path, &size, NULL, 0); ++ path[size] = '\0'; ++ const auto deleter = path.deleter(); ++ return Containers::String{path.release(), size, deleter}; + + /* Not implemented */ + #else