Opened 2 years ago

Closed 2 years ago

Last modified 2 years ago

#53083 closed defect (fixed)

VLC: fails to build on Sierra due to QtKit

Reported by: mkae (Marko Käning) Owned by: mkae (Marko Käning)
Priority: Normal Milestone:
Component: ports Version:
Keywords: sierra Cc: RJVB (René Bertin)
Port: VLC

Description

This rings a bell:

access/qtsound.m:44:9: fatal error: 'QTKit/QTKit.h' file not found
#import <QTKit/QTKit.h>
        ^
../doltlibtool  --tag=CC   --mode=compile /usr/bin/clang -DHAVE_CONFIG_H -I. -I..  -DMODULE_STRING=\"$(p="access/vcd/libcdda_plugin_la-cdrom.lo"; p="${p##*/}"; p="${p#lib}"; p="${p%_plugin*}"; p="${p%.lo}"; echo "$p")\" -D__PLUGIN__  -I./access -I./codec -I../include -I../include -I/opt/local/include -D__unix__=1 -I/opt/local/lib/live/liveMedia/include -I/opt/local/var/macports/build/_opt_bblocal_var_buildworker_ports_build_ports_multimedia_VLC/VLC/work/vlc-2.2.4/contrib/include  -I/opt/local/include -pipe -Os -arch x86_64 -D_INTL_REDIRECT_MACROS -I/opt/local/var/macports/build/_opt_bblocal_var_buildworker_ports_build_ports_multimedia_VLC/VLC/work/vlc-2.2.4/contrib/include -Wall -Wextra -Wsign-compare -Wundef -Wpointer-arith -Wbad-function-cast -Wwrite-strings -Wmissing-prototypes -Wvolatile-register-var -Werror-implicit-function-declaration -pipe -fvisibility=hidden -O3 -ffast-math -funroll-loops -fomit-frame-pointer -MT access/vcd/libcdda_plugin_la-cdrom.lo -MD -MP -MF access/vcd/.deps/libcdda_plugin_la-cdrom.Tpo -c -o access/vcd/libcdda_plugin_la-cdrom.lo `test -f 'access/vcd/cdrom.c' || echo './'`access/vcd/cdrom.c
1 error generated.
make[4]: *** [access/qtsound.lo] Error 1
make[4]: *** Waiting for unfinished jobs....
4 warnings generated.
mv -f stream_filter/.deps/libhttplive_plugin_la-httplive.Tpo stream_filter/.deps/libhttplive_plugin_la-httplive.Plo
libtool: compile:  /usr/bin/clang -DHAVE_CONFIG_H -I. -I.. -DMODULE_STRING=\"qtcapture\" -D__PLUGIN__ -I./access -I./codec -I../include -I../include -I/opt/local/include -D__unix__=1 -I/opt/local/lib/live/liveMedia/include -I/opt/local/var/macports/build/_opt_bblocal_var_buildworker_ports_build_ports_multimedia_VLC/VLC/work/vlc-2.2.4/contrib/include -pipe -Os -arch x86_64 -D_INTL_REDIRECT_MACROS -std=gnu99 -I/opt/local/var/macports/build/_opt_bblocal_var_buildworker_ports_build_ports_multimedia_VLC/VLC/work/vlc-2.2.4/contrib/include -fvisibility=hidden -O3 -ffast-math -funroll-loops -fomit-frame-pointer -MT access/qtcapture.lo -MD -MP -MF access/.deps/qtcapture.Tpo -c access/qtcapture.m  -fno-common -DPIC -o access/.libs/qtcapture.o
access/qtcapture.m:42:9: fatal error: 'QTKit/QTKit.h' file not found
#import <QTKit/QTKit.h>
        ^
mv -f access/vcd/.deps/libcdda_plugin_la-cdrom.Tpo access/vcd/.deps/libcdda_plugin_la-cdrom.Plo
1 error generated.
make[4]: *** [access/qtcapture.lo] Error 1
8 warnings generated.

We had a similar problem with opencv in #52328.

Attachments (1)

VLC-for-10.12.diff (8.2 KB) - added by RJVB (René Bertin) 2 years ago.
This patch avoids all use of QTKit in open.m on 10.12 and later

Download all attachments as: .zip

Change History (15)

comment:1 Changed 2 years ago by RJVB (René Bertin)

Indeed, I c/should have foreseen this.

Do you have a VM to check if this patch fixes the issue?

diff --git a/multimedia/VLC/Portfile b/multimedia/VLC/Portfile
index 96cd43cb..6d859d84 100644
--- a/multimedia/VLC/Portfile
+++ b/multimedia/VLC/Portfile
@@ -335,8 +335,11 @@ if {(${subport} eq ${name}) || (${subport} eq "lib${name}")} {
         configure.args-replace  --disable-dbus --enable-dbus
     }
 
-    variant qtkit description {Enable qtcapture and qtaudio} {
-        configure.args-replace  --disable-macosx-qtkit --enable-macosx-qtkit
+    if {${os.major} <= 15} {
+        # QTKit was disabled in 10.12 "Sierra"
+        variant qtkit description {Enable qtcapture and qtaudio} {
+            configure.args-replace  --disable-macosx-qtkit --enable-macosx-qtkit
+        }
     }
 
     variant svg description {Enable SVG rendering and decoding support} {
@@ -448,7 +451,10 @@ if {(${subport} eq ${name}) || (${subport} eq "lib${name}")} {
     patchfiles-append           patch-for-lua52.diff
 
     platform macosx {
-        default_variants-append +quartz +qtkit
+        default_variants-append +quartz
+        if {[variant_exists qtkit]} {
+            default_variants-append +qtkit
+        }
 
         configure.args-replace  --disable-macosx-eyetv --enable-macosx-eyetv
 

comment:2 Changed 2 years ago by mkae (Marko Käning)

It's better to attach patches as a file to tickets. One can not only see the diff nicely formatted right away, but with trac-patch also apply it after copying the raw link without additional effort.

comment:3 Changed 2 years ago by mkae (Marko Käning)

Owner: set to mkae
Resolution: fixed
Status: newclosed

In 494466b0/macports-ports:

VLC: fix build on Sierra in analogy to opencv

Thanks, René, for providing a patch!

Closes: #53083

comment:4 Changed 2 years ago by mkae (Marko Käning)

Resolution: fixed
Status: closedreopened

Nope, that's not yet all, as our Sierra buildbot still complains: https://build.macports.org/builders/ports-10.12_x86_64-builder/builds/14962

comment:5 Changed 2 years ago by RJVB (René Bertin)

Damn, I feared something like this might happen :(

I have no time to look into this now. Sucks that (if?) there is no way to provide the 10.11 builds for 10.12, it's quite likely they'll work fine :-/

comment:6 Changed 2 years ago by dbevans (David B. Evans)

The remaining problem is the use of variant_exists. Exists in this case doesn't mean the variant is defined in the port but that the variant is asserted. Will fail on update if the variant is already set in the previously installed version which it was since this was the default.

The default variant should just be declared in the clause that checks that this is not Sierra.

comment:7 Changed 2 years ago by RJVB (René Bertin)

You're not wrong, but the build bots don't have an installed version (AFAIK) - certainly not on 10.12 because the port didn't build there.

comment:8 Changed 2 years ago by RJVB (René Bertin)

The problem is with the open.m file, which implements the file open dialog, and which contains features provided by QtKit. Annoyingly we only have a compiled nib file which describes the actual dialog, so I'll have to tinker around to see if and how this file can build without QtKit...

Changed 2 years ago by RJVB (René Bertin)

Attachment: VLC-for-10.12.diff added

This patch avoids all use of QTKit in open.m on 10.12 and later

comment:9 Changed 2 years ago by RJVB (René Bertin)

Please test this patch on 10.12 (in a VM?) before committing. I have only addressed the issue in open.m and not even looked if there are other locations.

Please, if the build halts again on missing QTKit headers, try to get a log of as many instances as possible by doing something like

(cd `port work VLC`/vlc-2.2.4 ; make -wk 2>&1 > `port logfile VLC`)

(or (cd `port work VLC`/vlc-2.2.4 ; make -wk >& `port logfile VLC`) when using a *csh shell).

comment:10 Changed 2 years ago by mkae (Marko Käning)

Resolution: fixed
Status: reopenedclosed

In 50fa06dd/macports-ports:

VLC: fix build on Sierra in analogy to opencv

Thanks, René, for providing a patch!

Closes: #53083

comment:11 Changed 2 years ago by mkae (Marko Käning)

In 645127ac/macports-ports:

VLC: fix build on Sierra

Closes: #53083

comment:12 Changed 2 years ago by mkae (Marko Käning)

So, the Sierra buildbot is finally happy and caught only warnings now.

comment:13 Changed 2 years ago by dbevans (David B. Evans)

I haven't had an opportunity to test VLC on Sierra as yet (that machine is otherwise busy) but does this patch actually work after building? As I understand it the patch just removes references to QTKit in open.m without making any suitable replacement.

Perhaps a more rigorous fix would be to port open.m from QTKit to AVFoundation which is the recommended replacement on Sierra. This has been done recently in upstream VLC master although it hasn't been backported to the 2.2 maintenance branch. See https://git.videolan.org/?p=vlc.git;a=commitdiff;h=183373239d8ab567c2a2f014c88b93b461e08b35

There's been a lot of water under the bridge between our 2.2.x version and master but at least this might serve as a guide on how to proceed.

comment:14 Changed 2 years ago by RJVB (René Bertin)

Evidently I tested the patch locally. On 10.9, but the principle of stripping QtKit from the file dialog should have the same effects everywhere.

If someone feels like backporting the QTKit->AVF conversion to 2.2.x, by all means go ahead and I'll even test it. But I'm not going to do this myself.

Frankly, I couldn't even determine exactly what was missing from the dialog when I tried it.

Note: See TracTickets for help on using tickets.