diff --git a/multimedia/VLC2/Portfile b/multimedia/VLC2/Portfile index c6f1f8416ed93..d03eafa37d09c 100644 --- a/multimedia/VLC2/Portfile +++ b/multimedia/VLC2/Portfile @@ -223,6 +223,14 @@ if {(${subport} eq ${name}) || (${subport} eq "lib${name}")} { # Make 10.12 and later ignore all QTKit code in modules/gui/macosx/open.m patchfiles-append patch-really-no-qtkit.diff + # Only needed on < 10.6, since kCFNetworkProxiesHTTP* and AudioComponent* + # are unavailable. We fall back to an earlier code. + if {${os.platform} eq "darwin" && ${os.major} < 10} { + patchfiles-append \ + patch-AudioComponent.diff \ + patch-SystemConfiguration.diff + } + if {![info exists replaced_by]} { post-patch { if {[string match *clang* ${configure.cxx}] && ${configure.cxx_stdlib} == "libc++"} { @@ -371,6 +379,12 @@ if {(${subport} eq ${name}) || (${subport} eq "lib${name}")} { --enable-bonjour \ --enable-upnp + # Screen module uses CGDisplayCreateImageForRect which exists in 10.6+: + if {${os.platform} eq "darwin" && ${os.major} < 10} { + configure.args-append \ + --disable-screen + } + platform macosx { # taken from VLC's own configure.sh script for OS X: configure.args-replace --disable-realrtsp --enable-realrtsp diff --git a/multimedia/VLC2/files/patch-AudioComponent.diff b/multimedia/VLC2/files/patch-AudioComponent.diff new file mode 100644 index 0000000000000..5465c666c6179 --- /dev/null +++ b/multimedia/VLC2/files/patch-AudioComponent.diff @@ -0,0 +1,45 @@ +--- modules/audio_output/auhal.c 2015-10-22 00:10:00 ++++ modules/audio_output/auhal.c 2024-10-12 00:07:55 +@@ -91,7 +91,7 @@ + TPCircularBuffer circular_buffer; /* circular buffer to swap the audio data */ + + /* AUHAL specific */ +- AudioComponent au_component; /* The AudioComponent we use */ ++ Component au_component; /* The AudioComponent we use */ + AudioUnit au_unit; /* The AudioUnit we use */ + + /* CoreAudio SPDIF mode specific */ +@@ -488,7 +488,7 @@ + OSStatus err = noErr; + UInt32 i_param_size = 0; + int i_original; +- AudioComponentDescription desc; ++ ComponentDescription desc; + AudioStreamBasicDescription DeviceFormat; + AudioChannelLayout *layout; + AURenderCallbackStruct input; +@@ -505,13 +505,13 @@ + desc.componentFlags = 0; + desc.componentFlagsMask = 0; + +- p_sys->au_component = AudioComponentFindNext(NULL, &desc); ++ p_sys->au_component = FindNextComponent(NULL, &desc); + if (p_sys->au_component == NULL) { + msg_Err(p_aout, "cannot find any HAL component, PCM output failed"); + return false; + } + +- err = AudioComponentInstanceNew(p_sys->au_component, &p_sys->au_unit); ++ err = OpenAComponent(p_sys->au_component, &p_sys->au_unit); + if (err != noErr) { + msg_Err(p_aout, "cannot open HAL component, PCM output failed [%4.4s]", (char *)&err); + return false; +@@ -1112,7 +1112,7 @@ + if (p_sys->au_unit) { + verify_noerr(AudioOutputUnitStop(p_sys->au_unit)); + verify_noerr(AudioUnitUninitialize(p_sys->au_unit)); +- verify_noerr(AudioComponentInstanceDispose(p_sys->au_unit)); ++ verify_noerr(CloseComponent(p_sys->au_unit)); + } + + if (p_sys->b_digital) { diff --git a/multimedia/VLC2/files/patch-SystemConfiguration.diff b/multimedia/VLC2/files/patch-SystemConfiguration.diff new file mode 100644 index 0000000000000..4dd0411ad1c39 --- /dev/null +++ b/multimedia/VLC2/files/patch-SystemConfiguration.diff @@ -0,0 +1,105 @@ +--- configure.ac ++++ configure.ac 2024-10-11 19:59:30 +@@ -163,7 +163,7 @@ + OBJCFLAGS="${OBJCFLAGS} -D_INTL_REDIRECT_MACROS -std=gnu99" + LDFLAGS="${LDFLAGS} -Wl,-headerpad_max_install_names" + VLC_ADD_LIBS([libvlc vlc],[-Wl,-undefined,dynamic_lookup,-framework,AppKit]) +- VLC_ADD_LIBS([libvlccore],[-Wl,-framework,CoreFoundation,-framework,CoreServices]) ++ VLC_ADD_LIBS([libvlccore],[-Wl,-framework,CoreFoundation,-framework,CoreServices,-framework,SystemConfiguration]) + + AC_EGREP_CPP(yes, + [#import + +--- src/darwin/netconf.c ++++ src/darwin/netconf.c 2024-10-11 17:09:51 +@@ -28,13 +28,12 @@ + #include + #include + +-#include +- + #import ++#include + #if TARGET_OS_IPHONE + #include + #else +-#include ++#include + #endif + + /** +@@ -45,6 +44,7 @@ + char *vlc_getProxyUrl(const char *url) + { + VLC_UNUSED(url); ++#if TARGET_OS_IPHONE + char *proxy_url = NULL; + CFDictionaryRef dicRef = CFNetworkCopySystemProxySettings(); + if (NULL != dicRef) { +@@ -64,6 +64,7 @@ + if (CFStringGetCString(proxyCFstr, host_buffer, sizeof(host_buffer) + - 1, kCFStringEncodingUTF8)) { + char buffer[4096]; ++ memset(host_buffer, 0, sizeof(host_buffer)); + sprintf(buffer, "%s:%d", host_buffer, port); + proxy_url = strdup(buffer); + } +@@ -73,4 +74,58 @@ + } + + return proxy_url; ++#else ++ CFDictionaryRef proxies = SCDynamicStoreCopyProxies(NULL); ++ char *proxy_url = NULL; ++ ++ if (proxies) { ++ CFNumberRef cfn_httpProxyOn = ++ (CFNumberRef)CFDictionaryGetValue(proxies, ++ kSCPropNetProxiesHTTPEnable); ++ if (cfn_httpProxyOn) { ++ int i_httpProxyOn; ++ CFNumberGetValue(cfn_httpProxyOn, kCFNumberIntType, &i_httpProxyOn); ++ CFRelease(cfn_httpProxyOn); ++ ++ if (i_httpProxyOn == 1) // http proxy is on ++ { ++ CFStringRef httpProxy = ++ (CFStringRef)CFDictionaryGetValue(proxies, ++ kSCPropNetProxiesHTTPProxy); ++ ++ if (httpProxy) { ++ CFNumberRef cfn_httpProxyPort = ++ (CFNumberRef)CFDictionaryGetValue(proxies, ++ kSCPropNetProxiesHTTPPort); ++ int i_httpProxyPort; ++ CFNumberGetValue(cfn_httpProxyPort, ++ kCFNumberIntType, ++ &i_httpProxyPort); ++ CFRelease(cfn_httpProxyPort); ++ ++ CFMutableStringRef outputURL = ++ CFStringCreateMutableCopy(kCFAllocatorDefault, ++ 0, ++ httpProxy); ++ if (i_httpProxyPort > 0) ++ CFStringAppendFormat(outputURL, ++ NULL, ++ CFSTR(":%i"), ++ i_httpProxyPort); ++ ++ char buffer[4096]; ++ if (CFStringGetCString(outputURL, buffer, sizeof(buffer), ++ kCFStringEncodingUTF8)) ++ proxy_url = strdup(buffer); ++ ++ CFRelease(outputURL); ++ } ++ CFRelease(httpProxy); ++ } ++ } ++ CFRelease(proxies); ++ } ++ ++ return proxy_url; ++#endif + }