On Tue, Mar 19 2019, Charlene Wendling <[email protected]> wrote:
> Hi,
>
> On Mon, 18 Mar 2019 22:56:35 +0100
> "Sebastian Reitenbach" <[email protected]> wrote:
>
>> Hi,
>> 
>> Am Montag, März 18, 2019 17:36 CET, Sebastian Reitenbach
>> <[email protected]> schrieb:
>> 
>> > Hi,
>> >
>> > I was just testin to updat to 0.5.5, and failed miserably. I
>> > contacted upstream and was told to use configure, make, make
>> > install instead of cmake.
>> >
>> > Let me try that, and I’ll send you the update, to test it on
>> > sparc64, maybe that will fix the problem
>> >
>> > Sebastian
>> >
>> > Sent from my iPhone
>> >
>> > > On 17. Mar 2019, at 14:58, Charlene Wendling
>> > > <[email protected]> wrote:> 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.
>> > >
>> > >
>> 
>> as promised, here's the update to 0.5.5, which as upstream
>> recommended to me switched from cmake to gnu style
>> configure/make/make install. As they told me, the cmake stuff is more
>> an example, and not kept up to date with the gnu style of building,
>> therefore it should not really be used. Guess it was pure luck it
>> worked with the older releases ;) Additionally a bit of cleanup in
>> the Makefile, let me know if it fixes the math thingie bingie on gcc
>> archs.
>> 
>> cheers,
>> Sebastian
>> 
>
> It builds fine on macppc [1], after some modifications to your diff: 
>
> - It wants atomic as WANTLIB (macppc specific, will be dropped once
>   macppc has base-clang)
> - I had to bring the lroundf() fix again :(
> - portcheck says it needs x11/gtk+3,-guic (not sure if it's a false
>   positive though)

That's what the documentation says for @tag:

     @tag name [parameter]
             Reference a tag of given name.  The corresponding @define-tag
             definition must be accessible through the dependency tree.

This port could have a manpage if the "install" target in Makefile.in
didn't use install -v (fails) and gzip.

See other my comments inline,

> It yells that it wants c+11, i feared that i had to use the infamous
> block that enables it like in other ports, but it's not needed as
> upstream adds -std=gnu++11 during the effective build. And anyway this
> warning will disappear once we move to ports-gcc-8 "soonish" (to quote
> espie@).
>
> Ah, and well, it runs [2], i can't really test as i've not 
> the hardware needed ;)
>
> Charlène.
>
> [1] http://0x0.st/z829.txt
> [2] http://0x0.st/z821.jpg

> Index: Makefile
> ===================================================================
> RCS file: /cvs/ports/audio/qsynth/Makefile,v
> retrieving revision 1.6
> diff -u -p -r1.6 Makefile
> --- Makefile  8 Mar 2019 20:00:40 -0000       1.6
> +++ Makefile  18 Mar 2019 22:58:05 -0000
> @@ -2,8 +2,7 @@
>  
>  COMMENT =            Qt GUI Interface for FluidSynth
>  
> -DISTNAME =           qsynth-0.5.4
> -REVISION =           0
> +DISTNAME =           qsynth-0.5.5
>  
>  CATEGORIES =         audio
>  
> @@ -16,22 +15,26 @@ PERMIT_PACKAGE_CDROM =    Yes
>  
>  MASTER_SITES =               ${MASTER_SITE_SOURCEFORGE:=qsynth/}
>  
> -WANTLIB += ${COMPILER_LIBCXX} Qt5Core Qt5Gui Qt5Widgets X11 c
> -WANTLIB += m fluidsynth Qt5X11Extras
> +WANTLIB += ${COMPILER_LIBCXX} Qt5Core Qt5Gui Qt5Widgets c
> +WANTLIB += m fluidsynth GL Qt5Network curses readline
>  
> -MODULES =            devel/cmake \
> -                     x11/qt5
> +.if ${MACHINE_ARCH} == "powerpc"
> +WANTLIB += atomic
> +.endif
>  
> -LIB_DEPENDS +=               audio/fluidsynth \
> -                     x11/qt5/qtx11extras
> +MODULES =            x11/qt5
> +
> +LIB_DEPENDS +=               audio/fluidsynth
>  
>  RUN_DEPENDS +=               devel/desktop-file-utils \
> +                     x11/gtk+3,-guic
>  
> +USE_GMAKE =          Yes
>  NO_TEST =            Yes
>  
> -BUILD_DEPENDS =              audio/fluidsynth
> +CONFIGURE_STYLE =    gnu
>  
> -post-build:
> -     cp ${WRKSRC}/src/qsynth.desktop ${WRKBUILD}/src/
> +CONFIGURE_ENV +=     CFLAGS="${CFLAGS} -I${LOCALBASE}/include" \

Maybe use CPPFLAGS here, which usually works for both C and C++ compilers.

> +                     LDDFLAGS="${LDDFLAGS} -L${LOCALBASE}/lib"

s/LDDFLAGS/LDFLAGS/

Please also add -L${X11BASE}/lib to LDFLAGS else some configure tests
will fail on ld.lld platforms:

--8<--
  Qsynth 0.5.5

  Build target . . . . . . . . . . . . . . . . . . .: release

  FluidSynth library support . . . . . . . . . . . .: yes
  FluidSynth server support  . . . . . . . . . . . .: no
  FluidSynth system reset support  . . . . . . . . .: no
  FluidSynth bank offset support . . . . . . . . . .: no
  FluidSynth channel info support (DEPRECATED) . . .: no
  FluidSynth MIDI router support  (DEPRECATED) . . .: no
  FluidSynth unset program support . . . . . . . . .: no
  FluidSynth version string support  . . . . . . . .: no

  System tray icon support . . . . . . . . . . . . .: yes

  Unique/Single instance support . . . . . . . . . .: yes
  Gradient eye-candy . . . . . . . . . . . . . . . .: yes
  Debugger stack-trace (gdb) . . . . . . . . . . . .: no

  Install prefix . . . . . . . . . . . . . . . . . .: /usr/local
-->8--

vs

--8<--
  Qsynth 0.5.5

  Build target . . . . . . . . . . . . . . . . . . .: release

  FluidSynth library support . . . . . . . . . . . .: yes
  FluidSynth server support  . . . . . . . . . . . .: yes
  FluidSynth system reset support  . . . . . . . . .: yes
  FluidSynth bank offset support . . . . . . . . . .: yes
  FluidSynth channel info support (DEPRECATED) . . .: no
  FluidSynth MIDI router support  (DEPRECATED) . . .: no
  FluidSynth unset program support . . . . . . . . .: yes
  FluidSynth version string support  . . . . . . . .: yes

  System tray icon support . . . . . . . . . . . . .: yes

  Unique/Single instance support . . . . . . . . . .: yes
  Gradient eye-candy . . . . . . . . . . . . . . . .: yes
  Debugger stack-trace (gdb) . . . . . . . . . . . .: no

  Install prefix . . . . . . . . . . . . . . . . . .: /usr/local
-->8--


>  .include <bsd.port.mk>
> Index: distinfo
> ===================================================================
> RCS file: /cvs/ports/audio/qsynth/distinfo,v
> retrieving revision 1.4
> diff -u -p -r1.4 distinfo
> --- distinfo  2 Jan 2019 21:56:15 -0000       1.4
> +++ distinfo  18 Mar 2019 22:58:05 -0000
> @@ -1,2 +1,2 @@
> -SHA256 (qsynth-0.5.4.tar.gz) = LWvvtAI/imTzXYApkdDUE+EdAwfodIVCjJablLsr+E4=
> -SIZE (qsynth-0.5.4.tar.gz) = 268106
> +SHA256 (qsynth-0.5.5.tar.gz) = hY9SuVZCol9XA0LVz3+v0qKt24nVZ8W2ijVFvrb9pyM=
> +SIZE (qsynth-0.5.5.tar.gz) = 269061
> Index: patches/patch-src_qsynthChannelsForm_cpp
> ===================================================================
> RCS file: patches/patch-src_qsynthChannelsForm_cpp
> diff -N patches/patch-src_qsynthChannelsForm_cpp
> --- /dev/null 1 Jan 1970 00:00:00 -0000
> +++ patches/patch-src_qsynthChannelsForm_cpp  18 Mar 2019 22:58:05 -0000
> @@ -0,0 +1,33 @@
> +$OpenBSD$
> +
> +Index: src/qsynthChannelsForm.cpp
> +--- src/qsynthChannelsForm.cpp.orig
> ++++ src/qsynthChannelsForm.cpp
> +@@ -256,11 +256,11 @@ void qsynthChannelsForm::updateChannel ( int iChan )
> +     #ifdef CONFIG_FLUID_BANK_OFFSET
> +             int iSFID = 0;
> +             QString sSFName;
> +-    #ifdef CONFIG_FLUID_PRESET_GET_SFONT
> ++            #ifdef CONFIG_FLUID_PRESET_GET_SFONT
> +             fluid_sfont_t *pSoundFont = ::fluid_preset_get_sfont(pPreset);
> +-    #else
> ++            #else
> +             fluid_sfont_t *pSoundFont = pPreset->sfont;
> +-    #endif
> ++            #endif
> +             if (pSoundFont) {
> +             #ifdef CONFIG_FLUID_SFONT_GET_ID
> +                     iSFID = ::fluid_sfont_get_id(pSoundFont);

Is that hunk really needed?

> +@@ -290,10 +290,12 @@ void qsynthChannelsForm::updateChannel ( int iChan )
> +             pItem->setText(QSYNTH_CHANNELS_PROG,
> +                     QString::number(iProg));
> +             pItem->setText(QSYNTH_CHANNELS_NAME, sName);
> ++    #ifdef CONFIG_FLUID_BANK_OFFSET
> +             pItem->setText(QSYNTH_CHANNELS_SFID,
> +                     QString::number(iSFID));
> +             pItem->setText(QSYNTH_CHANNELS_SFNAME,
> +                     QFileInfo(sSFName).baseName());
> ++    #endif
> +             // Make this a dirty-operation.
> +             m_iDirtyCount++;
> +     }
> 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      18 Mar 2019 22:58:05 -0000
> @@ -0,0 +1,18 @@
> +$OpenBSD$
> +
> +ports-gcc fix. lroundf() is not detected during configuration, so 
> CONFIG_ROUND
> +is undefined.

cwen:

Could you please check why lroundf isn't detected?

> But <cmath> is pulled by Qt headers already, creating a conflict
> +between <cmath>'s lroundf() and the bundled lroundf().

If this source file falls back on the bundled lroundf, then maybe the
fallback path doesn't need to include math.h/cmath at all?  ofc I would
prefer qsynth to just use "our" lroundf.

> +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 )
> + {
> Index: pkg/PLIST
> ===================================================================
> RCS file: /cvs/ports/audio/qsynth/pkg/PLIST,v
> retrieving revision 1.3
> diff -u -p -r1.3 PLIST
> --- pkg/PLIST 26 Jul 2018 12:16:34 -0000      1.3
> +++ pkg/PLIST 18 Mar 2019 22:58:05 -0000
> @@ -1,14 +1,15 @@
>  @comment $OpenBSD: PLIST,v 1.3 2018/07/26 12:16:34 sebastia Exp $
>  @bin bin/qsynth
>  share/applications/qsynth.desktop
> -share/pixmaps/
> -share/pixmaps/qsynth.png
> +share/icons/hicolor/32x32/apps/qsynth.png
> +share/metainfo/
> +share/metainfo/qsynth.appdata.xml
>  share/qsynth/
>  share/qsynth/translations/
>  share/qsynth/translations/qsynth_cs.qm
>  share/qsynth/translations/qsynth_de.qm
> -share/qsynth/translations/qsynth_es.qm
>  share/qsynth/translations/qsynth_fr.qm
>  share/qsynth/translations/qsynth_ru.qm
>  share/qsynth/translations/qsynth_sr.qm
>  @tag update-desktop-database
> +@tag gtk-update-icon-cache %D/share/icons/hicolor
>

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

Reply via email to