4 | | PortSystem 1.0 |
5 | | PortGroup compiler_blacklist_versions 1.0 |
6 | | PortGroup active_variants 1.1 |
7 | | |
8 | | # TODO |
9 | | # if {[file exists ${prefix}/etc/macports/locales.tcl]} { |
10 | | # # experimental feature to cut down the NLS/locale files, which take up over 50% of |
11 | | # # the install footprint for VLC. This feature loads the locale_select PortGroup |
12 | | # # if its configuration file exist; a variant is then added which prunes all translations from |
13 | | # # ${destroot}${prefix}/share/locale except those whitelisted in etc/macports/locales.tcl . |
14 | | # PortGroup locale_select 1.0 |
15 | | # } |
16 | | |
17 | | name VLC |
18 | | version 2.2.2 |
19 | | revision 4 |
20 | | |
21 | | categories multimedia devel |
22 | | maintainers nomaintainer |
23 | | |
24 | | description VLC is a cross-platform media player and streaming server |
25 | | long_description VLC media player is a highly portable multimedia player for \ |
26 | | various audio and video formats (MPEG-1, MPEG-2, MPEG-4, DivX, \ |
27 | | mp3, ogg, ...) as well as DVDs, VCDs, and various streaming protocols. \ |
28 | | It can also be used as a server to stream in unicast or multicast \ |
29 | | in IPv4 or IPv6 on a high-bandwidth network. |
| 4 | PortSystem 1.0 |
| 5 | PortGroup compiler_blacklist_versions 1.0 |
| 6 | PortGroup active_variants 1.1 |
| 7 | PortGroup conflicts_build 1.0 |
31 | | homepage http://www.videolan.org |
| 9 | if {[file exists ${prefix}/etc/macports/locales.tcl]} { |
| 10 | # experimental feature to cut down the NLS/locale files, which take up over 50% of |
| 11 | # the install footprint for VLC. This feature loads the locale_select PortGroup |
| 12 | # if its configuration file exist; a variant is then added which prunes all translations from |
| 13 | # ${destroot}${prefix}/share/locale except those whitelisted in etc/macports/locales.tcl . |
| 14 | PortGroup locale_select 1.0 |
| 15 | } |
| 16 | |
| 17 | name VLC |
| 18 | |
| 19 | categories multimedia devel |
| 20 | maintainers gmail.com:rjvbertin openmaintainer |
| 21 | |
| 22 | description VLC is a cross-platform media player and streaming server |
| 23 | long_description VLC media player is a highly portable multimedia player for \ |
| 24 | various audio and video formats (MPEG-1, MPEG-2, MPEG-4, DivX, \ |
| 25 | mp3, ogg, ...) as well as DVDs, VCDs, and various streaming protocols. \ |
| 26 | It can also be used as a server to stream in unicast or multicast \ |
| 27 | in IPv4 or IPv6 on a high-bandwidth network. |
| 28 | |
| 29 | homepage http://www.videolan.org |
51 | | master_sites http://download.videolan.org/pub/videolan/vlc/${version}/ |
52 | | distname vlc-${version} |
53 | | use_xz yes |
54 | | |
55 | | checksums rmd160 ff302536334622427e06250457c74f061d4329f8 \ |
56 | | sha256 9ad23128be16f9b40ed772961272cb0748ed8e4aa1bc79c129e589feebea5fb5 |
57 | | |
58 | | # Enable HFS compression. |
59 | | depends_extract-append port:libarchive |
60 | | extract.post_args "| bsdtar -x --hfsCompression" |
61 | | |
62 | | depends_build port:pkgconfig |
63 | | |
64 | | depends_lib port:a52dec \ |
65 | | port:avahi \ |
66 | | port:bzip2 \ |
67 | | port:faad2 \ |
68 | | path:lib/libavcodec.dylib:ffmpeg \ |
69 | | port:flac \ |
70 | | port:fluidsynth \ |
71 | | port:fontconfig \ |
72 | | port:freetype \ |
73 | | port:fribidi \ |
74 | | port:gettext \ |
75 | | path:lib/pkgconfig/glib-2.0.pc:glib2 \ |
76 | | port:gmp \ |
77 | | port:gnutls \ |
78 | | port:jpeg \ |
79 | | port:lame \ |
80 | | port:libass \ |
81 | | port:libbluray \ |
82 | | port:libcddb \ |
83 | | port:libcdio \ |
84 | | port:libdc1394 \ |
85 | | port:libdca \ |
86 | | port:libdvbpsi \ |
87 | | port:libdvdnav \ |
88 | | port:libdvdread \ |
89 | | port:libebml \ |
90 | | port:libgcrypt \ |
91 | | port:libgpg-error \ |
92 | | port:libiconv \ |
93 | | port:libid3tag \ |
94 | | port:libidn \ |
95 | | port:libmad \ |
96 | | port:libmatroska \ |
97 | | port:libmodplug \ |
98 | | port:libmpcdec \ |
99 | | port:libmpeg2 \ |
100 | | port:libmtp \ |
101 | | port:libogg \ |
102 | | port:libopus \ |
103 | | port:libpng \ |
104 | | port:libproxy \ |
105 | | port:libsamplerate \ |
106 | | port:libsdl \ |
107 | | port:libsdl_image \ |
108 | | port:libsndfile \ |
109 | | port:libssh2 \ |
110 | | port:libtheora \ |
111 | | port:libupnp \ |
112 | | port:libusb \ |
113 | | port:libvorbis \ |
114 | | port:libvpx \ |
115 | | port:libxml2 \ |
116 | | port:live555 \ |
117 | | port:ncurses \ |
118 | | port:nettle \ |
119 | | port:opencv \ |
120 | | port:openjpeg15 \ |
121 | | path:lib/libssl.dylib:openssl \ |
122 | | port:orc \ |
123 | | port:p11-kit \ |
124 | | port:readline \ |
125 | | port:schroedinger \ |
126 | | port:speex \ |
127 | | port:taglib \ |
128 | | port:tiff \ |
129 | | port:twolame \ |
130 | | port:vcdimager \ |
131 | | port:x264 \ |
132 | | port:x265 |
133 | | |
134 | | # the +qt5 and/or +qt4 variants of port:opencv currently lead to build errors |
135 | | pre-configure { |
136 | | if {![active_variants opencv "" {qt4 qt5}]} { |
137 | | ui_error "${subport} cannot currently be built against port:opencv with the qt4 or qt5 variant.\ |
138 | | Install port:opencv without either qt variant and try again. This is only a build conflict; \ |
139 | | after building you can reactivate your preferred opencv variant" |
140 | | return -code error "Install or activate port:opencv without a qt variant before building ${subport}" |
| 75 | depends_build port:pkgconfig |
| 76 | |
| 77 | depends_lib path:${FFMPEG_VLC_PREFIX}/lib/libavcodec.dylib:ffmpeg-VLC \ |
| 78 | port:a52dec \ |
| 79 | port:avahi \ |
| 80 | port:bzip2 \ |
| 81 | port:faad2 \ |
| 82 | port:flac \ |
| 83 | port:fluidsynth \ |
| 84 | port:fontconfig \ |
| 85 | port:freetype \ |
| 86 | port:fribidi \ |
| 87 | port:gettext \ |
| 88 | path:lib/pkgconfig/glib-2.0.pc:glib2 \ |
| 89 | port:gmp \ |
| 90 | port:gnutls \ |
| 91 | port:jpeg \ |
| 92 | port:lame \ |
| 93 | port:libass \ |
| 94 | port:libbluray \ |
| 95 | port:libcddb \ |
| 96 | port:libcdio \ |
| 97 | port:libdc1394 \ |
| 98 | port:libdca \ |
| 99 | port:libdvbpsi \ |
| 100 | port:libdvdnav \ |
| 101 | port:libdvdread \ |
| 102 | port:libebml \ |
| 103 | port:libgcrypt \ |
| 104 | port:libgpg-error \ |
| 105 | port:libiconv \ |
| 106 | port:libid3tag \ |
| 107 | port:libidn \ |
| 108 | port:libmad \ |
| 109 | port:libmatroska \ |
| 110 | port:libmodplug \ |
| 111 | port:libmpcdec \ |
| 112 | port:libmpeg2 \ |
| 113 | port:libmtp \ |
| 114 | port:libogg \ |
| 115 | port:libopus \ |
| 116 | port:libpng \ |
| 117 | port:libproxy \ |
| 118 | port:libsamplerate \ |
| 119 | port:libsdl \ |
| 120 | port:libsdl_image \ |
| 121 | port:libsndfile \ |
| 122 | port:libssh2 \ |
| 123 | port:libtheora \ |
| 124 | port:libupnp \ |
| 125 | port:libusb \ |
| 126 | port:libvorbis \ |
| 127 | port:libvpx \ |
| 128 | port:libxml2 \ |
| 129 | port:live555 \ |
| 130 | port:ncurses \ |
| 131 | port:nettle \ |
| 132 | port:openjpeg15 \ |
| 133 | path:lib/libssl.dylib:openssl \ |
| 134 | port:orc \ |
| 135 | port:p11-kit \ |
| 136 | port:readline \ |
| 137 | port:schroedinger \ |
| 138 | port:speex \ |
| 139 | port:taglib \ |
| 140 | port:tiff \ |
| 141 | port:twolame \ |
| 142 | port:vcdimager \ |
| 143 | port:x264 \ |
| 144 | port:x265 |
| 145 | |
| 146 | pre-fetch { |
| 147 | if {${os.platform} eq "darwin" && ${os.major} < 10} { |
| 148 | ui_error "${name} ${version} requires Mac OS X 10.6 or greater." |
| 149 | return -code error "incompatible Mac OS X version" |
| 150 | } |
144 | | # VLC 2.2.2 should have full Lua 5.3 compatibility, for now, depend on port:lua52 |
145 | | # That requires the patch-for-lua52.diff which is appended to patchfiles below. |
146 | | # update 2.2.2 : lua 5.3 gives compiler syntax errors so we stick with 5.2 for now. |
147 | | depends_lib-append port:lua52 |
148 | | # depends_lib-append port:lua |
| 153 | # port:opencv depends on port:ffmpeg and thus enters in conflict with us depending on our own ffmpeg build |
| 154 | # 1 viable solution as long as this is the case: drop the opencv filter. |
| 155 | # depends_lib-append port:opencv |
| 156 | # # the +qt5 and/or +qt4 variants of port:opencv currently lead to build errors. A patch has |
| 157 | # # been submitted (but not included) that resolves the issue for qt4, not yet for qt5. |
| 158 | # # https://trac.macports.org/ticket/50709 |
| 159 | # # For regular users a single check in the pre-fetch would suffice, but this maintainer |
| 160 | # # needs the check at other opportune moments too. |
| 161 | # proc check_opencv {} { |
| 162 | # global subport |
| 163 | # if {![active_variants opencv "" {qt4 qt5}]} { |
| 164 | # ui_error "${subport} cannot currently be built against port:opencv with the qt5 variant.\ |
| 165 | # Install port:opencv without that variant and try again. This is only a build conflict; \ |
| 166 | # after building you can reactivate your preferred opencv variant" |
| 167 | # return -code error "Install or activate port:opencv without the qt5 variant before building ${subport}" |
| 168 | # } |
| 169 | # } |
| 170 | # pre-fetch { |
| 171 | # check_opencv |
| 172 | # } |
| 173 | # pre-configure { |
| 174 | # check_opencv |
| 175 | # } |
| 176 | # pre-build { |
| 177 | # check_opencv |
| 178 | # } |
| 179 | # patchfiles-append patch-opencv_includes.diff |
| 180 | # # The opencv example apparently builds on 10.11 but I'm having issues with it on 10.9 |
| 181 | # # it doesn't appear to be indispensable, so simply skip it. |
| 182 | # patchfiles-append patch-no-opencv_example.diff |
| 183 | |
| 184 | # VLC 2.2.2 should have full Lua 5.3 compatibility, for now, depend on port:lua52 |
| 185 | # That requires the patch-for-lua52.diff which is appended to patchfiles below. |
| 186 | # update 2.2.2 : lua 5.3 gives compiler syntax errors so we stick with 5.2 for now. |
| 187 | depends_lib-append port:lua52 |
| 188 | # depends_lib-append port:lua |
| 189 | |
| 190 | # VLC doesn't currently build for me using port:clang-3.8 |
| 191 | compiler.blacklist-append \ |
| 192 | gcc-4.2 llvm-gcc-4.2 macports-clang-3.8 {clang < 300} |
| 193 | |
| 194 | patchfiles buildfix-package.mak.patch \ |
| 195 | configure.ac-no-arch.patch \ |
| 196 | PR-34741-no__clang_version__.patch \ |
| 197 | static_assert.patch \ |
| 198 | no-sparkle.patch \ |
| 199 | patch-vlc-no-O4.diff |
154 | | compiler.blacklist gcc-4.2 llvm-gcc-4.2 {clang < 300} |
| 205 | if {[string match *clang* ${configure.cxx}] && ${configure.cxx_stdlib} == "libc++"} { |
| 206 | reinplace "s:-lstdc\+\+:-lc++:" \ |
| 207 | ${worksrcpath}/configure.ac \ |
| 208 | ${worksrcpath}/modules/access/Makefile.am |
| 209 | } |
| 210 | # patch source using ffmpeg to use the correct header file locations |
| 211 | foreach dir {libavcodec libavformat libavresample libavutil libpostproc libswresample libswscale} { |
| 212 | foreach module {access codec/avcodec demux/avformat hw/vdpau packetizer video_chroma} { |
| 213 | foreach cf [glob -nocomplain ${worksrcpath}/modules/${module}/*.c] { |
| 214 | reinplace "s|${dir}/|${dir}-VLC/|g" ${cf} |
| 215 | } |
| 216 | foreach cf [glob -nocomplain ${worksrcpath}/modules/${module}/*.h] { |
| 217 | reinplace "s|${dir}/|${dir}-VLC/|g" ${cf} |
| 218 | } |
| 219 | } |
| 220 | reinplace "s|libpostproc/|libpostproc-VLC/|g" ${worksrcpath}/modules/video_filter/postproc.c |
| 221 | reinplace "s|${dir}/|${dir}-VLC/|g" ${worksrcpath}/configure.ac ${worksrcpath}/configure |
| 222 | reinplace "s|HAVE_LIBAVUTIL_AV|HAVE_LIBAVUTIL_VLC_AV|g" \ |
| 223 | ${worksrcpath}/modules/codec/avcodec/avcommon.h \ |
| 224 | ${worksrcpath}/modules/codec/avcodec/avcommon_compat.h |
| 225 | reinplace "s|HAVE_LIBAVFORMAT_AV|HAVE_LIBAVFORMAT_VLC_AV|g" \ |
| 226 | ${worksrcpath}/modules/codec/avcodec/avcommon.h \ |
| 227 | ${worksrcpath}/modules/codec/avcodec/avcommon_compat.h |
| 228 | reinplace "s|HAVE_LIBAVCODEC_AV|HAVE_LIBAVCODEC_VLC_AV|g" \ |
| 229 | ${worksrcpath}/modules/codec/avcodec/avcommon.h \ |
| 230 | ${worksrcpath}/modules/codec/avcodec/avcommon_compat.h |
| 231 | reinplace "s|HAVE_LIBSWSCALE_SW|HAVE_LIBSWSCALE_VLC_SW|g" \ |
| 232 | ${worksrcpath}/modules/codec/avcodec/avcommon.h \ |
| 233 | ${worksrcpath}/modules/codec/avcodec/avcommon_compat.h |
| 234 | } |
| 235 | } |
| 236 | post-configure { |
| 237 | system -W ${worksrcpath} "patch -Np0 -i ${filespath}/patch-static_assert.diff" |
| 238 | } |
156 | | pre-fetch { |
157 | | if {${os.platform} eq "darwin" && ${os.major} < 10} { |
158 | | ui_error "${name} ${version} requires Mac OS X 10.6 or greater." |
159 | | return -code error "incompatible Mac OS X version" |
| 240 | use_autoreconf yes |
| 241 | autoreconf.cmd ./bootstrap |
| 242 | autoreconf.pre_args |
| 243 | autoreconf.args |
| 244 | depends_build-append port:libtool port:autoconf port:automake |
| 245 | |
| 246 | configure.env-append \ |
| 247 | CXXCPP="${configure.cxx} -E" |
| 248 | # splice in ffmpeg-VLC's pkgconfig path, hoping that PKG_CONFIG_PATH hasn't been set by anyone else |
| 249 | configure.env-append \ |
| 250 | PKG_CONFIG_PATH=${FFMPEG_VLC_PREFIX}/lib/pkgconfig |
| 251 | build.args-append DESTDIR=${worksrcpath}/dest_ignore V=1 |
| 252 | |
| 253 | # gl.c:121:3: error: Platform not recognized. |
| 254 | configure.cppflags-append -D__unix__=1 |
| 255 | |
| 256 | # live555 is installed to a weird location |
| 257 | configure.cppflags-append -I${prefix}/lib/live/liveMedia/include |
| 258 | |
| 259 | build.target all |
| 260 | destroot.target install |
| 261 | |
| 262 | livecheck.url http://download.videolan.org/pub/videolan/vlc/ |
| 263 | livecheck.regex <a href=\"(\\d\[\\d|\.|\\w\]+).*/\"> |
| 264 | |
| 265 | # Other |
| 266 | configure.args-append \ |
| 267 | --with-contrib=${worksrcpath}/contrib \ |
| 268 | --disable-debug --disable-update-check --enable-gnutls \ |
| 269 | --disable-notify --disable-dbus --enable-lua \ |
| 270 | --disable-gnomevfs --disable-growl --disable-macosx-vlc-app |
| 271 | |
| 272 | # Input Plugins |
| 273 | configure.args-append \ |
| 274 | --enable-dvdnav --enable-dvdread --disable-smbclient --enable-vcdx \ |
| 275 | --disable-macosx-qtkit --disable-macosx-eyetv --disable-realrtsp \ |
| 276 | --disable-freerdp --disable-opencv --enable-sftp |
| 277 | |
| 278 | # Mux/Demux Plugins |
| 279 | configure.args-append \ |
| 280 | --enable-dvbpsi --enable-ogg --enable-mux_ogg \ |
| 281 | --enable-mkv --enable-mod --enable-mpc --disable-shout |
| 282 | |
| 283 | # Codec Plugins |
| 284 | configure.args-append \ |
| 285 | --enable-a52 --enable-faad --enable-flac --enable-live555 \ |
| 286 | --enable-opus --enable-vorbis --enable-ogg --enable-mad --enable-libass \ |
| 287 | --enable-dca --enable-png --disable-quicktime --enable-twolame \ |
| 288 | --enable-speex --enable-theora --enable-x264 --enable-x265 --enable-postproc \ |
| 289 | --disable-gst-decode --enable-avcodec --enable-avformat --enable-swscale \ |
| 290 | --disable-fluidsynth --enable-schroedinger --enable-vpx |
| 291 | |
| 292 | # Video Plugins. We do our best to deactivate X11 and disable its auto-detection by |
| 293 | # claiming the headers and libs are somewhere they're not. |
| 294 | configure.args-append \ |
| 295 | --disable-caca --enable-sdl --enable-sdl-image \ |
| 296 | --without-x --disable-xcb --disable-xvideo \ |
| 297 | --x-includes=${destroot} --x-libraries=${destroot} \ |
| 298 | --enable-freetype --enable-fontconfig --enable-fribidi \ |
| 299 | --disable-svg --disable-svgdec |
| 300 | |
| 301 | # Audio Plugins |
| 302 | configure.args-append \ |
| 303 | --disable-jack \ |
| 304 | --enable-samplerate \ |
| 305 | --disable-pulse \ |
| 306 | --disable-chromaprint |
| 307 | |
| 308 | # Interface Plugins |
| 309 | configure.args-append \ |
| 310 | --disable-macosx \ |
| 311 | --disable-macosx-dialog-provider \ |
| 312 | --disable-qt \ |
| 313 | --enable-ncurses \ |
| 314 | --disable-skins2 \ |
| 315 | --disable-vnc |
| 316 | |
| 317 | # Visualisations and Video Filter Plugins |
| 318 | configure.args-append \ |
| 319 | --disable-goom |
| 320 | |
| 321 | # Service Discovery Plugins |
| 322 | configure.args-append \ |
| 323 | --enable-bonjour \ |
| 324 | --enable-upnp |
| 325 | |
| 326 | # 20150209: Jack really would require a newer variant than what's currently in MacPorts |
| 327 | variant jack description {Enable jack and fluidsynth plugins for audio output} { |
| 328 | depends_lib-append port:jack port:fluidsynth port:portaudio |
| 329 | configure.args-delete --disable-jack --disable-fluidsynth |
| 330 | configure.args-append --enable-jack --enable-fluidsynth |
163 | | patchfiles buildfix-package.mak.patch \ |
164 | | configure.ac-no-arch.patch \ |
165 | | PR-34741-no__clang_version__.patch \ |
166 | | static_assert.patch \ |
167 | | no-sparkle.patch \ |
168 | | patch-vlc-no-O4.diff \ |
169 | | patch-opencv_includes.diff |
170 | | |
171 | | # The opencv example apparently builds on 10.11 but I'm having issues with it on 10.9 |
172 | | # it doesn't appear to be indispensable, so simply skip it. |
173 | | patchfiles-append patch-no-opencv_example.diff |
174 | | |
175 | | post-patch { |
176 | | reinplace "s:librsvg-2/librsvg:librsvg:" \ |
177 | | ${worksrcpath}/modules/text_renderer/svg.c |
178 | | |
179 | | if {[string match *clang* ${configure.cxx}] && ${configure.cxx_stdlib} == "libc++"} { |
180 | | reinplace "s:-lstdc\+\+:-lc++:" \ |
181 | | ${worksrcpath}/configure.ac \ |
182 | | ${worksrcpath}/modules/access/Makefile.am |
| 333 | variant dbus description {Enable DBus support} { |
| 334 | depends_lib-append port:dbus |
| 335 | configure.args-replace --disable-dbus --enable-dbus |
186 | | use_autoreconf yes |
187 | | autoreconf.cmd ./bootstrap |
188 | | autoreconf.pre_args |
189 | | autoreconf.args |
190 | | depends_build-append port:libtool port:autoconf port:automake |
191 | | |
192 | | configure.env-append CXXCPP="${configure.cxx} -E" |
193 | | build.args-append DESTDIR=${worksrcpath}/dest_ignore V=1 |
194 | | |
195 | | # gl.c:121:3: error: Platform not recognized. |
196 | | configure.cppflags-append -D__unix__=1 |
197 | | |
198 | | # live555 is installed to a weird location |
199 | | configure.cppflags-append -I${prefix}/lib/live/liveMedia/include |
200 | | |
201 | | build.target all |
202 | | destroot.target install |
203 | | |
204 | | livecheck.url http://download.videolan.org/pub/videolan/vlc/ |
205 | | livecheck.regex <a href=\"(\\d\[\\d|\.|\\w\]+).*/\"> |
206 | | |
207 | | # Other |
208 | | configure.args-append \ |
209 | | --with-contrib=${worksrcpath}/contrib \ |
210 | | --disable-debug --disable-update-check --enable-gnutls \ |
211 | | --disable-notify --disable-dbus --enable-lua \ |
212 | | --disable-gnomevfs --disable-growl --disable-macosx-vlc-app |
213 | | |
214 | | # Input Plugins |
215 | | configure.args-append \ |
216 | | --enable-dvdnav --enable-dvdread --disable-smbclient --enable-vcdx \ |
217 | | --disable-macosx-qtkit --disable-macosx-eyetv --disable-realrtsp \ |
218 | | --disable-freerdp --enable-opencv --enable-sftp |
219 | | |
220 | | # Mux/Demux Plugins |
221 | | configure.args-append \ |
222 | | --enable-dvbpsi --enable-ogg --enable-mux_ogg \ |
223 | | --enable-mkv --enable-mod --enable-mpc --disable-shout |
224 | | |
225 | | # Codec Plugins |
226 | | configure.args-append \ |
227 | | --enable-a52 --enable-faad --enable-flac --enable-live555 \ |
228 | | --enable-opus --enable-vorbis --enable-ogg --enable-mad --enable-libass \ |
229 | | --enable-dca --enable-png --disable-quicktime --enable-twolame \ |
230 | | --enable-speex --enable-theora --enable-x264 --enable-x265 --enable-postproc \ |
231 | | --disable-gst-decode --enable-avcodec --enable-avformat --enable-swscale \ |
232 | | --disable-fluidsynth --enable-schroedinger --enable-vpx |
233 | | |
234 | | # Video Plugins. We do our best to deactivate X11 and disable its auto-detection by |
235 | | # claiming the headers and libs are somewhere they're not. |
236 | | configure.args-append \ |
237 | | --disable-caca --enable-sdl --enable-sdl-image \ |
238 | | --without-x --disable-xcb --disable-xvideo \ |
239 | | --x-includes=${destroot} --x-libraries=${destroot} \ |
240 | | --enable-freetype --enable-fontconfig --enable-fribidi \ |
241 | | --disable-svg --disable-svgdec |
242 | | |
243 | | # Audio Plugins |
244 | | configure.args-append \ |
245 | | --disable-jack \ |
246 | | --enable-samplerate \ |
247 | | --disable-pulse \ |
248 | | --disable-chromaprint |
249 | | |
250 | | # Interface Plugins |
251 | | configure.args-append \ |
252 | | --disable-macosx \ |
253 | | --disable-macosx-dialog-provider \ |
254 | | --disable-qt \ |
255 | | --enable-ncurses \ |
256 | | --disable-skins2 \ |
257 | | --disable-vnc |
258 | | |
259 | | # Visualisations and Video Filter Plugins |
260 | | configure.args-append \ |
261 | | --disable-goom |
262 | | |
263 | | # Service Discovery Plugins |
264 | | configure.args-append \ |
265 | | --enable-bonjour \ |
266 | | --enable-upnp |
267 | | |
268 | | # 20150209: Jack really would require a newer variant than what's currently in MacPorts |
269 | | variant jack description {Enable jack and fluidsynth plugins for audio output} { |
270 | | depends_lib-append port:jack port:fluidsynth port:portaudio |
271 | | configure.args-delete --disable-jack --disable-fluidsynth |
272 | | configure.args-append --enable-jack --enable-fluidsynth |
273 | | } |
| 338 | variant qtkit description {Enable qtcapture and qtaudio} { |
| 339 | configure.args-replace --disable-macosx-qtkit --enable-macosx-qtkit |
| 340 | } |
348 | | variant quartz { |
349 | | depends_lib-delete port:libsamplerate |
350 | | depends_lib-append port:BGHUDAppKit |
351 | | |
352 | | patchfiles-append patch-vlc-for-macports.diff |
353 | | |
354 | | configure.args-delete --disable-macosx \ |
355 | | --enable-samplerate \ |
356 | | --disable-realrtsp |
357 | | configure.args-append --enable-macosx |
358 | | # taken from VLC's own configure.sh script for OS X: |
359 | | configure.args-append --disable-samplerate \ |
360 | | --enable-merge-ffmpeg \ |
361 | | --enable-realrtsp |
362 | | } |
| 432 | variant huge \ |
| 433 | requires jack shout svg \ |
| 434 | description {Enable all variants except quartz, smb, freerdp and x11} {} |
364 | | # FreeRDP currently doesn't build with CMake >= 3.1 (#47389) |
365 | | variant freerdp description {Build the FreeRDP support; currently dysfunctional} { |
366 | | depends_lib-append port:FreeRDP |
367 | | # access/rdp.c:45:11: fatal error: 'freerdp/version.h' file not found |
368 | | configure.cppflags-append -DFREERDP_INTERFACE_VERSION \ |
369 | | -DFREERDP_VERSION_MAJOR=1 \ |
370 | | -DFREERDP_VERSION_MINOR=1 |
371 | | configure.args-replace --disable-freerdp --enable-freerdp |
372 | | } |
| 436 | if {${subport} ne "lib${name}"} { |
| 437 | variant full \ |
| 438 | requires huge quartz smb x11 \ |
| 439 | description {Enable all variants except x11 (and except freerdp, currently)} {} |
| 440 | } else { |
| 441 | variant full \ |
| 442 | requires huge quartz smb \ |
| 443 | description {Enable all variants (except freerdp, currently)} {} |
| 444 | } |
| 445 | |
| 446 | # this patchfile can probably go with VLC 2.2.2, or should be reviewed then. |
| 447 | # update 2.2.2 : lua 5.3 gives compiler syntax errors so we stick with 5.2 for now. |
| 448 | patchfiles-append patch-for-lua52.diff |
| 449 | |
| 450 | platform macosx { |
| 451 | default_variants-append +quartz +qtkit |
| 452 | |
| 453 | configure.args-replace --disable-macosx-eyetv --enable-macosx-eyetv |
| 454 | |
| 455 | if {${subport} ne "lib${name}"} { |
| 456 | configure.args-replace --disable-macosx-vlc-app --enable-macosx-vlc-app |
| 457 | } |
| 458 | |
| 459 | post-patch { |
| 460 | reinplace "s/Appkit/AppKit/" ${worksrcpath}/configure.ac |
| 461 | reinplace "/Sparkle.framework/d" \ |
| 462 | ${worksrcpath}/extras/package/macosx/vlc.xcodeproj/project.pbxproj |
| 463 | reinplace "/SDKROOT/d" \ |
| 464 | ${worksrcpath}/extras/package/macosx/vlc.xcodeproj/project.pbxproj |
| 465 | reinplace "/Growl.framework/d" \ |
| 466 | ${worksrcpath}/extras/package/macosx/package.mak |
| 467 | |
| 468 | reinplace "s:LD_LIBRARY_PATH:DYLD_LIBRARY_PATH:g" \ |
| 469 | ${worksrcpath}/Makefile.am |
| 470 | |
| 471 | reinplace "/argv/s/environ/*_NSGetEnviron()/" \ |
| 472 | ${worksrcpath}/modules/misc/inhibit/xdg.c \ |
| 473 | ${worksrcpath}/modules/stream_filter/decomp.c |
| 474 | |
| 475 | reinplace "s/extern char \\*\\*environ;/#include <crt_externs.h>/" \ |
| 476 | ${worksrcpath}/modules/misc/inhibit/xdg.c \ |
| 477 | ${worksrcpath}/modules/stream_filter/decomp.c |
| 478 | |
| 479 | if {![file exists ${worksrcpath}/contrib/BGHUDAppKit.framework]} { |
| 480 | ln -s ${frameworks_dir}/BGHUDAppKit.framework ${worksrcpath}/contrib/BGHUDAppKit.framework |
| 481 | } |
| 482 | |
| 483 | # To trick configure |
| 484 | file mkdir "${worksrcpath}/contrib/lib" |
| 485 | } |
374 | | variant huge \ |
375 | | requires jack shout svg \ |
376 | | description {Enable all variants except quartz, smb, freerdp and x11} {} |
377 | | |
378 | | if {${subport} ne "lib${name}"} { |
379 | | variant full \ |
380 | | requires huge quartz smb x11 \ |
381 | | description {Enable all variants except x11 (and except freerdp, currently)} {} |
382 | | } else { |
383 | | variant full \ |
384 | | requires huge quartz smb \ |
385 | | description {Enable all variants (except freerdp, currently)} {} |
| 487 | post-destroot { |
| 488 | eval file delete [glob ${destroot}${prefix}/lib/vlc/plugins/*/*.la] |
| 489 | |
| 490 | if {[variant_isset qt4] || [variant_isset qt5] || [variant_isset quartz]} { |
| 491 | if {${subport} ne "lib${name}"} { |
| 492 | copy ${worksrcpath}/VLC.app ${destroot}${applications_dir}/VLC.app |
| 493 | |
| 494 | # These are already in ${prefix}, so we don't need to bundle them as well |
| 495 | delete ${destroot}${applications_dir}/VLC.app/Contents/Frameworks |
| 496 | delete ${destroot}${applications_dir}/VLC.app/Contents/lib |
| 497 | |
| 498 | # There's no need to install these into the bundle and the prefix |
| 499 | delete ${destroot}${applications_dir}/VLC.app/Contents/MacOS/include |
| 500 | delete ${destroot}${applications_dir}/VLC.app/Contents/MacOS/lib |
| 501 | delete ${destroot}${applications_dir}/VLC.app/Contents/MacOS/plugins |
| 502 | delete ${destroot}${applications_dir}/VLC.app/Contents/MacOS/share/locale |
| 503 | delete ${destroot}${applications_dir}/VLC.app/Contents/MacOS/share/lua |
| 504 | |
| 505 | # http://trac.macports.org/ticket/35131 |
| 506 | ln -s ${prefix}/lib ${destroot}${applications_dir}/VLC.app/Contents/MacOS/lib |
| 507 | ln -s ${prefix}/lib/vlc/plugins ${destroot}${applications_dir}/VLC.app/Contents/MacOS/plugins |
| 508 | ln -s ${prefix}/lib/vlc/lua ${destroot}${applications_dir}/VLC.app/Contents/MacOS/share/lua |
| 509 | ln -s ${prefix}/share/locale ${destroot}${applications_dir}/VLC.app/Contents/MacOS/share/locale |
| 510 | |
| 511 | # the vlc executable needs to be started with a full path to the app bundle executable |
| 512 | # or else the Mac OS X interface will hang beyond even a ^C or ^\ : |
| 513 | move ${destroot}${prefix}/bin/vlc ${destroot}${prefix}/bin/vlc.exe |
| 514 | system "echo \"#!/bin/sh\nexec \\\"${applications_dir}/VLC.app/Contents/MacOS/VLC\\\" \\\"\\\$\@\\\"\" > ${destroot}${prefix}/bin/vlc" |
| 515 | system "chmod 755 ${destroot}${prefix}/bin/vlc" |
| 516 | } else { |
| 517 | delete ${destroot}${prefix}/bin |
| 518 | delete ${destroot}${prefix}/share/applications |
| 519 | delete ${destroot}${prefix}/share/man |
| 520 | } |
| 521 | } |
| 522 | } |
| 523 | post-activate { |
| 524 | if {[variant_isset qt4] || [variant_isset qt5]} { |
| 525 | notes-append "The Qt interface modules for VLC are currently dysfunctional. If you encounter bugs with them, please file them with VLC and not MacPorts." |
| 526 | } |
| 527 | system "${prefix}/lib/vlc/vlc-cache-gen -f ${prefix}/lib/vlc" |
| 528 | } |
| 529 | } |
395 | | configure.args-replace --disable-macosx-eyetv --enable-macosx-eyetv |
| 547 | platforms darwin |
| 548 | homepage http://www.ffmpeg.org/ |
| 549 | master_sites http://www.ffmpeg.org/releases/ |
| 550 | |
| 551 | use_bzip2 yes |
| 552 | distname ffmpeg-${version} |
| 553 | |
| 554 | checksums rmd160 5b61b6b0521d39ca31dcfb7fff1dfa26d9e7667a \ |
| 555 | sha256 40611e329bc354592c6f8f1deb033c31b91f80e91f5707ca4f9afceca78d8e62 |
| 556 | |
| 557 | depends_build port:pkgconfig \ |
| 558 | port:gmake |
| 559 | |
| 560 | # libvpx is static only so can be considered a build dependency (#47934) |
| 561 | |
| 562 | depends_build-append \ |
| 563 | port:libvpx |
| 564 | |
| 565 | depends_lib port:lame \ |
| 566 | port:libiconv \ |
| 567 | port:openjpeg15 \ |
| 568 | port:xz \ |
| 569 | port:zlib |
| 570 | |
| 571 | # depends_lib-append port:libvorbis \ |
| 572 | # port:libopus \ |
| 573 | # port:libogg \ |
| 574 | # port:libtheora \ |
| 575 | # port:libass \ |
| 576 | # port:gnutls \ |
| 577 | # port:fontconfig \ |
| 578 | # port:freetype \ |
| 579 | # port:bzip2 |
| 580 | |
| 581 | build.cmd ${prefix}/bin/gmake |
| 582 | build.env-append V=1 |
| 583 | |
| 584 | # |
| 585 | # enable auto configure of asm optimizations |
| 586 | # requires Xcode 3.1 or better on Leopard |
| 587 | # |
| 588 | minimum_xcodeversions {9 3.1} |
| 589 | |
| 590 | if {[lsearch [get_canonical_archs] i386] != -1} { |
| 591 | # clang-3.1 hits https://trac.macports.org/ticket/30137 (<rdar://problem/11542429>) |
| 592 | # clang-139 hits https://trac.macports.org/ticket/38141 |
| 593 | compiler.blacklist-append {clang < 422.1.7} |
| 594 | } |
397 | | if {${subport} ne "lib${name}"} { |
398 | | configure.args-replace --disable-macosx-vlc-app --enable-macosx-vlc-app |
| 596 | configure.cflags-append -DHAVE_LRINTF ${configure.cppflags} |
| 597 | configure.args --prefix=${FFMPEG_VLC_PREFIX} \ |
| 598 | --progs-suffix=-VLC \ |
| 599 | --build-suffix=-VLC \ |
| 600 | --disable-doc \ |
| 601 | --disable-encoder=vorbis \ |
| 602 | --enable-libopenjpeg \ |
| 603 | --disable-debug \ |
| 604 | --disable-avdevice \ |
| 605 | --disable-devices \ |
| 606 | --disable-avfilter \ |
| 607 | --disable-filters \ |
| 608 | --disable-protocol=concat \ |
| 609 | --disable-bsfs \ |
| 610 | --disable-bzlib \ |
| 611 | --enable-avresample \ |
| 612 | --enable-libmp3lame \ |
| 613 | --enable-libvpx \ |
| 614 | --disable-libbluray \ |
| 615 | --disable-sdl \ |
| 616 | --disable-libxcb --disable-libxcb-shm --disable-libxcb-xfixes --disable-libxcb-shape \ |
| 617 | --enable-shared --disable-static --enable-pthreads \ |
| 618 | --cc=${configure.cc} |
| 619 | |
| 620 | # this is the old gpl2 variant. VLC is GPL2'ed, so we can just as well build ffmpeg |
| 621 | # with these components. |
| 622 | configure.args-append \ |
| 623 | --enable-gpl \ |
| 624 | --enable-postproc |
| 625 | # configure.args-append \ |
| 626 | # --enable-libx264 \ |
| 627 | # --enable-libxvid |
| 628 | # depends_lib-append port:XviD \ |
| 629 | # port:x264 |
| 630 | |
| 631 | configure.args-append \ |
| 632 | --arch=${configure.build_arch} |
| 633 | configure.env-append \ |
| 634 | ASFLAGS='[get_canonical_archflags]' |
| 635 | if {${build_arch} eq "x86_64"} { |
| 636 | depends_build-append \ |
| 637 | port:yasm |
| 638 | configure.args-append \ |
| 639 | --enable-yasm |
401 | | post-patch { |
402 | | reinplace "s/Appkit/AppKit/" ${worksrcpath}/configure.ac |
403 | | reinplace "/Sparkle.framework/d" \ |
404 | | ${worksrcpath}/extras/package/macosx/vlc.xcodeproj/project.pbxproj |
405 | | reinplace "/SDKROOT/d" \ |
406 | | ${worksrcpath}/extras/package/macosx/vlc.xcodeproj/project.pbxproj |
407 | | reinplace "/Growl.framework/d" \ |
408 | | ${worksrcpath}/extras/package/macosx/package.mak |
409 | | |
410 | | reinplace "s:LD_LIBRARY_PATH:DYLD_LIBRARY_PATH:g" \ |
411 | | ${worksrcpath}/Makefile.am |
412 | | |
413 | | reinplace "/argv/s/environ/*_NSGetEnviron()/" \ |
414 | | ${worksrcpath}/modules/misc/inhibit/xdg.c \ |
415 | | ${worksrcpath}/modules/stream_filter/decomp.c |
416 | | |
417 | | reinplace "s/extern char \\*\\*environ;/#include <crt_externs.h>/" \ |
418 | | ${worksrcpath}/modules/misc/inhibit/xdg.c \ |
419 | | ${worksrcpath}/modules/stream_filter/decomp.c |
| 642 | license GPL-2+ |
425 | | # To trick configure |
426 | | file mkdir "${worksrcpath}/contrib/lib" |
427 | | } |
| 649 | # VDA (video hardware acceleration, mostly H264) is only supported on 10.6.3+ up to (excluding) 10.11. |
| 650 | #if {(${os.major} > 10 || (${os.major} == 10 && ${os.minor} >= 3)) && (${os.major} < 15)} |
| 651 | # Due to a bug in ffmpeg(?), we have to enable VDA on 10.11 as well, even though it shouldn't be supported. |
| 652 | # More information: https://github.com/mpv-player/mpv/issues/2299 |
| 653 | if {${os.major} > 10 || (${os.major} == 10 && ${os.minor} >= 3)} { |
| 654 | configure.args-delete --disable-vda |
| 655 | configure.args-append --enable-vda |
| 656 | } |
432 | | if {[variant_isset qt4] || [variant_isset qt5] || [variant_isset quartz]} { |
433 | | if {${subport} ne "lib${name}"} { |
434 | | copy ${worksrcpath}/VLC.app ${destroot}${applications_dir}/VLC.app |
435 | | |
436 | | # These are already in ${prefix}, so we don't need to bundle them as well |
437 | | delete ${destroot}${applications_dir}/VLC.app/Contents/Frameworks |
438 | | delete ${destroot}${applications_dir}/VLC.app/Contents/lib |
439 | | |
440 | | # There's no need to install these into the bundle and the prefix |
441 | | delete ${destroot}${applications_dir}/VLC.app/Contents/MacOS/include |
442 | | delete ${destroot}${applications_dir}/VLC.app/Contents/MacOS/lib |
443 | | delete ${destroot}${applications_dir}/VLC.app/Contents/MacOS/plugins |
444 | | delete ${destroot}${applications_dir}/VLC.app/Contents/MacOS/share/locale |
445 | | delete ${destroot}${applications_dir}/VLC.app/Contents/MacOS/share/lua |
446 | | |
447 | | # http://trac.macports.org/ticket/35131 |
448 | | ln -s ${prefix}/lib ${destroot}${applications_dir}/VLC.app/Contents/MacOS/lib |
449 | | ln -s ${prefix}/lib/vlc/plugins ${destroot}${applications_dir}/VLC.app/Contents/MacOS/plugins |
450 | | ln -s ${prefix}/lib/vlc/lua ${destroot}${applications_dir}/VLC.app/Contents/MacOS/share/lua |
451 | | ln -s ${prefix}/share/locale ${destroot}${applications_dir}/VLC.app/Contents/MacOS/share/locale |
452 | | |
453 | | # the vlc executable needs to be started with a full path to the app bundle executable |
454 | | # or else the Mac OS X interface will hang beyond even a ^C or ^\ : |
455 | | move ${destroot}${prefix}/bin/vlc ${destroot}${prefix}/bin/vlc.exe |
456 | | system "echo \"#!/bin/sh\nexec \\\"${applications_dir}/VLC.app/Contents/MacOS/VLC\\\" \\\"\\\$\@\\\"\" > ${destroot}${prefix}/bin/vlc" |
457 | | system "chmod 755 ${destroot}${prefix}/bin/vlc" |
458 | | } else { |
459 | | delete ${destroot}${prefix}/bin |
460 | | delete ${destroot}${prefix}/share/applications |
461 | | delete ${destroot}${prefix}/share/man |
462 | | } |
| 665 | # Apple GCC has problems with SIMD intrinsics and -Werror=no-missing-prototypes. |
| 666 | if {${os.major} < 11} { |
| 667 | patchfiles-append patch-configure-no-error-on-missing-prototypes.diff |
| 668 | } |
| 669 | |
| 670 | # kCVPixelFormatType_OneComponent8 used in avfoundation indev is only available on 10.8+ |
| 671 | if {${os.major} < 12} { |
| 672 | configure.args-append --disable-indev=avfoundation |
465 | | post-activate { |
466 | | if {[variant_isset qt4] || [variant_isset qt5]} { |
467 | | notes-append "The Qt interface modules for VLC are currently dysfunctional. If you encounter bugs with them, please file them with VLC and not MacPorts." |
| 675 | |
| 676 | # |
| 677 | # configure isn't autoconf and they do use a dep cache |
| 678 | # |
| 679 | |
| 680 | platform darwin 8 { |
| 681 | post-patch { |
| 682 | reinplace "s:,-compatibility_version,$\(LIBMAJOR\)::" ${worksrcpath}/configure |
| 683 | } |
| 684 | } |
| 685 | |
| 686 | destroot.target install-libs install-headers |
| 687 | |
| 688 | post-destroot { |
| 689 | file delete -force ${destroot}${prefix}/share/examples |
| 690 | # We need to make sure that the linker will use our libraries and not one |
| 691 | # from a location like ${prefix}/lib . That's why we use --build-suffix, but |
| 692 | # that still requires us to provide pkg-config files with the standard names: |
| 693 | foreach pc [glob ${destroot}${FFMPEG_VLC_PREFIX}/lib/pkgconfig/*.pc] { |
| 694 | set standardname [strsed ${pc} "s/-VLC.pc/.pc/"] |
| 695 | ln -s [file tail ${pc}] ${standardname} |
| 696 | } |
| 697 | # oblige dependent code to include files from our own renamed header file directories, so it |
| 698 | # cannot include mismatching headers by accident (e.g. those from ffmpeg 3.x). |
| 699 | foreach dir {libavcodec libavformat libavresample libavutil libpostproc libswresample libswscale} { |
| 700 | file rename ${destroot}${FFMPEG_VLC_PREFIX}/include/${dir} ${destroot}${FFMPEG_VLC_PREFIX}/include/${dir}-VLC |