Bug 229759 - multimedia/vlc-qt4 fails to build, when qt5 is also installed
Summary: multimedia/vlc-qt4 fails to build, when qt5 is also installed
Status: Closed Overcome By Events
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Only Me
Assignee: Thomas Zander
URL:
Keywords: easy, patch
Depends on:
Blocks:
 
Reported: 2018-07-13 16:38 UTC by Mikhail Teterin
Modified: 2019-01-11 17:16 UTC (History)
5 users (show)

See Also:
riggs: maintainer-feedback+


Attachments
Full output of make configure (29.97 KB, text/plain)
2018-07-13 19:02 UTC, Mikhail Teterin
no flags Details
suggested fix to multimedia/vlc (512 bytes, patch)
2018-07-13 19:37 UTC, Tobias C. Berner
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Mikhail Teterin freebsd_committer 2018-07-13 16:38:19 UTC
Attempting to build vlc-qt4 kept failing with cpp-errors (this file was generated with moc-5....) until I modified qt.mk as below to explicitly add MOC to the environment bypassing the qtchooser:

--- Uses/qt.mk  (revision 474594)
+++ Uses/qt.mk  (working copy)
@@ -118,8 +118,8 @@
 .  endfor
 
 # Pass the chosen Qt version to the environment for qtchooser.
-CONFIGURE_ENV+=                QT_SELECT=${_QT_RELNAME}
-MAKE_ENV+=             QT_SELECT=${_QT_RELNAME}
+CONFIGURE_ENV+=                QT_SELECT=${_QT_RELNAME} MOC=${MOC:Q}
+MAKE_ENV+=             QT_SELECT=${_QT_RELNAME} MOC=${MOC:Q}
 
 # Make sure both the installed mkspecs as well as the ones being built are
 # found, with the ones from the port being built having preference.


Other ports using moc (or anything else backed by qtchooser) may be affected too -- this is not something, that would show up in a pristine build...
Comment 1 Tobias C. Berner freebsd_committer 2018-07-13 18:05:39 UTC
Hm, that seems to be an issue specifically with vlc and its configure script -- I would prefer the fix to be in multimedia/vlc*.


mfg Tobias
Comment 2 Mikhail Teterin freebsd_committer 2018-07-13 18:10:54 UTC
(In reply to Tobias C. Berner from comment #1)
> Hm, that seems to be an issue specifically with vlc

How would you know? Poudrierre builds in jails, does not it, so it is unlikely to ever encounter a situation, where both mocs are installed...

If ${MOC} is empty, vlc's configure looks for a) moc-qt4; b) moc in the PATH. It finds ${LOCALBASE}/bin/moc (which in our case is a symlink to qtchooser) and calls it.

Why is qtchooser then choosing the wrong moc, I do not know... Either way, something must be done...
Comment 3 Tobias C. Berner freebsd_committer 2018-07-13 18:20:06 UTC
If you look at the configure output:

[...]
configure: WARNING: Not building Qt Interface with X11 helpers.
checking for moc-qt5... no
checking for moc... /usr/local/lib/qt5/bin/moc
[...]

it does not look like it is querying the qtchooser's moc-wrapper at all, as it should be /usr/local/bin/moc then.


mfg Tobias
Comment 4 Mikhail Teterin freebsd_committer 2018-07-13 18:54:21 UTC
(In reply to Tobias C. Berner from comment #3)
Well, it seems to have worked on another machine -- despite there being both mocs installed.

Not sure, what it is specifically, that causes it to pick the wrong one on that box, where originally spotted.
Comment 5 Mikhail Teterin freebsd_committer 2018-07-13 19:02:40 UTC
Created attachment 195118 [details]
Full output of make configure

Here is the full output of `make configure` -- without the proposed changes to Uses/qt.mk.

In particular:

...
checking for moc-qt5... no
checking for moc... /opt/lib/qt5/bin/moc
...
Comment 6 Tobias C. Berner freebsd_committer 2018-07-13 19:22:02 UTC
See also:
https://trac.videolan.org/vlc/ticket/11772
Comment 7 Tobias C. Berner freebsd_committer 2018-07-13 19:37:08 UTC
Created attachment 195119 [details]
suggested fix to multimedia/vlc

Please try the following patch. It basically does the same thing, by pulling in qmake.mk to add additional env-vars for Qt.


mfg Tobias
Comment 8 Mikhail Teterin freebsd_committer 2018-07-13 21:33:48 UTC
Comment on attachment 195119 [details]
suggested fix to multimedia/vlc

Yes, this seems to work, although I'm not sure, if pulling in an entire new .mk is better than adding one more env-variable.

Anyway, thank you and, please, commit whatever fix you feel is best.
Comment 9 Tobias C. Berner freebsd_committer 2018-07-13 21:39:09 UTC
qt.mk is supposed to handle "adding dependencies on Qt components" not "fixing broken configures by adding env-vars".

So either add the MOC= RCC= and so on manually to VLC's Makefile, or pull in qmake.mk to do it for you :)


mfg Tobias
Comment 10 Mikhail Teterin freebsd_committer 2018-07-13 21:41:14 UTC
(In reply to Tobias C. Berner from comment #9)
I spoke too soon. For some reason, your addition causes the port to attempt to perform install at build time...

mi@symbion:ports/multimedia/vlc-qt4 (184) make
===>  Staging for vlc-qt4-2.2.8_6,4
===>   vlc-qt4-2.2.8_6,4 depends on package: ffmpeg>=3.4.1,1 - found
===>   vlc-qt4-2.2.8_6,4 depends on executable: update-desktop-database - found
===>   vlc-qt4-2.2.8_6,4 depends on executable: gtk-update-icon-cache - found
===>   vlc-qt4-2.2.8_6,4 depends on file: /opt/lib/libGL.so - found
===>   vlc-qt4-2.2.8_6,4 depends on file: /opt/libdata/pkgconfig/xcb.pc - found
===>   vlc-qt4-2.2.8_6,4 depends on file: /opt/libdata/pkgconfig/xproto.pc - found
===>   Generating temporary packing list
gmake[2]: Entering directory '/symbion/ports/multimedia/vlc-qt4/work/vlc-2.2.8'
if test -z 'strip'; then \
  gmake  INSTALL_PROGRAM="/bin/sh /symbion/ports/multimedia/vlc-qt4/work/vlc-2.2.8/autotools/install-sh -c -s" \
    install_sh_PROGRAM="/bin/sh /symbion/ports/multimedia/vlc-qt4/work/vlc-2.2.8/autotools/install-sh -c -s" INSTALL_STRIP_FLAG=-s \
      install; \
else \
  gmake  INSTALL_PROGRAM="/bin/sh /symbion/ports/multimedia/vlc-qt4/work/vlc-2.2.8/autotools/install-sh -c -s" \
    install_sh_PROGRAM="/bin/sh /symbion/ports/multimedia/vlc-qt4/work/vlc-2.2.8/autotools/install-sh -c -s" INSTALL_STRIP_FLAG=-s \
    "INSTALL_PROGRAM_ENV=STRIPPROG='strip'" install; \
fi
gmake[3]: Entering directory '/symbion/ports/multimedia/vlc-qt4/work/vlc-2.2.8'
...
gmake  install-recursive
gmake[4]: Entering directory '/symbion/ports/multimedia/vlc-qt4/work/vlc-2.2.8'
Making install in compat
gmake[5]: Entering directory '/symbion/ports/multimedia/vlc-qt4/work/vlc-2.2.8/compat'
gmake  install-am
gmake[6]: Entering directory '/symbion/ports/multimedia/vlc-qt4/work/vlc-2.2.8/compat'
gmake[7]: Entering directory '/symbion/ports/multimedia/vlc-qt4/work/vlc-2.2.8/compat'
 /bin/mkdir -p '/opt/lib/vlc'
 ../doltlibtool   --mode=install /usr/bin/install -c -s  libcompat.la '/opt/lib/vlc'
libtool: install: /usr/bin/install -c .libs/libcompat.lai /opt/lib/vlc/libcompat.la
install: /opt/lib/vlc/libcompat.la: Read-only file system
gmake[7]: *** [Makefile:1041: install-pkglibLTLIBRARIES] Error 71
...
Comment 11 Tobias C. Berner freebsd_committer 2018-07-13 21:53:55 UTC
That's a shame -- qmake.mk problaby give's too much env-info :( -- like the DESTDIRNAME or the CONFIGURE_ARGS ... 


how about this one:
Index: multimedia/vlc/Makefile
===================================================================
--- multimedia/vlc/Makefile     (revision 474596)
+++ multimedia/vlc/Makefile     (working copy)
@@ -242,7 +242,8 @@
 # QT_CFLAGS:   pkg-config --cflags "QtCore QtGui >= 4.6.0"
 # QT_LIBS:     pkg-config --libs "QtCore QtGui >= 4.6.0"
 QT4_CONFIGURE_ENV=     QT_CFLAGS="-I${QT_INCDIR}/QtGui -DQT_SHARED -I${QT_INCDIR} -I${QT_INCDIR}/QtCore" \
-                       QT_LIBS="-lQtGui -L${QT_LIBDIR} -lQtCore"
+                       QT_LIBS="-lQtGui -L${QT_LIBDIR} -lQtCore" \
+                       MOC="${MOC}" RCC="${RCC}" UIC="${UIC}"

 QT5_USES=      qt:5
 QT5_USE=               QT=gui,core,widgets,x11extras,buildtools_build
Comment 12 Mikhail Teterin freebsd_committer 2018-07-13 22:02:38 UTC
(In reply to Tobias C. Berner from comment #11)
> QT4_CONFIGURE_ENV=     QT_CFLAGS="-I${QT_INCDIR}/QtGui -DQT_SHARED -I${QT_INCDIR} -I${QT_INCDIR}/QtCore" \
> -                       QT_LIBS="-lQtGui -L${QT_LIBDIR} -lQtCore"
> +                       QT_LIBS="-lQtGui -L${QT_LIBDIR} -lQtCore" \
> +                       MOC="${MOC}" RCC="${RCC}" UIC="${UIC}"

Should work, but, I'd say, this should be added to QT5_CONFIGURE_ENV too. Or just always add it to CONFIGURE_ENV, whether or not any QT is requested....
Comment 13 Thomas Zander freebsd_committer 2018-07-15 19:02:59 UTC
FYI:
I am trying to update vlc to 3.x in the near future[tm].
Just waiting for some work on v4l for that, see https://reviews.freebsd.org/D14842 and https://reviews.freebsd.org/D16121.

Upstream vlc has abandoned support for qt4.
Comment 14 Adriaan de Groot freebsd_committer 2018-08-31 20:29:36 UTC
I bumped into this today as well. How about a CONFLICTS_BUILD? That would at least stop things early, without needing to dig into the configure mechanics exactly. (And, as Thomas points out, this is a problem that is going away anyway by dropping Qt4 support)
Comment 15 Thomas Zander freebsd_committer 2019-01-11 17:16:41 UTC
qt4 support has been deprecated with the retirement of vlc 2.x on 2018-12-31