Hi,

> http://build-failures.rhaalovely.net/sparc64/2020-01-05/math/kst.log
> http://build-failures.rhaalovely.net/powerpc/2019-12-08/math/kst.log

I proposed a fix in the past, but this one is way less intrusive and
has no impact on clang archs.

There are 2 problems: 

- we don't need '-lrt'
- some maths functions are out of scope

The below diff deals with these two issues, allowing kst to build [0]
and run fine on macppc.

Comments/feedback are welcome, 

Charlène.


[0] https://bin.charlenew.xyz/kst.log 


Index: Makefile
===================================================================
RCS file: /cvs/ports/math/kst/Makefile,v
retrieving revision 1.38
diff -u -p -u -p -r1.38 Makefile
--- Makefile    12 Jul 2019 20:47:42 -0000      1.38
+++ Makefile    9 Jan 2020 10:44:43 -0000
@@ -5,7 +5,7 @@ COMMENT=        data viewing/plotting tool
 GH_ACCOUNT =   Kst-plot
 GH_PROJECT =   kst
 GH_TAGNAME =   v2.0.8
-REVISION =     2
+REVISION =     3
 
 SHARED_LIBS +=  kst2core                  0.0 # 2.0
 SHARED_LIBS +=  kst2math                  0.0 # 2.0
Index: patches/patch-src_libkst_CMakeLists_txt
===================================================================
RCS file: patches/patch-src_libkst_CMakeLists_txt
diff -N patches/patch-src_libkst_CMakeLists_txt
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ patches/patch-src_libkst_CMakeLists_txt     9 Jan 2020 10:44:43 -0000
@@ -0,0 +1,16 @@
+$OpenBSD$
+
+ports-gcc: we don't need -lrt
+
+Index: src/libkst/CMakeLists.txt
+--- src/libkst/CMakeLists.txt.orig
++++ src/libkst/CMakeLists.txt
+@@ -7,7 +7,7 @@ kst_files_ignore(stdinsource timezones)
+ if(WIN32 OR APPLE OR QNX OR ${CMAKE_SYSTEM_NAME} MATCHES "FreeBSD")
+       kst_files_ignore(sysinfo psversion)
+ else()
+-    if(NOT kst_clang)
++    if(NOT kst_clang AND NOT ${CMAKE_SYSTEM_NAME} MATCHES "OpenBSD")
+         set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -lrt")
+     endif()
+ endif()
Index: patches/patch-src_libkst_math_kst_h
===================================================================
RCS file: patches/patch-src_libkst_math_kst_h
diff -N patches/patch-src_libkst_math_kst_h
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ patches/patch-src_libkst_math_kst_h 9 Jan 2020 10:44:43 -0000
@@ -0,0 +1,21 @@
+$OpenBSD$
+
+ports-gcc: fix out of scope errors
+
+Index: src/libkst/math_kst.h
+--- src/libkst/math_kst.h.orig
++++ src/libkst/math_kst.h
+@@ -31,6 +31,13 @@ inline double pow(float a, double b) { return pow((dou
+ inline double pow(int a, qreal b) { return pow((double)a, (double)b); }
+ #endif
+ 
++#if defined(__OpenBSD__) && !defined(__clang__)
++#include <cmath>
++#define isnan std::isnan
++#define isinf std::isinf
++#define isfinite std::isfinite
++#endif
++
+ namespace Kst {
+ /*
+ ** For systems without NAN, this is a NAN in IEEE double format.

Reply via email to