git: e3981a8cb5c1 - main - science/openmodelica: fix build on powerpc64le
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Sat, 31 Oct 2026 21:33:53 UTC
The branch main has been updated by pkubaj:
URL: https://cgit.FreeBSD.org/ports/commit/?id=e3981a8cb5c18c9729629e56055d3fc5dfd31418
commit e3981a8cb5c18c9729629e56055d3fc5dfd31418
Author: Piotr Kubaj <pkubaj@FreeBSD.org>
AuthorDate: 2026-10-28 19:34:12 +0000
Commit: Piotr Kubaj <pkubaj@FreeBSD.org>
CommitDate: 2026-10-31 21:33:03 +0000
science/openmodelica: fix build on powerpc64le
Teach the CMake build of the bundled libffi about powerpc64. CMinpack's
long double library isn't built when long double is the same as double,
as on powerpc64le before 16.0, so don't list it in the plist there.
---
science/openmodelica/Makefile | 10 ++++++++++
...piler_3rdParty_libffi_.cmake_configure__options.cmake | 16 ++++++++++++++++
...iler_3rdParty_libffi_.cmake_configure__platform.cmake | 11 +++++++++++
science/openmodelica/pkg-plist | 4 ++--
4 files changed, 39 insertions(+), 2 deletions(-)
diff --git a/science/openmodelica/Makefile b/science/openmodelica/Makefile
index 7acfadee0d37..b605169ca205 100644
--- a/science/openmodelica/Makefile
+++ b/science/openmodelica/Makefile
@@ -80,6 +80,16 @@ BINARY_ALIAS= make=${GMAKE}
CONFLICTS_INSTALL= cminpack # see https://github.com/OpenModelica/OpenModelica/issues/14701
+.include <bsd.port.options.mk>
+
+# CMinpack only builds libcminpackld when long double is wider than double,
+# which on powerpc64le is only the case since 16.0 (IEEE binary128).
+.if ${ARCH} == powerpc64le && ${OSVERSION} < 1600019
+PLIST_SUB+= LONG_DOUBLE="@comment "
+.else
+PLIST_SUB+= LONG_DOUBLE=""
+.endif
+
post-extract:
# remove stray *.orig files
@${FIND} ${WRKSRC} -name "*.orig" -delete
diff --git a/science/openmodelica/files/patch-OMCompiler_3rdParty_libffi_.cmake_configure__options.cmake b/science/openmodelica/files/patch-OMCompiler_3rdParty_libffi_.cmake_configure__options.cmake
new file mode 100644
index 000000000000..64b16187c72b
--- /dev/null
+++ b/science/openmodelica/files/patch-OMCompiler_3rdParty_libffi_.cmake_configure__options.cmake
@@ -0,0 +1,16 @@
+--- OMCompiler/3rdParty/libffi/.cmake/configure_options.cmake.orig 2025-10-15 12:39:07 UTC
++++ OMCompiler/3rdParty/libffi/.cmake/configure_options.cmake
+@@ -112,6 +112,13 @@ elseif(TARGET_PLATFORM MATCHES ARM.*)
+
+ list(APPEND SOURCES_LIST src/arm/ffi.c)
+ set(TARGETDIR arm)
++elseif(TARGET_PLATFORM STREQUAL POWERPC)
++ list(APPEND SOURCES_LIST
++ src/powerpc/ffi.c
++ src/powerpc/ffi_linux64.c
++ src/powerpc/linux64.S
++ src/powerpc/linux64_closure.S)
++ set(TARGETDIR powerpc)
+ endif()
+
+ if(CMAKE_SYSTEM_NAME STREQUAL Darwin AND TARGET_PLATFORM STREQUAL AARCH64)
diff --git a/science/openmodelica/files/patch-OMCompiler_3rdParty_libffi_.cmake_configure__platform.cmake b/science/openmodelica/files/patch-OMCompiler_3rdParty_libffi_.cmake_configure__platform.cmake
new file mode 100644
index 000000000000..0a3e5d37dd48
--- /dev/null
+++ b/science/openmodelica/files/patch-OMCompiler_3rdParty_libffi_.cmake_configure__platform.cmake
@@ -0,0 +1,11 @@
+--- OMCompiler/3rdParty/libffi/.cmake/configure_platform.cmake.orig 2025-10-15 12:39:07 UTC
++++ OMCompiler/3rdParty/libffi/.cmake/configure_platform.cmake
+@@ -38,6 +38,8 @@ if("${TARGET_PLATFORM}" STREQUAL "")
+ else()
+ set(TARGET_PLATFORM ARM)
+ endif()
++ elseif(HOST_ARCH MATCHES powerpc64.*|ppc64.*)
++ set(TARGET_PLATFORM POWERPC)
+ else()
+ message(FATAL_ERROR "Unknown host.")
+ endif()
diff --git a/science/openmodelica/pkg-plist b/science/openmodelica/pkg-plist
index c2d8884127a1..66bba4f91654 100644
--- a/science/openmodelica/pkg-plist
+++ b/science/openmodelica/pkg-plist
@@ -660,7 +660,7 @@ lib/omc/libamd.a
lib/omc/libbtf.a
lib/omc/libcdaskr.a
lib/omc/libcminpack.a
-lib/omc/libcminpackld.a
+%%LONG_DOUBLE%%lib/omc/libcminpackld.a
lib/omc/libcminpacks.a
lib/omc/libcolamd.a
lib/omc/libexpat.a
@@ -704,7 +704,7 @@ lib/omc/libumfpack.a
lib/omc/libzlib.a
lib/omc/libzmq.a
lib/omc/pkgconfig/cminpack.pc
-lib/omc/pkgconfig/cminpackld.pc
+%%LONG_DOUBLE%%lib/omc/pkgconfig/cminpackld.pc
lib/omc/pkgconfig/cminpacks.pc
lib/omc/pkgconfig/expat.pc
lib/omc/pkgconfig/libzmq.pc