Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F140526013
D40202.id122209.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
6 KB
Referenced Files
None
Subscribers
None
D40202.id122209.diff
View Options
Index: devel/corrade/Makefile
===================================================================
--- devel/corrade/Makefile
+++ 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_ON= CORRADE_BUILD_TESTS
+
.include <bsd.port.mk>
Index: devel/corrade/files/patch-src_Corrade_Cpu.h
===================================================================
--- /dev/null
+++ 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<class T> 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;
Index: devel/corrade/files/patch-src_Corrade_Cpu.cpp
===================================================================
--- /dev/null
+++ 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 <sys/auxv.h>
+ /* 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
Index: devel/corrade/files/patch-src_Corrade_Utility_Path.cpp
===================================================================
--- /dev/null
+++ devel/corrade/files/patch-src_Corrade_Utility_Path.cpp
@@ -0,0 +1,31 @@
+--- src/Corrade/Utility/Path.cpp.orig 2023-01-12 11:52:02 UTC
++++ src/Corrade/Utility/Path.cpp
+@@ -89,6 +89,11 @@
+ #include <io.h>
+ #endif
+
++#ifdef __FreeBSD__
++#include <sys/types.h>
++#include <sys/sysctl.h>
++#endif
++
+ #include "Corrade/configure.h"
+ #include "Corrade/Containers/Array.h"
+ #include "Corrade/Containers/GrowableArray.h"
+@@ -542,6 +547,16 @@ Containers::Optional<Containers::String> executableLoc
+ return Containers::String{"/app.js"_s};
+
+ /* Not implemented */
++ #elif define(__FreeBSD__)
++ Containers::Array<char> 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);
++ sysctl(mib, 4, path, &lenp, NULL, 0);
++ const auto deleter = path.deleter();
++ return Containers::String{path.release(), size, deleter};
+ #else
+ Error{} << "Utility::Path::executableLocation(): not implemented on this platform";
+ return {};
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Thu, Dec 25, 10:08 PM (8 h, 32 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
27264617
Default Alt Text
D40202.id122209.diff (6 KB)
Attached To
Mode
D40202: devel/corrade: fix build on aarch64, missing FreeBSD code
Attached
Detach File
Event Timeline
Log In to Comment