Hi Sebastian, ports,

> http://build-failures.rhaalovely.net/powerpc/last/audio/qsynth.log
(Qt5 doesn't build on sparc64)

What happens behind the scenes (may it be clang or gcc):

- Cmake search for math libs [1], and can't find them, setting
  CONFIG_ROUND not defined
- Later, lroundf() is declared as a bundled, static function [2]

The problem (to me) is that it seems that Qt headers pull <cmath>, so 
there is a clash when using gcc. That doesn't occur with clang.

There are several way to fix it, but in any case, <math.h> would cause
an out of scope error with ports-gcc, similarily to what you can find in
math/{veusz,kst} in powerpc build failures.

So i'm explicitly including <cmath> when not using clang on OpenBSD,
to point the problem out (but alternatives are welcome).

It then builds fine on macppc [3] and amd64 [4].

Charlène.


[1] https://github.com/rncbc/qsynth/blob/master/CMakeLists.txt#L58
[2]
https://github.com/rncbc/qsynth/blob/master/src/qsynthMainForm.cpp#L103
[3] http://0x0.st/z8qH.txt
[4] http://0x0.st/z8qX.txt


Index: Makefile
===================================================================
RCS file: /cvs/ports/audio/qsynth/Makefile,v
retrieving revision 1.6
diff -u -p -u -p -r1.6 Makefile
--- Makefile    8 Mar 2019 20:00:40 -0000       1.6
+++ Makefile    17 Mar 2019 13:45:26 -0000
@@ -3,7 +3,7 @@
 COMMENT =              Qt GUI Interface for FluidSynth
 
 DISTNAME =             qsynth-0.5.4
-REVISION =             0
+REVISION =             1
 
 CATEGORIES =           audio
 
Index: patches/patch-src_qsynthMainForm_cpp
===================================================================
RCS file: patches/patch-src_qsynthMainForm_cpp
diff -N patches/patch-src_qsynthMainForm_cpp
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ patches/patch-src_qsynthMainForm_cpp        17 Mar 2019 13:45:26 -0000
@@ -0,0 +1,20 @@
+$OpenBSD$
+
+ports-gcc fix. lroundf() is not detected during configuration, so CONFIG_ROUND
+is undefined. But <cmath> is pulled by Qt headers already, creating a conflict
+between <cmath>'s lroundf() and the bundled lroundf().
+
+Using <math.h> would cause an out of scope error.
+
+Index: src/qsynthMainForm.cpp
+--- src/qsynthMainForm.cpp.orig
++++ src/qsynthMainForm.cpp
+@@ -103,6 +103,8 @@ static int g_fdStdout[2] = { QSYNTH_FDNIL, QSYNTH_FDNI
+ // Needed for lroundf()
+ #ifdef CONFIG_ROUND
+ #include <math.h>
++#elif defined(__OpenBSD__) && !defined(__clang__)
++#include <cmath>
+ #else
+ static inline long lroundf ( float x )
+ {

Reply via email to