tech-pkg archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Qt5 qmake option handling (specifically qt5-qtmultimedia)



Hi,

I noticed that x11/qt5-qtmultimedia has ineffective options.mk. It is
using a mechanism to configure the build that probably used to work
before, but not anymore. This results in the alsa backend being built
if system headers are present even if the option is disabled.

The gist is that you need

qmake -- -no-alsa

instead of whatever 

MAKE_ENV+=	QT_CONFIG+=-alsa

was supposed to do. The current state does this in the build environment:

$ env|grep QT_
QT_CONFIG+=-openal

This only seems to confuse the shell, but at least it _can_ be accessed
via getenv():

$ perl -e 'print "qt_config: ".$ENV{"QT_CONFIG+"}."\n"'
qt_config: -openal

I suppose that defining a variable named QT_CONFIG+ was never really
intentioned. Maybe appending that to a QMAKE_CONFIG variable was the
initial intent. I don't know … I only know that the current state of
qt5-qtmultimedia's options is just wildly broken.

I suggest the following patch as a minimal fix, but I don't think that
explicitly adding the -- separator there is a good idea. There should
be a separate variable like FreeBSD has a QMAKE_CONFIGURE_ARGS, AFAIR.
My issue is that I don't see that path to specifying options being
properly documented. Can we rely on that? `man qmake` is rather silent
on this.

Index: Makefile
===================================================================
RCS file: /cvsroot/pkgsrc/x11/qt5-qtmultimedia/Makefile,v
retrieving revision 1.76
diff -u -r1.76 Makefile
--- Makefile	21 Apr 2021 11:40:51 -0000	1.76
+++ Makefile	12 Jul 2021 13:20:15 -0000
@@ -21,6 +21,7 @@
 	${LN} -f -s ${QTPREFIX}/lib/pkgconfig/${i} ${i}
 .endfor
 
+QMAKE_ARGS+=	--
 .include "options.mk"
 .include "../../x11/qt5-qtdeclarative/buildlink3.mk"
 .include "../../mk/bsd.pkg.mk"
Index: distinfo
===================================================================
RCS file: /cvsroot/pkgsrc/x11/qt5-qtmultimedia/distinfo,v
retrieving revision 1.21
diff -u -r1.21 distinfo
--- distinfo	21 Nov 2020 11:22:33 -0000	1.21
+++ distinfo	12 Jul 2021 13:20:15 -0000
@@ -4,3 +4,4 @@
 RMD160 (qtmultimedia-everywhere-src-5.15.2.tar.xz) = d59aa20f50d017d3b53150427ab362a644a494b4
 SHA512 (qtmultimedia-everywhere-src-5.15.2.tar.xz) = be58e6934976b04707399f8525dd5d50f73e0539efd1a76c2f9868e35e6f136e0991652df5d46350a9ac39d24313353e4aa826131f268a95e458e57279f448bd
 Size (qtmultimedia-everywhere-src-5.15.2.tar.xz) = 3828172 bytes
+SHA1 (patch-src_multimedia_configure.json) = d53c1bf2712e9a32b383beff0025c4ab0b5b6232
Index: options.mk
===================================================================
RCS file: /cvsroot/pkgsrc/x11/qt5-qtmultimedia/options.mk,v
retrieving revision 1.7
diff -u -r1.7 options.mk
--- options.mk	22 Jun 2021 12:34:23 -0000	1.7
+++ options.mk	12 Jul 2021 13:20:15 -0000
@@ -26,38 +26,38 @@
 PLIST_VARS+=	alsa
 .if !empty(PKG_OPTIONS:Malsa)
 PLIST.alsa=	yes
-MAKE_ENV+=	QT_CONFIG+=alsa
+QMAKE_ARGS+=	-alsa
 .include "../../audio/alsa-lib/buildlink3.mk"
 .else
-MAKE_ENV+=	QT_CONFIG+=-alsa
+QMAKE_ARGS+=	-no-alsa
 .endif
 
 PLIST_VARS+=	gst
 .if !empty(PKG_OPTIONS:Mgstreamer)
 PLIST.gst=	yes
-MAKE_ENV+=	QT_CONFIG+=gstreamer-1.0
+QMAKE_ARGS+=	-gstreamer 1.0
 .include "../../multimedia/gst-plugins1-base/buildlink3.mk"
 .else
-MAKE_ENV+=	QT_CONFIG+=-gstreamer-1.0
+QMAKE_ARGS+=	-no-gstreamer
 .endif
 
 PLIST_VARS+=	openal
 .if !empty(PKG_OPTIONS:Mopenal)
 PLIST.openal=	yes
-MAKE_ENV+=	QT_CONFIG+=openal
+QMAKE_ARGS+=	-openal
 .include "../../audio/openal-soft/buildlink3.mk"
 .else
-MAKE_ENV+=	QT_CONFIG+=-openal
+QMAKE_ARGS+=	-no-openal
 .endif
 
 PLIST_VARS+=	pulse
 .if !empty(PKG_OPTIONS:Mpulseaudio)
 PLIST.pulse=	yes
 MAKE_ENV+=	LFLAGS=${COMPILER_RPATH_FLAG}${PREFIX}/lib/pulseaudio
-MAKE_ENV+=	QT_CONFIG+=pulseaudio
+QMAKE_ARGS+=	-pulseaudio
 .include "../../audio/pulseaudio/buildlink3.mk"
 .else
-MAKE_ENV+=	QT_CONFIG+=-pulseaudio
+QMAKE_ARGS+=	-no-pulseaudio
 .endif
 
 PLIST_VARS+=		audioengine
Index: patches/patch-src_multimedia_configure.json
===================================================================
RCS file: patches/patch-src_multimedia_configure.json
diff -N patches/patch-src_multimedia_configure.json
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ patches/patch-src_multimedia_configure.json	12 Jul 2021 13:20:15 -0000
@@ -0,0 +1,15 @@
+$NetBSD$
+
+Add configure knob for openal. Taken from FreeBSD ports.
+Did they push that oversight upstream?
+
+--- src/multimedia/configure.json.orig	2020-10-27 08:02:12.000000000 +0000
++++ src/multimedia/configure.json
+@@ -13,6 +13,7 @@
+             "directshow": { "type": "boolean" },
+             "wmf": { "type": "boolean" },
+             "gstreamer": { "type": "optionalString", "values": [ "no", "yes", "0.10", "1.0" ] },
++            "openal": "boolean",
+             "pulseaudio": "boolean"
+         }
+     },


Thoughts?


Alrighty then,

Thomas

-- 
Dr. Thomas Orgis
HPC @ Universität Hamburg


Home | Main Index | Thread Index | Old Index