On Thu, Dec 30 2021, Pascal Stumpf <pas...@stumpf.co> wrote:
> Here's an update for games/irrlamb, which now no longer uses
> devel/bullet.  It has an internal copy of Irrlicht, but working around
> this to use the version from ports seems to not create any issues.

This breaks on !(amd64) for various reasons.

1. -msse -mfpmath=sse should only be used on amd64, see Makefile and
  patches/patch-CMakeLists_txt below.

2. src/ode/odeconfig.h is a pile of ifdef kludges.  I added a hack in the
  second part of the diff below but I really suggest not using it as is.
  Maybe this should only be built on amd64.  And arm64.  *argh*.


Index: Makefile
===================================================================
RCS file: /cvs/ports/games/irrlamb/Makefile,v
retrieving revision 1.13
diff -u -p -r1.13 Makefile
--- Makefile    30 Dec 2021 22:13:47 -0000      1.13
+++ Makefile    2 Jan 2022 21:34:11 -0000
@@ -30,6 +30,13 @@ WRKDIST =    ${WRKDIR}/irrlamb-$Vr613
 
 NO_TEST =      Yes
 
+.if ${MACHINE_ARCH} == "amd64"
+SSE_FLAGS =    -msse -mfpmath=sse
+.else
+SSE_FLAGS =
+.endif
+SUBST_VARS +=  SSE_FLAGS
+
 post-extract:
        rm -rf ${WRKSRC}/src/irrlicht
 
Index: patches/patch-CMakeLists_txt
===================================================================
RCS file: /cvs/ports/games/irrlamb/patches/patch-CMakeLists_txt,v
retrieving revision 1.1
diff -u -p -r1.1 patch-CMakeLists_txt
--- patches/patch-CMakeLists_txt        30 Dec 2021 22:13:47 -0000      1.1
+++ patches/patch-CMakeLists_txt        2 Jan 2022 21:34:11 -0000
@@ -3,7 +3,7 @@ $OpenBSD: patch-CMakeLists_txt,v 1.1 202
 Index: CMakeLists.txt
 --- CMakeLists.txt.orig
 +++ CMakeLists.txt
-@@ -29,7 +29,6 @@ if(WIN32)
+@@ -29,11 +29,10 @@ if(WIN32)
  elseif(UNIX)
        add_definitions(-DPLATFORM=0)
        add_definitions(-DLUA_USE_LINUX)
@@ -11,6 +11,11 @@ Index: CMakeLists.txt
  endif()
  
  # compiler flags
+-set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wno-deprecated-declarations 
-pedantic -std=gnu++11 -msse -mfpmath=sse")
++set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wno-deprecated-declarations 
-pedantic -std=gnu++11 ${SSE_FLAGS}")
+ set(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} -DdNODEBUG -s")
+ set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -DdNODEBUG -s")
+ 
 @@ -72,7 +71,7 @@ find_package(Threads REQUIRED)
  
  # include paths
Index: patches/patch-src_ode_odeconfig_h
===================================================================
RCS file: patches/patch-src_ode_odeconfig_h
diff -N patches/patch-src_ode_odeconfig_h
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ patches/patch-src_ode_odeconfig_h   3 Jan 2022 02:02:25 -0000
@@ -0,0 +1,16 @@
+$OpenBSD$
+
+Hack to build this on riscv64.
+
+Index: src/ode/odeconfig.h
+--- src/ode/odeconfig.h.orig
++++ src/ode/odeconfig.h
+@@ -81,7 +81,7 @@
+ 
+ 
+ /* Well-defined common data types...need to define for 64 bit systems */
+-#if defined(__aarch64__)
++#if defined(__aarch64__) || (defined(__riscv) && __riscv_xlen == 64)
+     #include <stdint.h>
+     typedef int64_t         dint64;
+     typedef uint64_t        duint64;

-- 
jca | PGP : 0x1524E7EE / 5135 92C1 AD36 5293 2BDF  DDCC 0DFA 74AE 1524 E7EE

Reply via email to