yars

vlc.SlackBuild

Aug 23rd, 2012
276
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 138.20 KB | None | 0 0
  1. #!/bin/sh
  2. # $Id: vlc.SlackBuild,v 1.103 2012/07/25 14:16:34 root Exp root $
  3. # Copyright 2007, 2008, 2009, 2010, 2011, 2012  Eric Hameleers, Eindhoven, Netherlands
  4. #
  5. #   Permission to use, copy, modify, and distribute this software for
  6. #   any purpose with or without fee is hereby granted, provided that
  7. #   the above copyright notice and this permission notice appear in all
  8. #   copies.
  9. #
  10. #   THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
  11. #   WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
  12. #   MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
  13. #   IN NO EVENT SHALL THE AUTHORS AND COPYRIGHT HOLDERS AND THEIR
  14. #   CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
  15. #   SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
  16. #   LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
  17. #   USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
  18. #   ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
  19. #   OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
  20. #   OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  21. #   SUCH DAMAGE.
  22. # -----------------------------------------------------------------------------
  23. #
  24. # Slackware SlackBuild script
  25. # ===========================
  26. # By:         Eric Hameleers <[email protected]>
  27. # For:        vlc
  28. # Descr:      multimedia player for various audio and video formats
  29. # URL:        http://www.videolan.org/vlc/
  30. # Needs:      libdvdcss for playing encrypted DVDs
  31. # Changelog:
  32. # 0.8.6a-1:   15/Mar/2007 by Eric Hameleers <[email protected]>
  33. #             * Initial build.
  34. # 0.8.6b-1:   25/apr/2007 by Eric Hameleers <[email protected]>
  35. #             * Update.
  36. # 0.8.6c-1:   04/sep/2007 by Eric Hameleers <[email protected]>
  37. #             * Update. Allow vlc to be built without patented code (lame/amr).
  38. # 0.8.6d-1:   12/dec/2007 by Eric Hameleers <[email protected]>
  39. #             * Update with a vulnerability bugfix. All external libraries
  40. #               were updated to their most recent release.
  41. #               This pkg adds support for firewire cameras, DV and DVB cards.
  42. #               AMR audio codec is not supported in this build (I could not
  43. #               create a vlc binary successfully).
  44. #               Again, the resulting binary package requires no additional
  45. #               non-Slackware packages, except for libdvdcss in case you want
  46. #               to watch an encrypted DVD.
  47. # 0.8.6d-2:   29/jan/2008 by Eric Hameleers <[email protected]>
  48. #             * Disable building AMR. The 0.8.6d official release does
  49. #               not have support for AMR audio codec re-added yet.
  50. #               Also, add the AAC en/decoder to the PATENTED software.
  51. #               Build with dll loader support only on 32bit platform.
  52. # 0.8.6e-1:   02/mar/2008 by Eric Hameleers <[email protected]>
  53. #             * New release fixes security issues.
  54. # 0.8.6e-2:   23/mar/2008 by Eric Hameleers <[email protected]>
  55. #             * Update libebml; new ffmpeg,live555 snapshots
  56. # 0.8.6f-1:   03/apr/2008 by Eric Hameleers <[email protected]>
  57. #             * New release (bugfixes). Also updated the snapshot for ffmpeg
  58. # 0.8.6f-2:   03/apr/2008 by Eric Hameleers <[email protected]>
  59. #             * Updated the snapshot for ffmpeg
  60. # 0.8.6g-1:   31/may/2008 by Eric Hameleers <[email protected]>
  61. #             * New release. Updated the snapshot for ffmpeg and live555,
  62. #               updated libtheora.
  63. # 0.8.6h-1:   10/jun/2008 by Eric Hameleers <[email protected]>
  64. #             * New release. Repaired the broken matroska support (thanks to
  65. #               Thomas Morper who submitted a fix for the SlackBuild.
  66. # 0.8.6h-2:   15/jun/2008 by Eric Hameleers <[email protected]>
  67. #             * Fixed the broken DTS audio codec support (did not play
  68. #               6 channel sound here)
  69. # 0.8.6h-3:   17/jun/2008 by Eric Hameleers <[email protected]>
  70. #             * Added Universal Plug'n'Play (upnp) client support.
  71. #               Updated the live555 tarball to 20080605.
  72. #               Updated the x264 snapshot- this now requires the yasm assembler
  73. #               to be installed in order to compile successfully. If you don't
  74. #               have/want that, set the variable REQUIRE_YASM to a value of "NO"
  75. #               (see further down) so that the script will fall back to an older
  76. #               x264 snapshot that does not require yasm to compile. Updated
  77. #               libcdio to 0.80. Re-introduce AMR audio encoding to the package.
  78. # 0.8.6i-1:   09/jul/2008 by Eric Hameleers <[email protected]>
  79. #             * New release. Also updated to the new lame-3.98.
  80. # 0.9.1-1:    31/aug/2008 by Eric Hameleers <[email protected]>
  81. #             * The first in a new series of 0.9.x - these are source-only
  82. #               releases for now, meaning that the developers are not yet
  83. #               convinced 0.9.x is ready to replace 0.8.x.
  84. #               Note that the vlc 0.9 releases fail to compile a static vlc.
  85. #               According to the developers whis will not be fixed. Still, this
  86. #               vlc package is without external dependencies as always ;-)
  87. #               Updated lame to v3.89, speex to 1.2rc1 and libmpeg2 to 1.5.1.
  88. #               Updated snapshots for ffmpeg to r14080; live555 to 2008.07.25;
  89. #               started using libdvdread/libdvdnav releases from mplayerhq.hu.
  90. #               For dirac video I now use the far better schroedinger instead
  91. #               of the reference 'dirac' implementation.
  92. #               I added documentation for all the libraries which I include.
  93. #               Notes for package (re)builders:
  94. #               The SlackBuild will by default use a static version of the Qt4
  95. #               library. If you already have Qt4 installed, you may choose to
  96. #               build vlc against that dynamic library; in that case run:
  97. #                 # STATIC_QT4=NO ./vlc.SlackBuild
  98. #               to build your vlc package.
  99. #               If you already have ffmpeg installed and want to use that, run
  100. #                 # STATIC_FFMPEG=NO ./vlc.SlackBuild
  101. #               to build your vlc package.
  102. #               Of course, if you have both QT4 and ffmpeg already available,
  103. #               you can combine the above two commands to:
  104. #                 # STATIC_QT4=NO STATIC_FFMPEG=NO ./vlc.SlackBuild
  105. #               Lastly, it is worth noting that building any recent X264
  106. #               library fails with Slackware 12.1 (and earlier)'s nasm.
  107. #               Either install yasm, or let the script automatically fall back
  108. #               to an older version of the X264 like this:
  109. #                 # REQUIRE_YASM=NO ./vlc.SlackBuild
  110. # 0.9.2-1:    10/sep/2008 by Eric Hameleers <[email protected]>
  111. #             * Updated to 0.9.2
  112. # 0.9.3-1:    30/sep/2008 by Eric Hameleers <[email protected]>
  113. #             * Updated to 0.9.3
  114. #               Fixed video playback thanks to phobos3576 of the slacky.eu
  115. #               forum for finding the fix and Andrea Tornese for reporting it.
  116. # 0.9.4-1:    07/oct/2008 by Eric Hameleers <[email protected]>
  117. #             * Updated to 0.9.4. Added libass to render 'formatted'
  118. #               subtitles. Updated live555 to 2008.09.02. Updated the ffmpeg
  119. #               snapshot to 20081007. Now default to using dynamically linked
  120. #               QT4 (requires that you install a QT4 package yourself
  121. #               prior to compiling VLC!)
  122. # 0.9.5-1:    26/oct/2008 by Eric Hameleers <[email protected]>
  123. #             * Updated to 0.9.5. New snapshots for ffmpeg x264 added. QT4
  124. #               compiled statically again because VLC is sensitive to the
  125. #               version it builds against.
  126. # 0.9.5-2:    29/oct/2008 by Eric Hameleers <[email protected]>
  127. #             * Re-enable embedded video display. Thanks to Thomas Morper who
  128. #               verified that this works reliably with vlc-0.9.5 and qt-4.4.3 !
  129. # 0.9.5-3:    05/nov/2008 by Eric Hameleers <[email protected]>
  130. #             * Updated libtheora to 1.0 and libcdio to 0.81
  131. # 0.9.6-1:    08/nov/2008 by Eric Hameleers <[email protected]>
  132. #             * New release. Updated ffmpeg/x264 snapshots.
  133. # 0.9.8-1:    02/dec/2008 by Eric Hameleers <[email protected]>
  134. #             * New release. Updated ffmpeg/x264/live555 versions. Added midi
  135. #               playback support through fluidsynth
  136. # 0.9.8a-1:   04/dec/2008 by Eric Hameleers <[email protected]>
  137. #             * VLC bugfix release... also took the opportunity to fix *my*
  138. #               broken build of the dca and fluidsynth modules.
  139. # 0.9.8a-2:   04/dec/2008 by Eric Hameleers <[email protected]>
  140. #             * Updated ffmpeg/x264 snapshots, and re-adding firewire support
  141. # 0.9.8a-3:   28/dec/2008 by Eric Hameleers <[email protected]>
  142. #             * Updated ffmpeg/x264 snapshots, made it build on x86_64 with the
  143. #               help of Attila Craciun.
  144. # 20090307-1: 07/mar/2009 by Eric Hameleers <[email protected]>
  145. #             * Updated ffmpeg/x264/live55 snapshots, fix default font for
  146. #               x86_64, fix DTS audio decoding on x86_64
  147. # 0.9.9.rc2-1:18/mar/2009 by Eric Hameleers <[email protected]>
  148. #             * Building the first release candidate.
  149. # 0.9.9.rc2-2:27/mar/2009 by Eric Hameleers <[email protected]>
  150. #             * Fix AAC decoding by removing "--with-drm"
  151. # 0.9.9-1:    27/mar/2009 by Eric Hameleers <[email protected]>
  152. #             * Try to fix ffmeg video decoding as well as upgrade to 0.9.9;
  153. #               apply several fixes taken from 1.0.0-git to fix x264 encoding.
  154. # 1.0.0.pre2-1: 04/may/2009 by Eric Hameleers <[email protected]>
  155. #             * This is 1.0.0-pre2. I like it much more than the
  156. #               'stable' 0.9.x. Furthermore, DVD playback was broken in
  157. #               my 0.9.9 package, so I needed to release an update.
  158. # 1.0.0.rc1-1: 11/may/2009 by Eric Hameleers <[email protected]>
  159. #             * The first release candidate for 1.0.0
  160. # 1.0.0.rc2-1: 26/may/2009 by Eric Hameleers <[email protected]>
  161. #             * The second release candidate for 1.0.0
  162. # 1.0.0.rc3-1: 09/jun/2009 by Eric Hameleers <[email protected]>
  163. #             * The third release candidate for 1.0.0
  164. # 1.0.0.rc4-1: 18/jun/2009 by Eric Hameleers <[email protected]>
  165. #             * The fourth release candidate for 1.0.0.
  166. #               Also updated live plugin to 2009.06.02
  167. # 1.0.0-1:    06/jul/2009 by Eric Hameleers <[email protected]>
  168. #             * VLC 1.0.0 has been released!
  169. # 1.0.1-1:    28/jul/2009 by Eric Hameleers <[email protected]>
  170. #             * An update that fixes a realrtsp vulnerability. Also updated
  171. #               x264/live555 snapshots and added support for lua playlist,
  172. #               metafetcher and interface plugins. By default, this script
  173. #               no longer links Qt4 statically and instead links against an
  174. #               already installed Qt libray.
  175. # 1.0.1-2:    30/jul/2009 by Eric Hameleers <[email protected]>
  176. #             * Fix the swscale plugin
  177. # 1.0.2-1:    19/sep/2009 by Eric Hameleers <[email protected]>
  178. #             * Update.
  179. # 1.0.3-1:    31/oct/2009 by Eric Hameleers <[email protected]>
  180. #             * Update. New version of the theora encoder.
  181. #               Other upgrades: libkate, schroedinger.
  182. #               Downgraded libraw1394 to 1.2.0 which is the last 1.x version
  183. #               found on sourceforge, now that the original linux1394.org site
  184. #               has disappeared (using new download URL too).
  185. # 1.0.3-2:    02/nov/2009 by Eric Hameleers <[email protected]>
  186. #             * Try to fix broken firewire support (libraw1394). Allow root to
  187. #               run vlc.
  188. # 1.0.3-3:    13/nov/2009 by Eric Hameleers <[email protected]>
  189. #             * Fix the broken fullscreen in KDE-4.3.3; added a newer snapshot
  190. #               for live555 and x264.
  191. # 1.0.3-4:    08/dec/2009 by Eric Hameleers <[email protected]>
  192. #             * Upgrade internal ffmpeg to latest SVN, and update the x86_64
  193. #               assembler patch for ffmpeg to enable mmx/sse support which
  194. #               (according to Thomas Morper who supplied the updated patch)
  195. #               fixes choppy HD video playback. Disabled vdpau support because
  196. #               that will not compile unless you have NVIDIA binary drivers
  197. #               installed.
  198. #               Also updated live555/x264 to their latest snapshots.
  199. #               Switched to the GPL'ed opencore AMR codec (spin-off from
  200. #               Google Android project).
  201. # 1.0.3-5:    10/dec/2009 by Eric Hameleers <[email protected]>
  202. #             * Make the dc1394 plugin work by patching VLC to use the new API.
  203. # 1.0.4-1:    11/dec/2009 by Eric Hameleers <[email protected]>
  204. #             * New release. The ffmpeg/x264 snapshots were updated.
  205. # 20091228-1: 28/dec/2009 by Eric Hameleers <[email protected]>
  206. #             * Test of git snapshot (1.1.git)
  207. # 1.1.0.pre3-1: 01/may/2010 by Eric Hameleers <[email protected]>
  208. #             * Update to git snapshot 1.1.0.pre3. Also updated ffmpeg, live555
  209. #               and x264 snapshots. Fixed the ffmpeg checkout so that we can
  210. #               control what version of swscale gets used. Fixed the checkout
  211. #               of vlc so that we can get a snapshot from any date,
  212. #               not just HEAD. Updated fluidsynth plugin to 1.1.1. Updated
  213. #               libdvbpci plugin to 0.1.7.
  214. #               Updated to schroedinger 1.0.9 which is finally on par with
  215. #               the dirac codec's speed and quality. Added projectM
  216. #               visualisation plugin and re-enabled ggi plugin.
  217. #               Added support for VAAPI, i.e. GPU-accelerated playback of H264.
  218. #               Fixed the qt4 build so that it is really isolated from any
  219. #               pre-existing qt4 installation on your computer. Used an
  220. #               internal xulrunner sdk to build the mozilla-plugin.
  221. #               Copy all patches used by this script into the package's
  222. #               documentation directory.
  223. #               If you want to control what version of VLC to checkout of GIT,
  224. #               you should use the VERSION variable (older script used SRCVER).
  225. # 1.1.0.pre4-1: 22/may/2010 by Eric Hameleers <[email protected]>
  226. #             * Update to git snapshot 1.1.0.pre4. Also updated ffmpeg and x264
  227. #               snapshots. Changed from libv4l to v4l-utils.
  228. # 20100523-1: 23/may/2010 by Eric Hameleers <[email protected]>
  229. #             * Update VLC snapshot to one that supports the new Google VP8.
  230. #               Also apply webm patches to the ffmpeg snapshot. VLC can now
  231. #               playback .webm files (but not encode yet as far as I know).
  232. # 1.1.0.rc-1: 24/may/2010 by Eric Hameleers <[email protected]>
  233. #             * Update to the release candidate for 1.1.0. Fix VAAPI support
  234. #               (now depends on external packages to supply the actual harware
  235. #               drivers: libva (intel, als needed for nvidia & ati), and one of
  236. #               vdpau-video (nvidia) or xvba-video (ati).
  237. # 1.1.0.rc-2: 25/may/2010 by Eric Hameleers <[email protected]>
  238. #             * Upgrade to final release candidate (yes, sounds weird) and fix
  239. #               a bug in displaying DVD menus
  240. # 1.1.0.rc2-1:03/jun/2010 by Eric Hameleers <[email protected]>
  241. #             * Upgrade to 1.1.0 second release candidate.
  242. #               Upgraded EBML/Matroska libraries to 0.8.0/0.9.0 (new release
  243. #               after a long time).
  244. # 20100609-1: 09/jun/2010 by Eric Hameleers <[email protected]>
  245. #             * Update VLC snapshot to try and get rid of segfaults in the
  246. #               VAAPI routines. Also updated ffmpeg (now fully supports VP8
  247. #               codec, so no additional patching required anymore) and x264
  248. #               libraries, and live555.
  249. # 1.1.0.rc3-1:11/jun/2010 by Eric Hameleers <[email protected]>
  250. #             * Upgrade to 1.1.0 third release candidate.
  251. #               Unfortunately, I still see segfaults in VLC when VAAPI hardware
  252. #               decoding support is activating by installing libva package...
  253. # 1.1.0.rc3-2:13/jun/2010 by Eric Hameleers <[email protected]>
  254. #             * Add a patch to fix the VAAPI segfaults. My debugger backtrace
  255. #               allowed fenrir to spot and repair the bug.
  256. # 1.1.0.rc4-1:16/jun/2010 by Eric Hameleers <[email protected]>
  257. #             * Update to RC4 for the upcoming 1.1.0 release.
  258. # 1.1.0-1:    21/jun/2010 by Eric Hameleers <[email protected]>
  259. #             * Official release of vlc 1.1.0.
  260. #               ffmpeg was updated to 0.6 (another official release, yay);
  261. #               x264 and libvpx were updated to a recent snapshot;
  262. #               libebml, libmatroska, libcdio and orc were upgraded to their
  263. #               newest versions.
  264. # 20100714-1: 14/jul/2010 by Eric Hameleers <[email protected]>
  265. #             * Test build of what will be 1.1.1, with updated x264 and live555.
  266. # 1.1.1-1:    20/jul/2010 by Eric Hameleers <[email protected]>
  267. #             * Official release of vlc 1.1.1.
  268. # 1.1.3-1:    22/aug/2010 by Eric Hameleers <[email protected]>
  269. #             * Update to 1.1.3.
  270. # 1.1.5-1:    12/nov/2010 by Eric Hameleers <[email protected]>
  271. #             * New release.
  272. #               Enabled ncurses support.
  273. #               Updated ffmpeg/libva/live555/schroedinger/x264 libraries.
  274. #               Updated the xulrunner SDK used to compile the browser plugin.
  275. # 1.1.5-2:    29/nov/2010 by Eric Hameleers <[email protected]>
  276. #             * Try to fix the segfault of goom visualization plugin on 32bit.
  277. #               Fix projectM audio visualization for non-US locales.
  278. # 1.1.5-3:    29/dec/2010 by Eric Hameleers <[email protected]>
  279. #             * Updated x264, libkate, libtiger, libass and libvpx, and used
  280. #               the latest xulrunner for building the mozilla plugin.
  281. # 20101230-1: 30/dec/2010 by Eric Hameleers <[email protected]>
  282. #             * With updated dependencies, it is time to test 1.2.0.git.
  283. #               Starting with 1.2.0, the mozilla plugin has been separated
  284. #               from the vlc sources and re-designed for stability. Its new
  285. #               package name is "npapi-vlc". Upgrade an old vlc-mozplugin with
  286. #               this new package!
  287. # 20110827-1: 28/aug/2011 by Eric Hameleers <[email protected]>
  288. #             * With updated dependencies again. I Had to disable the stream
  289. #               switcher because even with a patch it would give compilation
  290. #               errors (vlc's configure does not enable it by default anyway).
  291. # 20110910-1: 10/sep/2011 by Eric Hameleers <[email protected]>
  292. #             * Updated snapshots for vlcgit and x264.
  293. # 20111006-1: 06/oct/2011 by Eric Hameleers <[email protected]>
  294. #             * Added (unencrypted) bluray playback support.
  295. #               Updated the ffmpeg, lbvpx, live555, v4l and x264 support
  296. #               libraries.
  297. # 20111016-1: 16/oct/2011 by Eric Hameleers <[email protected]>
  298. #             * Updated internal bluray, dvdnav/dvdread, ebml/matroska,
  299. #               live555, orc, x264 libraries.
  300. #               Also updated to 20111016 snapshots of vlc and npapi-vlc.
  301. # 20111114-1: 14/nov/2011 by Eric Hameleers <[email protected]>
  302. #             * Time to check out the status of 1.2.pre1 (already ten days of
  303. #               development since that tag but still) and I took the liberty
  304. #               to refresh a lot of the dependencies too:
  305. #               I updated internal ass, bluray, dvbpsi, ffmpeg, fluidsynth,
  306. #               kate, lame, live555, twolame, v4l-utils, x264 libraries.
  307. #               Added internal fribidi library to satisfy the new libass
  308. #               requirement.
  309. # 20111202-1: 02/dec/2011 by Eric Hameleers <[email protected]>
  310. #             * Updated internal ffmpeg, libupnp, libmpc (switched to
  311. #               recommended SVN tarball), x264 libraries.
  312. #               Added librtmp and libgsm libraries to ffmpeg.
  313. #               Froze the version of live555 to match the vlc patches.
  314. # 20111223-1: 23/dec/2011 by Eric Hameleers <[email protected]>
  315. #             * Updated snapshot as well as internal ffmpeg, x264.
  316. #               Patched LUA compiler to only use 32-bit LUAC file format.
  317. #               Updated libbluray (now called 'first useable version' by the
  318. #               developers), added builtin dvdcss support (if USE_PATENTS is
  319. #               set to "YES")
  320. # 2.0.0-1     17/feb/2012  by Eric Hameleers <[email protected]>
  321. #             * New release! Version 2.0 was originally named 1.2 but the
  322. #               developers deciced that there were so many changes after 1.1.x
  323. #               that a version bump to 2.0 would reflect this better.
  324. #               The set of internal libraries was again updated to their most
  325. #               recent versions. If you miss any library that I should add,
  326. #               let me know!
  327. # 2.0.1-1     17/mar/2012  by Eric Hameleers <[email protected]>
  328. #             * Update to 2.0.1 while keeping the internal dependencies
  329. #               unchanged.
  330. # 2.0.2-1     27/jun/2012  by Eric Hameleers <[email protected]>
  331. #             * New release. Further updates to internal bluray, ffmpeg, lame,
  332. #               and x264 libraries.
  333. # 2.0.3-1     25/jul/2012  by Eric Hameleers <[email protected]>
  334. #             * New release.
  335. #
  336. # Run 'sh vlc.SlackBuild' to build a Slackware package.
  337. # The package (.txz) plus descriptive .txt file are created in /tmp .
  338. # Install using 'installpkg'.
  339. #
  340. # -----------------------------------------------------------------------------
  341.  
  342. #
  343. # NOTE: this SlackBuild is a monster - it tries to wrap all dependencies to
  344. # vlc into the resulting package by building these deps as static libraries
  345. # and then in the final stage linking vlc against all the static libraries.
  346. # The resulting package has all the vlc functionality and does not depend on
  347. # any software that is not present in a standard full install of Slackware.
  348. # This makes my package quite different from all the other vlc builds that are
  349. # floating around on the Internet.
  350. # /Eric Hameleers/
  351. #
  352.  
  353. # -----------------------------------------------------------------------------
  354. # Set initial variables:
  355.  
  356. PRGNAM=vlc
  357. PRGNAM2=npapi-vlc
  358. BUILD=${BUILD:-2-p4}
  359. TAG=${TAG:-"alien"}
  360.  
  361. PKGTYPE=${PKGTYPE:-"txz"}
  362.  
  363. # VERSION value may be modified later!
  364. # * If VERSION is set to "HEAD" or to any value starting with "20",
  365. #   (i.e. a "yyyymmdd" date format like "20100319") then you get
  366. #   a git snapshot of the 'master' branch;
  367. # * A format of "branchname#" or "branchname#yymmdd" means you will get a
  368. #   checkout from branch "branchname", optionally from the specified date.
  369. # * Else we look for the tarball for $VERSION in vlc's official releases.
  370. #
  371. # Hint: checkout at a certain date takes a snapshot at 00:00, not 23:59)
  372. #
  373. # Acceptible formats:
  374. #VERSION=${VERSION:-"2.0.0"}
  375. #VERSION=${VERSION:-"20120217"}
  376. #VERSION=${VERSION:-"HEAD"}
  377. #VERSION=${VERSION:-"master#20120217"}
  378. #VERSION=${VERSION:-"@1.1.0-bugfix#20120217"}
  379. #VERSION=${VERSION:-"master@git://git.videolan.org/vlc/vlc-2.0.git#20120217"}
  380.  
  381. VERSION=${VERSION:-"2.0.3"}
  382.  
  383. # At some point, the 1.2 development branched off the master tree:
  384. #DEFGITURI=${GITURI:-"git://git.videolan.org/vlc.git"}
  385. DEFGITURI=${GITURI:-"git://git.videolan.org/vlc/vlc-2.0.git"}
  386.  
  387. DOCS="ABOUT-NLS AUTHORS COPYING HACKING INSTALL NEWS README THANKS"
  388.  
  389. NUMJOBS=${NUMJOBS:-2}  # Number of parallel jobs for the compiler
  390.  
  391. # Automatically determine the architecture we're building on:
  392. if [ -z "$ARCH" ]; then
  393.   case "$( uname -m )" in
  394.     i?86) export ARCH=i686 ;;
  395.     armv7hl) export ARCH=$MARCH ;;
  396.     arm*) export ARCH=arm ;;
  397.     # Unless $ARCH is already set, use uname -m for all other archs:
  398.        *) export ARCH=$( uname -m ) ;;
  399.   esac
  400. fi
  401.  
  402. case "$ARCH" in
  403.   i686)      SLKCFLAGS="-O3 -ffast-math -fomit-frame-pointer -fexceptions -march=pentium4 -mtune=pentium4"
  404.              SLKLDFLAGS=""; LIBDIRSUFFIX=""
  405.              ;;
  406.   x86_64)    SLKCFLAGS="-O3 -fPIC"
  407.              SLKLDFLAGS="-L/usr/lib64"; LIBDIRSUFFIX="64"
  408.              ;;
  409.   armv7hl)   SLKCFLAGS="-O3 -fPIC -march=armv7-a -mfpu=vfpv3-d16"
  410.              SLKLDFLAGS=""; LIBDIRSUFFIX=""
  411.              ;;
  412.   *)         SLKCFLAGS="-O3"
  413.              SLKLDFLAGS=""; LIBDIRSUFFIX=""
  414.              ;;
  415. esac
  416.  
  417. case "$ARCH" in
  418.     arm*) TARGET=$ARCH-slackware-linux-gnueabi ;;
  419.     *)    TARGET=$ARCH-slackware-linux ;;
  420. esac
  421.  
  422. # -----------------------------------------------------------------------------
  423.  
  424. # -- PATENT ALERT! --
  425. # FFmpeg can be built with MP3 (lame) audio encoder (needed for FLV videos)
  426. # but this library is 'contaminated' with patents from Fraunhofer and GGP.
  427. # Also, the AAC encoder has patent issues.
  428. # You can build these patended algorithms into ffmpeg, and if you are an
  429. # ordinary end user, no one will bother you for using them.
  430. # For the binaries based on this SlackBuild that I distribute, it is a
  431. # different story. I am not allowed to distribute binary packages that
  432. # incorporate patented code. So here you go. My Slackware package was built
  433. # with "USE_PATENTS=NO" i.e. without using the lame mp3 libary and without the
  434. # aac libraries.
  435. #USE_PATENTS="NO"
  436. USE_PATENTS=${USE_PATENTS:-"YES"}
  437. USE_PATENTS=$(echo $USE_PATENTS | tr 'a-z' 'A-Z')
  438.  
  439. # If you set REQUIRE_YASM to "NO" then the script won't refuse to build
  440. #   VLC in case you don't have yasm installed (it is needed to
  441. #   build x264 newer than the 20080301 snapshot). In this case, the script will
  442. #   automatically 'downgrade' x264 to the 20080301-2245 snapshot.
  443. REQUIRE_YASM=${REQUIRE_YASM:-"YES"}
  444. REQUIRE_YASM=$(echo $REQUIRE_YASM | tr 'a-z' 'A-Z')
  445.  
  446. # VLC uses Qt4 for its GUI.
  447. # Slackware 13.0 already has Qt4 installed, this will speed up
  448. # the compilation a lot, and create a smaller vlc package.
  449. # In that case, define STATIC_QT4="NO" to use the system version of Qt4.
  450. # If you want an all-in package (including static version of Qt4), then
  451. # define STATIC_QT4="YES":
  452. STATIC_QT4=${STATIC_QT4:-"NO"}
  453. STATIC_QT4=$(echo $STATIC_QT4 | tr 'a-z' 'A-Z')
  454.  
  455. # VLC uses ffmpeg's avcodec for a lot of the AV processing.
  456. # If you already have ffmpeg installed, it will speed up the compilation,
  457. # and create a smaller vlc package, if you define STATIC_FFMPEG="NO":
  458. # Note: I _strongly_ suggest you compile ffmpeg statically!
  459. STATIC_FFMPEG=${STATIC_FFMPEG:-"YES"}
  460. STATIC_FFMPEG=$(echo $STATIC_FFMPEG | tr 'a-z' 'A-Z')
  461.  
  462. # You can disable building the Mozilla plugin by defining MOZPLUGIN="NO":
  463. MOZPLUGIN=${MOZPLUGIN:-"YES"}
  464. MOZPLUGIN=$(echo $MOZPLUGIN | tr 'a-z' 'A-Z')
  465.  
  466. # -----------------------------------------------------------------------------
  467. # We're done with the initials. Let's move on:
  468. # -----------------------------------------------------------------------------
  469.  
  470. # Dependent package versions
  471. A52=0.7.4
  472. AACENC=0.1.1
  473. AMRWBENC=0.1.1
  474. AMR=0.1.2
  475. ASS=0.10.0
  476. AVC1394=0.5.4
  477. BLURAY=0.2.2
  478. CDDB=1.3.2
  479. CDIO=0.82
  480. DAAP=0.4.0
  481. DC1394=2.1.2
  482. DCA=0.0.5
  483. DV=1.0.0
  484. DVBPSI=0.2.2
  485. DVDNAV=4.2.0
  486. DVDREAD=4.2.0
  487. DVDCSS=1.2.11
  488. EBML=1.2.2
  489. FAAC=1.28
  490. FAAD2=2.7
  491. FFMPEG=0.11.1
  492. #FFMPEG=r25676   # 20101104
  493. FLUID=1.1.5
  494. FRIBIDI=0.19.2
  495. GGI=2.2.2
  496. GII=1.0.2
  497. GOOM=2k4-0
  498. GSM=1.0.13
  499. KATE=0.4.1
  500. LAME=3.99.5
  501. LIBVA="0.32.0-1+sds2"
  502. LIVE=2011.12.23
  503. LUA=5.1.4
  504. MATROSKA=1.3.0
  505. MPCDEC=r475
  506. MPEG2DEC=0.5.1
  507. NPAPI=2.0.0
  508. ORC=0.4.16
  509. PROJECTM=2.0.1
  510. QT4=4.7.4
  511. RAW1394=2.0.5
  512. RTMP=2.3
  513. SCHROEDINGER=1.0.10
  514. SHOUT=2.2.2
  515. SPEEX=1.2rc1
  516. SWSCALE=""       # Set SWSCALE="" to checkout a version of ffmpeg's swscale
  517.                  # that matches the date of the FFMPEG snapshot.
  518. THEORA=1.1.1
  519. TIGER=0.3.4
  520. TWOLAME=0.3.13
  521. UPNP=1.6.16
  522. V4L=0.8.5
  523. VCD=0.7.23
  524. VPX=v1.0.0
  525. X264=20120626-2245
  526. XUL=1.9.2.19
  527.  
  528. # Determine what X we're running (the modular X returns the prefix
  529. # in the next command, while older versions stay silent):
  530. XPREF=$(pkg-config --variable=prefix x11) || true
  531. [ "$XPREF" == "" ] && XPREF='/usr/X11R6'
  532.  
  533. # Where do we look for sources?
  534. SRCDIR=$(cd $(dirname $0); pwd)
  535.  
  536. # Place to build (TMP) package (PKG) and output (OUTPUT) the program:
  537. TMP=${TMP:-"/tmp/build"}
  538. PKG=$TMP/package-$PRGNAM
  539. PKG2=$TMP/package-$PRGNAM2
  540. OUTPUT=${OUTPUT:-"/tmp"}
  541.  
  542. # This is where we are going to temporarily install the dependencies:
  543. VLCDEPSDIR="$TMP/tmp-$PRGNAM/vlcdeps"
  544.  
  545. # Building the mozilla plugin requires the Sun Java SDK:
  546. if [ "$MOZPLUGIN" == "YES" ]; then
  547.   if ! which javac 1>/dev/null 2>/dev/null ; then
  548.     echo "+++ NOT building mozilla plugin - Needs Sun JDK from /extra! +++"
  549.     MOZPLUGIN="NO"
  550.   fi
  551. fi
  552.  
  553. # ---------------------------------------------------------------------------
  554. # Source tarballs and source URLs.
  555. # Sources which are not patented should have SRCPAT[n]="NO"
  556. # Sources which are patented should have SRCPAT[n]="YES" which prevents then
  557. #   from being downloaded and used if we build a patent-free package.
  558. # ---------------------------------------------------------------------------
  559.  
  560. # VLC source
  561. if [ "$VERSION" == "HEAD"  ]; then
  562.   # We check out git's HEAD:
  563.   BRANCH="master"
  564.   GITURI=${DEFGITURI}
  565.   SRCVER=$(date +%Y%m%d)
  566.   SRCURL[0]=""
  567. elif [ "$(echo $VERSION | cut -c1-2)" == "20"  ]; then
  568.   # We check out git at a specific date:
  569.   BRANCH="master"
  570.   GITURI=${DEFGITURI}
  571.   SRCVER=$VERSION
  572.   SRCURL[0]=""
  573. elif [ "$(echo $VERSION| cut -d# -f2)" != "$VERSION"  ]; then
  574.   # VERSION has a hashmark it it (branchname@gituri#datestamp)
  575.   BRANCH="$(echo $VERSION| cut -d# -f1 |cut -d@ -f1)"
  576.   GITURI="$(echo $VERSION| cut -d# -f1 |cut -d@ -f2-)"
  577.   SRCVER="$(echo $VERSION| cut -d# -f2)"
  578.   if [ "x$GITURI" = "x$BRANCH" -o "x$GITURI" = "x" ]; then
  579.     GITURI=${DEFGITURI}
  580.   fi
  581.   if [ "x$BRANCH" = "x" ]; then BRANCH="master" ; fi
  582.   if [ "x$SRCVER" = "x" ]; then SRCVER=$(date +%Y%m%d) ; fi
  583.   SRCURL[0]=""
  584. else
  585.   BRANCH=""
  586.   GITURI=""
  587.   SRCVER=$VERSION
  588.   SRCURL[0]="http://download.videolan.org/pub/videolan/${PRGNAM}/${SRCVER}/${PRGNAM}-${SRCVER}.tar.xz"
  589. fi
  590. SOURCE[0]="$SRCDIR/${PRGNAM}-${SRCVER}.tar.xz"
  591. SRCPAT[0]="NO"
  592. USE[0]="YES"
  593.  
  594. # ffmpeg libraries
  595. SOURCE[1]="$SRCDIR/ffmpeg-${FFMPEG}.tar.bz2"
  596. SRCURL[1]="http://ffmpeg.mplayerhq.hu/releases/ffmpeg-${FFMPEG}.tar.bz2"
  597. #SRCURL[1]=""
  598. SRCPAT[1]="NO"
  599. USE[1]="YES"
  600.  
  601. # AMR de/encoder libraries used in ffmpeg to encode 3GPP audio
  602. SOURCE[2]="$SRCDIR/opencore-amr-${AMR}.tar.gz"
  603. SRCURL[2]="http://downloads.sourceforge.net/opencore-amr/opencore-amr-${AMR}.tar.gz"
  604. SRCPAT[2]="NO"
  605. USE[2]="YES"
  606.  
  607. # Kate - a karaoke/text stream overlay codec
  608. SOURCE[3]="$SRCDIR/libkate-${KATE}.tar.gz"
  609. SRCURL[3]="http://libkate.googlecode.com/files/libkate-${KATE}.tar.gz"
  610. SRCPAT[3]="NO"
  611. USE[3]="YES"
  612.  
  613. # Libtiger - A rendering library for Kate streams using Pango and Cairo
  614. SOURCE[4]="$SRCDIR/libtiger-${TIGER}.tar.gz"
  615. SRCURL[4]="http://libtiger.googlecode.com/files/libtiger-${TIGER}.tar.gz"
  616. SRCPAT[4]="NO"
  617. USE[4]="YES"
  618.  
  619. # Lua - embedded interpreter for lua playlist, metafetcher and interface plugins
  620. SOURCE[5]="$SRCDIR/lua-${LUA}.tar.gz"
  621. SRCURL[5]="http://www.lua.org/ftp/lua-${LUA}.tar.gz"
  622. SRCPAT[5]="NO"
  623. USE[5]="YES"
  624.  
  625. # Lame is used for the audio in FLV videos; will statically link with ffmpeg
  626. SOURCE[6]="$SRCDIR/lame-$LAME.tar.gz"
  627. SRCURL[6]="http://downloads.sourceforge.net/lame/lame-$LAME.tar.gz"
  628. SRCPAT[6]="YES"
  629. USE[6]="YES"
  630.  
  631. # DV video, used by most digital (firewire) camcorders:
  632. SOURCE[7]="$SRCDIR/libdv-${DV}.tar.gz"
  633. SRCURL[7]="http://downloads.sourceforge.net/libdv/libdv-${DV}.tar.gz"
  634. SRCPAT[7]="NO"
  635. USE[7]="YES"
  636.  
  637. # FAAC library, will be statically linked with ffmpeg
  638. SOURCE[8]="$SRCDIR/faac-$FAAC.tar.gz"
  639. SRCURL[8]="http://downloads.sourceforge.net/faac/faac-$FAAC.tar.gz"
  640. SRCPAT[8]="YES"
  641. USE[8]="YES"
  642.  
  643. # Qt4 is used for the GUI - VLC will link statically against it
  644. SOURCE[9]="$SRCDIR/qt-x11-opensource-src-$QT4.tar.gz"
  645. SRCURL[9]="http://get.qt.nokia.com/qt/source/qt-everywhere-opensource-src-${QT4}.tar.gz"
  646. SRCPAT[9]="NO"
  647. USE[9]="NO"
  648.  
  649. # FAAD2 support:
  650. SOURCE[10]="$SRCDIR/faad2-$FAAD2.tar.gz"
  651. SRCURL[10]="http://downloads.sourceforge.net/faac/faad2-$FAAD2.tar.gz"
  652. SRCPAT[10]="NO"
  653. USE[10]="YES"
  654.  
  655. # Matroska support:
  656. SOURCE[11]="$SRCDIR/libebml-$EBML.tar.bz2"
  657. SRCURL[11]="http://dl.matroska.org/downloads/libebml/libebml-$EBML.tar.bz2"
  658. SRCPAT[11]="NO"
  659. USE[11]="YES"
  660.  
  661. SOURCE[12]="$SRCDIR/libmatroska-$MATROSKA.tar.bz2"
  662. SRCURL[12]="http://dl.matroska.org/downloads/libmatroska/libmatroska-$MATROSKA.tar.bz2"
  663. SRCPAT[12]="NO"
  664. USE[12]="YES"
  665.  
  666. # libmpeg2
  667. SOURCE[13]="$SRCDIR/libmpeg2-$MPEG2DEC.tar.gz"
  668. SRCURL[13]="http://libmpeg2.sourceforge.net/files/libmpeg2-$MPEG2DEC.tar.gz"
  669. SRCPAT[13]="NO"
  670. USE[13]="YES"
  671.  
  672. # DVD support:
  673. SOURCE[14]="$SRCDIR/libdvdnav-$DVDNAV.tar.bz2"
  674. SRCURL[14]="http://dvdnav.mplayerhq.hu/releases/libdvdnav-${DVDNAV}.tar.bz2"
  675. #SRCURL[14]=""
  676. SRCPAT[14]="NO"
  677. USE[14]="YES"
  678.  
  679. SOURCE[15]="$SRCDIR/libdvdread-${DVDREAD}.tar.bz2"
  680. SRCURL[15]="http://dvdnav.mplayerhq.hu/releases/libdvdread-${DVDREAD}.tar.bz2"
  681. #SRCURL[15]=""
  682. SRCPAT[15]="NO"
  683. USE[15]="YES"
  684.  
  685. # CD media read/access support (including iso/cue/nrg formats):
  686. SOURCE[16]="$SRCDIR/libcdio-${CDIO}.tar.gz"
  687. SRCURL[16]="http://ftp.gnu.org/gnu/libcdio/libcdio-$CDIO.tar.gz"
  688. SRCPAT[16]="NO"
  689. USE[16]="YES"
  690.  
  691. # Since www.vcdimager.org is down, we use a GNU videolan mirror:
  692. SOURCE[17]="$SRCDIR/vcdimager-${VCD}.tar.gz"
  693. SRCURL[17]="http://ftp.gnu.org/gnu/vcdimager/vcdimager-$VCD.tar.gz"
  694. SRCPAT[17]="NO"
  695. USE[17]="YES"
  696.  
  697. # MP2 audio (de)coding support:
  698. SOURCE[18]="$SRCDIR/twolame-${TWOLAME}.tar.gz"
  699. SRCURL[18]="http://downloads.sourceforge.net/twolame/twolame-$TWOLAME.tar.gz"
  700. SRCPAT[18]="NO"
  701. USE[18]="YES"
  702.  
  703. # Musepack (MPC) audio demuxing support:
  704. SOURCE[19]="$SRCDIR/libmpcdec-${MPCDEC}.tar.bz2"
  705. #SRCURL[19]="http://files.musepack.net/source/libmpcdec-${MPCDEC}.tar.bz2"
  706. SRCURL[19]=""
  707. SRCPAT[19]="NO"
  708. USE[19]="YES"
  709.  
  710. # Orc (oil runtime compiler) is a dependency for schroedinger
  711. SOURCE[20]="$SRCDIR/orc-${ORC}.tar.gz"
  712. SRCURL[20]="http://code.entropywave.com/download/orc/orc-${ORC}.tar.gz"
  713. SRCPAT[20]="NO"
  714. USE[20]="YES"
  715.  
  716. # Dirac video codec support by schroedinger:
  717. SOURCE[21]="$SRCDIR/schroedinger-${SCHROEDINGER}.tar.gz"
  718. SRCURL[21]="http://www.diracvideo.org/download/schroedinger/schroedinger-${SCHROEDINGER}.tar.gz"
  719. SRCPAT[21]="NO"
  720. USE[21]="YES"
  721.  
  722. # CDDB lookups:
  723. SOURCE[22]="$SRCDIR/libcddb-${CDDB}.tar.bz2"
  724. SRCURL[22]="http://downloads.sourceforge.net/libcddb/libcddb-${CDDB}.tar.bz2"
  725. SRCPAT[22]="NO"
  726. USE[22]="YES"
  727.  
  728. # Act as a source client to Icecast/Shoutcast:
  729. SOURCE[23]="$SRCDIR/libshout-${SHOUT}.tar.gz"
  730. SRCURL[23]="http://downloads.us.xiph.org/releases/libshout/libshout-${SHOUT}.tar.gz"
  731. SRCPAT[23]="NO"
  732. USE[23]="YES"
  733.  
  734. # SPEEX is used by libshout and vlc:
  735. SOURCE[24]="$SRCDIR/speex-${SPEEX}.tar.gz"
  736. SRCURL[24]="http://downloads.us.xiph.org/releases/speex/speex-${SPEEX}.tar.gz"
  737. SRCPAT[24]="NO"
  738. USE[24]="YES"
  739.  
  740. # Goom, a visualisation library for audio player
  741. SOURCE[25]="$SRCDIR/goom-${GOOM}-src.tar.gz"
  742. SRCURL[25]="http://downloads.sourceforge.net/goom/goom-${GOOM}-src.tar.gz"
  743. SRCPAT[25]="NO"
  744. USE[25]="YES"
  745.  
  746. # GGI, output plugin
  747. SOURCE[26]="$SRCDIR/ggi-${GGI}-bundle.src.tar.bz2"
  748. SRCURL[26]="http://sourceforge.net/projects/ggi/files/bundle/GGI-${GGI}/ggi-${GGI}-bundle.src.tar.gz/download"
  749. SRCPAT[26]="NO"
  750. USE[26]="YES"
  751.  
  752. # X264 encoder - for H264/AVC video streams
  753. SOURCE[27]="$SRCDIR/x264-snapshot-${X264}.tar.bz2"
  754. SRCURL[27]="ftp://ftp.videolan.org/pub/videolan/x264/snapshots/x264-snapshot-${X264}.tar.bz2"
  755. SRCPAT[27]="NO"
  756. USE[27]="YES"
  757.  
  758. # The A52 decoder - aka AC3
  759. SOURCE[28]="$SRCDIR/a52dec-$A52.tar.gz"
  760. SRCURL[28]="http://liba52.sourceforge.net/files/a52dec-$A52.tar.gz"
  761. SRCPAT[28]="NO"
  762. USE[28]="YES"
  763.  
  764. # Live555 support:
  765. SOURCE[29]="$SRCDIR/live.${LIVE}.tar.gz"
  766. SRCURL[29]="http://live555sourcecontrol.googlecode.com/files/live.${LIVE}.tar.gz"
  767. SRCPAT[29]="NO"
  768. USE[29]="YES"
  769.  
  770. # Library needed to control IEEE 1394 (firewire-) based cameras
  771. SOURCE[30]="$SRCDIR/libraw1394-${RAW1394}.tar.gz"
  772. SRCURL[30]="http://downloads.sourceforge.net/libraw1394/libraw1394-${RAW1394}.tar.gz"
  773. SRCPAT[30]="NO"
  774. USE[30]="YES"
  775.  
  776. SOURCE[31]="$SRCDIR/libdc1394-${DC1394}.tar.gz"
  777. SRCURL[31]="http://downloads.sourceforge.net/libdc1394/libdc1394-${DC1394}.tar.gz"
  778. SRCPAT[31]="NO"
  779. USE[31]="YES"
  780.  
  781. SOURCE[32]="$SRCDIR/libavc1394-${AVC1394}.tar.gz"
  782. SRCURL[32]="http://downloads.sourceforge.net/libavc1394/libavc1394-${AVC1394}.tar.gz"
  783. SRCPAT[32]="NO"
  784. USE[32]="YES"
  785.  
  786. # Library designed for decoding and generation of MPEG TS and DVB PSI tables.
  787. SOURCE[33]="$SRCDIR/libdvbpsi-${DVBPSI}.tar.bz2"
  788. SRCURL[33]="http://download.videolan.org/pub/libdvbpsi/${DVBPSI}/libdvbpsi-${DVBPSI}.tar.bz2"
  789. SRCPAT[33]="NO"
  790. USE[33]="YES"
  791.  
  792. # a free DTS Coherent Acoustics decoder
  793. SOURCE[34]="$SRCDIR/libdca-${DCA}.tar.bz2"
  794. SRCURL[34]="http://download.videolan.org/pub/videolan/libdca/${DCA}/libdca-${DCA}.tar.bz2"
  795. SRCPAT[34]="NO"
  796. USE[34]="YES"
  797.  
  798. # Theora encoder/decoder libraries
  799. SOURCE[35]="$SRCDIR/libtheora-${THEORA}.tar.gz"
  800. SRCURL[35]="http://downloads.xiph.org/releases/theora/libtheora-${THEORA}.tar.gz"
  801. SRCPAT[35]="NO"
  802. USE[35]="YES"
  803.  
  804. # Universal Plug'n'Play
  805. SOURCE[36]="$SRCDIR/libupnp-${UPNP}.tar.bz2"
  806. SRCURL[36]="http://downloads.sourceforge.net/pupnp/libupnp-${UPNP}.tar.bz2"
  807. SRCPAT[36]="NO"
  808. USE[36]="YES"
  809.  
  810. # DAAP support (iTunes)
  811. SOURCE[37]="$SRCDIR/libopendaap-${DAAP}.tar.bz2"
  812. # This one seems not the right daap lib...:
  813. #SRCURL[37]="http://downloads.sourceforge.net/daap/libopenndaap-${DAAP}.tar.bz2"
  814. SRCURL[37]="http://crazney.net/programs/itunes/files/libopendaap-${DAAP}.tar.bz2"
  815. SRCPAT[37]="NO"
  816. USE[37]="YES"
  817.  
  818. # Libass - portable library for SSA/ASS subtitles rendering
  819. SOURCE[38]="$SRCDIR/libass-$ASS.tar.xz"
  820. SRCURL[38]="http://libass.googlecode.com/files/libass-$ASS.tar.xz"
  821. SRCPAT[38]="NO"
  822. USE[38]="YES"
  823.  
  824. # FluidSynth - midi playback
  825. SOURCE[39]="$SRCDIR/fluidsynth-${FLUID}.tar.bz2"
  826. SRCURL[39]="http://downloads.sourceforge.net/fluidsynth/fluidsynth-${FLUID}.tar.bz2"
  827. SRCPAT[39]="NO"
  828. USE[39]="YES"
  829.  
  830. # libv4l: Collection of video4linux support libraries
  831. SOURCE[40]="$SRCDIR/v4l-utils-${V4L}.tar.bz2"
  832. SRCURL[40]="http://linuxtv.org/downloads/v4l-utils/v4l-utils-${V4L}.tar.bz2"
  833. SRCPAT[40]="NO"
  834. USE[40]="YES"
  835.  
  836. # projectM: visualisation plugin
  837. SOURCE[41]="$SRCDIR/projectM-${PROJECTM}-Source.tar.gz"
  838. SRCURL[41]="http://sourceforge.net/projects/projectm/files/${PROJECTM}/projectM-${PROJECTM}-Source.tar.gz/download"
  839. SRCPAT[41]="NO"
  840. USE[41]="YES"
  841.  
  842. # VAAPI for video hardware acceleration:
  843. SOURCE[42]="$SRCDIR/libva_${LIBVA}.tar.gz"
  844. SRCURL[42]="http://www.splitted-desktop.com/~gbeauchesne/libva/libva_${LIBVA}.tar.gz"
  845. SRCPAT[42]="NO"
  846. USE[42]="YES"
  847.  
  848. # Mozilla xulrunner is used to build the browser plugin:
  849. SOURCE[43]="$SRCDIR/xulrunner-${XUL}.source.tar.bz2"
  850. SRCURL[43]="http://ftp.mozilla.org/pub/mozilla.org/mozilla.org/xulrunner/releases/${XUL}/source/xulrunner-${XUL}.source.tar.bz2"
  851. SRCPAT[43]="NO"
  852. USE[43]="YES"
  853.  
  854. # Google's VP8 codec:
  855. SOURCE[44]="$SRCDIR/libvpx-${VPX}.tar.bz2"
  856. SRCURL[44]="http://webm.googlecode.com/files/libvpx-${VPX}.tar.bz2"
  857. #SRCURL[44]=""
  858. SRCPAT[44]="NO"
  859. USE[44]="YES"
  860.  
  861. # VisualOn AAC encoding library, for AAC (MP4 audio) encoding
  862. SOURCE[45]="$SRCDIR/vo-aacenc-$AACENC.tar.gz"
  863. SRCURL[45]="http://downloads.sourceforge.net/opencore-amr/vo-aacenc-$AACENC.tar.gz"
  864. SRCPAT[45]="YES"
  865. USE[45]="YES"
  866.  
  867. # AMR-WB encoder libraries used to encode 3GPP audio
  868. SOURCE[46]="$SRCDIR/vo-amrwbenc-${AMRWBENC}.tar.gz"
  869. SRCURL[46]="http://downloads.sourceforge.net/opencore-amr/vo-amrwbenc-${AMRWBENC}.tar.gz"
  870. SRCPAT[46]="NO"
  871. USE[46]="YES"
  872.  
  873. # The browser plugin source has been separated from VLC:
  874. SOURCE[47]="$SRCDIR/npapi-vlc-${NPAPI}.tar.xz"
  875. SRCURL[47]="http://download.videolan.org/pub/videolan/vlc/${NPAPI}/npapi-vlc-${NPAPI}.tar.xz"
  876. SRCPAT[47]="NO"
  877. USE[47]="YES"
  878.  
  879. # Bluray support library (for unencrypted content):
  880. SOURCE[48]="$SRCDIR/libbluray-${BLURAY}.tar.bz2"
  881. SRCURL[48]="ftp://ftp.videolan.org/pub/videolan/libbluray/${BLURAY}/libbluray-${BLURAY}.tar.bz2"
  882. SRCPAT[48]="NO"
  883. USE[48]="YES"
  884.  
  885. # Unicode BiDirectional algorithm library, requirement for libass.
  886. SOURCE[49]="$SRCDIR/fribidi-${FRIBIDI}.tar.gz"
  887. SRCURL[49]="http://fribidi.org/download/fribidi-${FRIBIDI}.tar.gz"
  888. SRCPAT[49]="NO"
  889. USE[49]="YES"
  890.  
  891. # librtmp library, supporting RTMP (flash) streams
  892. SOURCE[50]="$SRCDIR/rtmpdump-${RTMP}.tar.gz"
  893. SRCURL[50]="http://rtmpdump.mplayerhq.hu/download/rtmpdump-${RTMP}.tgz"
  894. SRCPAT[50]="NO"
  895. USE[50]="YES"
  896.  
  897. # GSM support:
  898. SOURCE[51]="$SRCDIR/gsm-$GSM.tar.gz"
  899. SRCURL[51]="http://osxwinebuilder.googlecode.com/files/gsm-$GSM.tar.gz"
  900. SRCPAT[51]="NO"
  901. USE[51]="YES"
  902.  
  903. # CSS decoding- VLC can do without if you install an external libdvdcss package.
  904. SOURCE[52]="$SRCDIR/libdvdcss-${DVDCSS}.tar.bz2"
  905. SRCURL[52]="http://download.videolan.org/pub/libdvdcss/${DVDCSS}/libdvdcss-${DVDCSS}.tar.bz2"
  906. SRCPAT[52]="YES"
  907. USE[52]="YES"
  908.  
  909. # Use the src_checkout() function if no downloadable tarball exists.
  910. # This function checks out sources from SVN/CVS and creates a tarball of them.
  911. src_checkout() {
  912.   # Param #1 : index in the SOURCE[] array.
  913.   # Param #2 : full path to where SOURCE[$1] tarball should be created.
  914.   # Determine the tarball extension:
  915.   PEXT=$(echo "${2}" | sed -r -e 's/.*[^.].(tar.xz|tar.gz|tar.bz2|tgz).*/\1/')
  916.   case "$PEXT" in
  917.     "tar.xz") TARCOMP="J" ;;
  918.     "tar.gz") TARCOMP="z" ;;
  919.     "tgz") TARCOMP="z" ;;
  920.     "tar.bz2") TARCOMP="j" ;;
  921.     *) echo "Archive can only have extension 'tar.xz', '.tar.gz' '.tar.bz2' or '.tgz'" ; exit 1 ;;
  922.   esac
  923.   case ${1} in
  924.   0) # vlc-$SRCVER
  925.      mkdir vlc_temp_checkout_$$ \
  926.        && cd vlc_temp_checkout_$$
  927.  
  928.        if [ "$VERSION" = "HEAD" -o "$VERSION" = "HEAD@" -o "$VERSION" = "master@" ]; then
  929.          # Checkout without downloading version history (fast!):
  930.          echo "Checking out HEAD from '$GITURI':"
  931.          git clone --depth=1 ${GITURI} vlc-${SRCVER}
  932.        else
  933.          # Checkout code from a certain branch and/or date; this will take a
  934.          # long time because we have to clone the complete git-repository first:
  935.          echo "Checking out $BRANCH at date $SRCVER from '$GITURI':"
  936.          git clone ${GITURI} vlc-${SRCVER} \
  937.          && cd vlc-${SRCVER} \
  938.          && git checkout $BRANCH \
  939.          && git checkout $(git rev-list -n 1 --before="`date -d $SRCVER`" $BRANCH) \
  940.          && cd ..
  941.        fi
  942.        chown -R root:root . \
  943.        && tar -${TARCOMP}cf ${2} vlc-${SRCVER}
  944.        # 20110824: vlc from git won't compile unless there is .git directory
  945.        # && tar --exclude .git -${TARCOMP}cf ${2} vlc-${SRCVER}
  946.      cd ..
  947.      rm -rf vlc_temp_checkout_$$
  948.      # If VERSION was "HEAD" we still want a date to appear in the pkgname:
  949.      VERSION=${SRCVER}
  950.      ;;
  951.   1) # ffmpeg-$FFMPEG
  952.      # Run 'cd libscwale; svn propget -R svn:externals .' to see that the
  953.      # libscscale directory is in fact a separate external svn URL!
  954.      local SVNURL=svn://svn.mplayerhq.hu/ffmpeg/trunk
  955.      if [ "$(echo ${FFMPEG}|cut -c1)" == 'r' ]; then # revision instead of date
  956.        REV=$(echo ${FFMPEG} | cut -c2-)
  957.        # We will checkout libscscale snapshot of the same date as our ffmpeg
  958.        # snapshot (otherwise we will get libswscale's HEAD) unless we have set
  959.        # SWSCALE to a non-empty value:
  960.        SWREV="{${SWSCALE:-$(svn info $SVNURL |grep "Last Changed Date:" |cut -d' ' -f4)}}"
  961.      else
  962.        REV="{${FFMPEG}}"
  963.        SWREV=${SWSCALE:-$REV}
  964.      fi
  965.      mkdir ffmpeg-${FFMPEG} \
  966.        && cd ffmpeg-${FFMPEG} \
  967.        && svn checkout --revision $REV svn://svn.mplayerhq.hu/ffmpeg/trunk . \
  968.        && cd libswscale \
  969.        && svn update --revision $SWREV \
  970.        && cd .. \
  971.        && chown -R root:root . \
  972.        && cd .. \
  973.        && tar --exclude .svn -${TARCOMP}cf ${2} ffmpeg-${FFMPEG}
  974.      rm -rf ffmpeg-${FFMPEG}
  975.      unset SVNURL
  976.      ;;
  977.  14) # libdvdnav-$DVDNAV
  978.      local SVNURL=svn://svn.mplayerhq.hu/dvdnav/trunk/libdvdnav
  979.      if [ "$(echo ${DVDNAV}|cut -c1)" == 'r' ]; then # revision instead of date
  980.        REV=$(echo ${DVDNAV} | cut -c2-)
  981.      else
  982.        REV="{${DVDNAV}}"
  983.      fi
  984.      mkdir libdvdnav-${DVDNAV} \
  985.        && cd libdvdnav-${DVDNAV} \
  986.        && svn checkout --revision $REV $SVNURL . \
  987.        && chown -R root:root . \
  988.        && cd .. \
  989.        && tar --exclude .svn -${TARCOMP}cf ${2} libdvdnav-${DVDNAV}
  990.      rm -rf libdvdnav-${DVDNAV}
  991.      unset SVNURL
  992.      ;;
  993.  15) # libdvdread-$DVDREAD
  994.      if [ "$(echo ${DVDREAD}|cut -c1)" == 'r' ]; then # revision instead of date
  995.        REV=$(echo ${DVDREAD} | cut -c2-)
  996.      else
  997.        REV="{${DVDREAD}}"
  998.      fi
  999.      mkdir libdvdread-${DVDREAD} \
  1000.        && cd libdvdread-${DVDREAD} \
  1001.        && svn checkout --revision $REV svn://svn.mplayerhq.hu/dvdnav/trunk/libdvdread . \
  1002.        && find . -type d -name '.svn' -depth | xargs rm -rf \
  1003.        && chown -R root:root . \
  1004.        && cd .. \
  1005.        && tar -${TARCOMP}cf ${2} libdvdread-${DVDREAD}
  1006.      rm -rf libdvdread-${DVDREAD}
  1007.      ;;
  1008.  19) # libmpcdec-$MPCDEC
  1009.      local SVNURL=http://svn.musepack.net/libmpc/trunk/
  1010.      if [ "$(echo ${MPCDEC}|cut -c1)" == 'r' ]; then # revision instead of date
  1011.        REV=$(echo ${MPCDEC} | cut -c2-)
  1012.      else
  1013.        REV="{${MPCDEC}}"
  1014.      fi
  1015.      mkdir libmpcdec-${MPCDEC} \
  1016.        && cd libmpcdec-${MPCDEC} \
  1017.        && svn checkout --revision $REV $SVNURL . \
  1018.        && chown -R root:root . \
  1019.        && cd .. \
  1020.        && tar --exclude .svn -${TARCOMP}cf ${2} libmpcdec-${MPCDEC}
  1021.      rm -rf libmpcdec-${MPCDEC}
  1022.      unset SVNURL
  1023.      ;;
  1024.   44) # We clone the git of libvpx at a certain date:
  1025.      mkdir libvpx-${VPX} \
  1026.        && cd libvpx-${VPX} \
  1027.        && git clone git://review.webmproject.org/libvpx.git . \
  1028.        && git checkout $(git rev-list -n 1 --before="`date -d $VPX`" master) \
  1029.        && chown -R root:root . \
  1030.        && cd .. \
  1031.        && tar --exclude .git -${TARCOMP}cf ${2} libvpx-${VPX}
  1032.      rm -rf libvpx-${VPX}
  1033.      ;;
  1034.   47) # We clone the git of npapi-vlc at a certain date:
  1035.      mkdir npapi-vlc-${NPAPI} \
  1036.        && cd npapi-vlc-${NPAPI} \
  1037.        && git clone git://git.videolan.org/npapi-vlc.git . \
  1038.        && git checkout $(git rev-list -n 1 --before="`date -d $NPAPI`" master) \
  1039.        && chown -R root:root . \
  1040.        && cd .. \
  1041.        && tar --exclude .git -${TARCOMP}cf ${2} npapi-vlc-${NPAPI}
  1042.      rm -rf npapi-vlc-${NPAPI}
  1043.      ;;
  1044.   48) # We clone the git of libbluray at a certain date:
  1045.      mkdir libbluray-${BLURAY} \
  1046.        && cd libbluray-${BLURAY} \
  1047.        && git clone git://git.videolan.org/libbluray.git . \
  1048.        && git checkout $(git rev-list -n 1 --before="`date -d $BLURAY`" master) \
  1049.        && chown -R root:root . \
  1050.        && cd .. \
  1051.        && tar --exclude .git -${TARCOMP}cf ${2} libbluray-${BLURAY}
  1052.      rm -rf libbluray-${BLURAY}
  1053.      ;;
  1054.   *) # Do nothing
  1055.      ;;
  1056.   esac
  1057. }
  1058.  
  1059. if [ "${USE_PATENTS}" == "YES" ]; then
  1060.   echo ""
  1061.   echo "**"
  1062.   echo "** This build uses patented code (MP3 / AMR / AAC encoders)"
  1063.   echo "** Run the command 'USE_PATENTS=NO $0 $*' to avoid patent issues."
  1064.   echo "**"
  1065.   echo ""
  1066.   sleep 1
  1067. fi
  1068.  
  1069. ##
  1070. ## --- with a little luck, you won't have to edit below this point --- ##
  1071. ##
  1072.  
  1073. # Exit the script on errors:
  1074. set -e
  1075. trap 'echo "$0 FAILED at line $LINENO!" | tee $OUTPUT/error-${PRGNAM}.log' ERR
  1076. # Catch unitialized variables:
  1077. set -u
  1078. P1=${1:-1}
  1079.  
  1080. # Create working directories:
  1081. mkdir -p $TMP/tmp-$PRGNAM # location to build the source
  1082. mkdir -p $PKG             # place for the package to be built
  1083. rm -rf $PKG/*             # We always erase old package's contents:
  1084. mkdir -p $OUTPUT          # place for the package to be saved
  1085.  
  1086. if [ "$P1" != "--oldbuild" -a  "$P1" != "--download" ]; then
  1087.   # If the "--oldbuild" parameter is present, we keep
  1088.   #  the old build files and continue;
  1089.   # By default we remove the remnants of previous build and continue:
  1090.   echo -e "**\n**  Cleaning up old build ...\n**"
  1091.   rm -rf $TMP/tmp-$PRGNAM/*
  1092.   rm -f $OUTPUT/*${PRGNAM}*.log   # Delete old logfiles
  1093. fi
  1094.  
  1095. # We may not need to download and unpack the Qt4 sources:
  1096. if [ "$STATIC_QT4" != "NO" ]; then
  1097.   echo "**"
  1098.   echo "** Building with a static QT4..."
  1099.   echo "**"
  1100.   USE[9]="YES"
  1101. fi
  1102.  
  1103. # We may not need to download and unpack the ffmpeg sources:
  1104. if [ "$STATIC_FFMPEG" != "YES" ]; then
  1105.   echo "**"
  1106.   echo "** Not building static FFMPEG plus dependencies..."
  1107.   echo "**"
  1108.   USE[1]="NO" # ffmpeg
  1109.   USE[2]="NO" # opencore-amr
  1110.   USE[6]="NO" # lame
  1111.   USE[8]="NO" # faac
  1112.   USE[35]="NO" # theora
  1113.   USE[44]="NO" # vpx
  1114.   USE[45]="NO" # aacenc
  1115.   USE[46]="NO" # vo-amrwb
  1116.   USE[50]="NO" # rtmp
  1117.   USE[51]="NO" # gsm
  1118. fi
  1119.  
  1120. # Source file availability:
  1121. for (( i = 0; i < ${#SOURCE[*]}; i++ )) ; do
  1122.   # Do we actually use this source?
  1123.   [ "${USE[$i]}" = "YES" ] || continue
  1124.   # Only download patented code if we are allowing it:
  1125.   if [ "${USE_PATENTS}" == "YES" -o "${SRCPAT[$i]}" != "YES" ]; then
  1126.     if ! [ -f ${SOURCE[$i]} ]; then
  1127.       echo "Source '$(basename ${SOURCE[$i]})' not available yet..."
  1128.       # Check if the $SRCDIR is writable at all - if not, download to $OUTPUT
  1129.       [ -w "$SRCDIR" ] || SOURCE[$i]="$OUTPUT/$(basename ${SOURCE[$i]})"
  1130.       if ! [ "x${SRCURL[$i]}" == "x" ]; then
  1131.         echo "Will download file to $(dirname $SOURCE[$i])"
  1132.         if ! $(wget -nv -T 20 -O "${SOURCE[$i]}" "${SRCURL[$i]}"); then
  1133.           echo "Downloading '$(basename ${SOURCE[$i]})' failed.. aborting the build."
  1134.           mv -f "${SOURCE[$i]}" "${SOURCE[$i]}".FAIL
  1135.           exit 1
  1136.         fi
  1137.       else
  1138.         # Try if we have a SVN/CVS download routine for ${SOURCE[$i]}
  1139.         echo "Will checkout sources to $(dirname $SOURCE[$i])"
  1140.         src_checkout $i "${SOURCE[$i]}" 2>&1 |tee $OUTPUT/checkout-$(basename ${SOURCE[$i]}).log
  1141.       fi
  1142.       if [ ! -f "${SOURCE[$i]}" -o ! -s "${SOURCE[$i]}" ]; then
  1143.         echo "File '$(basename ${SOURCE[$i]})' not available.. aborting the build."
  1144.         exit 1
  1145.       fi
  1146.     fi
  1147.   fi
  1148. done
  1149.  
  1150. if [ "$P1" == "--download" ]; then
  1151.   echo "Download complete."
  1152.   exit 0
  1153. fi
  1154.  
  1155. # Package building:
  1156. echo "++"
  1157. echo "|| $PRGNAM-$VERSION"
  1158. echo "++"
  1159.  
  1160. cd $TMP/tmp-$PRGNAM
  1161. if [ "$P1" != "--oldbuild" ]; then
  1162.   echo "Extracting the source archive(s) for $PRGNAM..."
  1163.   for (( i = 0; i < ${#SOURCE[*]}; i++ )) ; do
  1164.     # Do we actually use this source?
  1165.     [ "${USE[$i]}" = "YES" ] || continue
  1166.     # Only extract and use patented code if we are allowing it:
  1167.     if [ "${USE_PATENTS}" == "YES" -o "${SRCPAT[$i]}" != "YES" ]; then
  1168.       if $(file ${SOURCE[$i]} | grep -iq ": zip"); then
  1169.         unzip ${SOURCE[$i]}
  1170.       else
  1171.         tar -xvf ${SOURCE[$i]}
  1172.       fi
  1173.     fi
  1174.   done
  1175.   chown -R root:root *
  1176.   chmod -R u+w,go+r-w,a+X-s *
  1177. fi
  1178.  
  1179. # Building the source code:
  1180. echo Building ...
  1181.  
  1182. # We will be installing static libs into the following directory:
  1183. mkdir -p $VLCDEPSDIR/usr/{bin,doc,include,lib,man}
  1184.  
  1185. # -----------------------------------------------------------------------------
  1186. # Compile theora libraries
  1187. # The ffmpeg will use these
  1188. # -----------------------------------------------------------------------------
  1189. make_theora()
  1190. {
  1191. echo -e "**\n**  theora ...\n**"
  1192. cd $TMP/tmp-$PRGNAM/libtheora-${THEORA}
  1193.  
  1194. # Don't build documentation and other crap:
  1195. sed -i -e "s/doc tests / /" Makefile*
  1196.  
  1197. CFLAGS="$SLKCFLAGS" \
  1198. CXXFLAGS="$SLKCFLAGS" \
  1199. LDFLAGS="$SLKLDFLAGS" \
  1200. ./configure \
  1201.   --prefix=$VLCDEPSDIR/usr \
  1202.   --libdir=$VLCDEPSDIR/usr/lib${LIBDIRSUFFIX} \
  1203.   --enable-static \
  1204.   --disable-shared \
  1205.   --disable-examples \
  1206.   --program-prefix= \
  1207.   --program-suffix= \
  1208.   --build=$ARCH-slackware-linux \
  1209.   2>&1 | tee $OUTPUT/configure-${PRGNAM}_theora.log
  1210. make -j${NUMJOBS} 2>&1 | tee $OUTPUT/make-${PRGNAM}_theora.log
  1211. # Install theora into a temp location so ffmpeg can pickup the library
  1212. make install 2>&1 | tee -a $OUTPUT/make-${PRGNAM}_theora.log
  1213. # Add DOCS to the vlcdeps to have it added to vlc package later:
  1214. mkdir -p $VLCDEPSDIR/doc/libtheora/
  1215. cp AUTHORS CHANGES COPYING LICENSE README \
  1216.   $VLCDEPSDIR/doc/libtheora/ || true
  1217. cd -
  1218. }
  1219.  
  1220. # -----------------------------------------------------------------------------
  1221. # Compile lame libraries
  1222. # The ffmpeg will use these
  1223. # -----------------------------------------------------------------------------
  1224. make_lame()
  1225. {
  1226. echo -e "**\n**  lame ...\n**"
  1227. cd $TMP/tmp-$PRGNAM/lame-${LAME}
  1228. CFLAGS="$SLKCFLAGS" \
  1229. CXXFLAGS="$SLKCFLAGS" \
  1230. LDFLAGS="$SLKLDFLAGS" \
  1231. ./configure \
  1232.   --prefix=$VLCDEPSDIR/usr \
  1233.   --libdir=$VLCDEPSDIR/usr/lib${LIBDIRSUFFIX} \
  1234.   --enable-static \
  1235.   --disable-shared \
  1236.   --program-prefix= \
  1237.   --program-suffix= \
  1238.   --build=$ARCH-slackware-linux \
  1239.   2>&1 | tee $OUTPUT/configure-${PRGNAM}_lame.log
  1240. make -j${NUMJOBS} 2>&1 | tee $OUTPUT/make-${PRGNAM}_lame.log
  1241. # Install lame into a temp location so ffmpeg can pickup the library
  1242. make install 2>&1 | tee -a $OUTPUT/make-${PRGNAM}_lame.log
  1243. # Add DOCS to the vlcdeps to have it added to vlc package later:
  1244. mkdir -p $VLCDEPSDIR/doc/lame/
  1245. cp API COPYING ChangeLog* DEFINES HACKING LICENSE README* STYLEGUIDE TODO \
  1246.   $VLCDEPSDIR/doc/lame/ || true
  1247. cd -
  1248. }
  1249.  
  1250. # -----------------------------------------------------------------------------
  1251. # Compile faac library
  1252. # The ffmpeg will use these
  1253. # -----------------------------------------------------------------------------
  1254. make_faac()
  1255. {
  1256. echo -e "**\n**  faac ...\n**"
  1257. cd $TMP/tmp-$PRGNAM/faac-$FAAC
  1258.  
  1259. # Newer gcc/glibc will bail out otherwise:
  1260. cat $SRCDIR/faac_gcc44.diff | patch -p1 --verbose \
  1261.   2>&1 | tee $OUTPUT/patch-${PRGNAM}_faac.log
  1262.  
  1263. #sh bootstrap
  1264. CFLAGS="$SLKCFLAGS" \
  1265. CXXFLAGS="$SLKCFLAGS" \
  1266. LDFLAGS="$SLKLDFLAGS" \
  1267. ./configure \
  1268.   --prefix=$VLCDEPSDIR/usr \
  1269.   --libdir=$VLCDEPSDIR/usr/lib${LIBDIRSUFFIX} \
  1270.   --enable-static \
  1271.   --disable-shared \
  1272.   --with-mp4v2 \
  1273.   --program-prefix= \
  1274.   --program-suffix= \
  1275.   --build=$ARCH-slackware-linux \
  1276.   2>&1 | tee $OUTPUT/configure-${PRGNAM}_faac.log
  1277. make -j${NUMJOBS} 2>&1 | tee $OUTPUT/make-${PRGNAM}_faac.log
  1278. # Install faac into a temp location so ffmpeg can pickup the library
  1279. make install 2>&1 | tee -a $OUTPUT/make-${PRGNAM}_faac.log
  1280. # Add DOCS to the vlcdeps to have it added to vlc package later:
  1281. mkdir -p $VLCDEPSDIR/doc/faac/
  1282. cp AUTHORS COPYING ChangeLog NEWS README TODO \
  1283.   $VLCDEPSDIR/doc/faac/ || true
  1284. cd -
  1285. }
  1286.  
  1287. # -----------------------------------------------------------------------------
  1288. # Compile amr wideband/narrowband library
  1289. # The ffmpeg will use these
  1290. # -----------------------------------------------------------------------------
  1291. make_amr()
  1292. {
  1293. echo -e "**\n**  amr ...\n**"
  1294. cd $TMP/tmp-$PRGNAM/opencore-amr-${AMR}
  1295. LDFLAGS="$SLKLDFLAGS" \
  1296. CXXFLAGS="$SLKCFLAGS" \
  1297. CFLAGS="$SLKCFLAGS" \
  1298. ./configure \
  1299.   --prefix=$VLCDEPSDIR/usr \
  1300.   --libdir=$VLCDEPSDIR/usr/lib${LIBDIRSUFFIX} \
  1301.   --mandir=$VLCDEPSDIR/usr/man \
  1302.   --disable-shared \
  1303.   --program-prefix= \
  1304.   --program-suffix= \
  1305.   --build=$ARCH-slackware-linux \
  1306.   2>&1 | tee $OUTPUT/configure-${PRGNAM}_amr.log
  1307. make -j$NUMJOBS 2>&1 | tee $OUTPUT/make-${PRGNAM}_amr.log
  1308. make install PREFIX=$VLCDEPSDIR/usr LIBDIR=$VLCDEPSDIR/usr/lib${LIBDIRSUFFIX} \
  1309.   2>&1 | tee -a $OUTPUT/make-${PRGNAM}_amr.log
  1310. # Add DOCS to the vlcdeps to have it added to vlc package later:          
  1311. mkdir -p $VLCDEPSDIR/doc/amr
  1312. cp -a AUTHORS COPYING ChangeLog LICENSE NEWS README \
  1313.   $VLCDEPSDIR/doc/amr || true
  1314. cd -
  1315. }
  1316.  
  1317. # -----------------------------------------------------------------------------
  1318. # Compile VisualOn amr wideband encoder library
  1319. # The ffmpeg will use these
  1320. # -----------------------------------------------------------------------------
  1321. make_amrwbenc()
  1322. {
  1323. echo -e "**\n**  amrwbenc ...\n**"
  1324. cd $TMP/tmp-$PRGNAM/vo-amrwbenc-${AMRWBENC}
  1325. LDFLAGS="$SLKLDFLAGS" \
  1326. CXXFLAGS="$SLKCFLAGS" \
  1327. CFLAGS="$SLKCFLAGS" \
  1328. ./configure \
  1329.   --prefix=$VLCDEPSDIR/usr \
  1330.   --libdir=$VLCDEPSDIR/usr/lib${LIBDIRSUFFIX} \
  1331.   --mandir=$VLCDEPSDIR/usr/man \
  1332.   --disable-shared \
  1333.   --program-prefix= \
  1334.   --program-suffix= \
  1335.   --build=$ARCH-slackware-linux \
  1336.   2>&1 | tee $OUTPUT/configure-${PRGNAM}_amrwbenc.log
  1337. make -j$NUMJOBS 2>&1 | tee $OUTPUT/make-${PRGNAM}_amrwbenc.log
  1338. make install $VLCDEPSDIR/PREFIX=/usr LIBDIR=$VLCDEPSDIR/usr/lib${LIBDIRSUFFIX} \
  1339.   2>&1 | tee -a $OUTPUT/make-${PRGNAM}_amrwbenc.log
  1340. # Add DOCS to the vlcdeps to have it added to vlc package later:          
  1341. mkdir -p $VLCDEPSDIR/doc/amrwbenc
  1342. cp -a AUTHORS COPYING ChangeLog LICENSE NEWS README \
  1343.   $VLCDEPSDIR/doc/amrwbenc || true
  1344. cd -
  1345. }
  1346.  
  1347.  
  1348. # -----------------------------------------------------------------------------
  1349. # Compile aacenc library
  1350. # The ffmpeg will use these
  1351. # -----------------------------------------------------------------------------
  1352. make_aacenc()
  1353. {
  1354. echo -e "**\n**  aacenc ...\n**"
  1355. cd $TMP/tmp-$PRGNAM/vo-aacenc-${AACENC}
  1356.  
  1357. CFLAGS="$SLKCFLAGS" \
  1358. CXXFLAGS="$SLKCFLAGS" \
  1359. LDFLAGS="$SLKLDFLAGS" \
  1360. ./configure \
  1361.   --prefix=$VLCDEPSDIR/usr \
  1362.   --libdir=$VLCDEPSDIR/usr/lib${LIBDIRSUFFIX} \
  1363.   --enable-static \
  1364.   --disable-shared \
  1365.   --program-prefix= \
  1366.   --program-suffix= \
  1367.   --build=$ARCH-slackware-linux \
  1368.   2>&1 | tee $OUTPUT/configure-${PRGNAM}_aacenc.log
  1369. make -j${NUMJOBS} 2>&1 | tee $OUTPUT/make-${PRGNAM}_aacenc.log
  1370. # Install aacenc into a temp location so ffmpeg can pickup the library
  1371. make install 2>&1 | tee -a $OUTPUT/make-${PRGNAM}_aacenc.log
  1372. # Add DOCS to the vlcdeps to have it added to vlc package later:
  1373. mkdir -p $VLCDEPSDIR/doc/aacenc
  1374. cp -a AUTHORS COPYING* ChangeLog NEWS NOTICE README \
  1375.   $VLCDEPSDIR/doc/aacenc || true
  1376. cd -
  1377. }
  1378.  
  1379.  
  1380. # -----------------------------------------------------------------------------
  1381. # Compile rtmpdump
  1382. # -----------------------------------------------------------------------------
  1383. make_rtmp()
  1384. {
  1385. echo -e "**\n**  rtmp ...\n**"
  1386. cd $TMP/tmp-$PRGNAM/rtmpdump-$RTMP
  1387. make -C librtmp prefix=/usr OPT="$SLKCFLAGS" all librtmp.pc \
  1388.   2>&1 | tee $OUTPUT/make-${PRGNAM}_rtmp.log
  1389. # Install librtmp into a temp location so ffmpeg can pickup the library
  1390. echo -e "\n**\n**\n"
  1391. mkdir -p $VLCDEPSDIR/usr/{include/librtmp,lib${LIBDIRSUFFIX}/pkgconfig}
  1392. cp -a librtmp/librtmp.a $VLCDEPSDIR/usr/lib${LIBDIRSUFFIX}
  1393. cp -a librtmp/{amf.h,http.h,log.h,rtmp.h} $VLCDEPSDIR/usr/include/librtmp
  1394. cp -a librtmp/librtmp.pc $VLCDEPSDIR/usr/lib${LIBDIRSUFFIX}/pkgconfig
  1395. # Add DOCS to the vlcdeps to have it added to vlc package later:
  1396. mkdir -p $VLCDEPSDIR/doc/rtmp
  1397. cp -a AUTHORS COPYING ChangeLog README $VLCDEPSDIR/doc/rtmp/ || true
  1398. cd -
  1399. }
  1400.  
  1401.  
  1402. # -----------------------------------------------------------------------------
  1403. # Compile gsm
  1404. # -----------------------------------------------------------------------------
  1405. make_gsm()
  1406. {
  1407. echo -e "**\n**  gsm  ...\n**"
  1408. GSMMAJ=$(echo $GSM | cut -d. -f1,2)
  1409. GSMPL=$(echo $GSM | cut -d. -f3)
  1410. mv $TMP/tmp-$PRGNAM/gsm-${GSMMAJ}-pl${GSMPL} $TMP/tmp-$PRGNAM/gsm-${GSM}
  1411. cd $TMP/tmp-$PRGNAM/gsm-${GSM}
  1412. # Without this, x86_64 builds will fail:
  1413. sed -i -e "/^CCFLAGS/s,-O2 ,$SLKCFLAGS ," \
  1414.        -e "s,^# LDFLAGS.*,LDFLAGS = $SLKLDFLAGS," Makefile
  1415. make -j${NUMJOBS} 2>&1 | tee $OUTPUT/make-${PRGNAM}_gsm.log
  1416. # Install gsm into a temp location so ffmpeg can pickup the library
  1417. make install 2>&1 | tee -a $OUTPUT/make-${PRGNAM}_gsm.log
  1418. mkdir -p $VLCDEPSDIR/usr/{bin,include/gsm,lib${LIBDIRSUFFIX}}
  1419. cp bin/* $VLCDEPSDIR/usr/bin/
  1420. cp inc/gsm.h $VLCDEPSDIR/usr/include/gsm/
  1421. ln -sf gsm/gsm.h $VLCDEPSDIR/usr/include/gsm.h
  1422. cp lib/* $VLCDEPSDIR/usr/lib${LIBDIRSUFFIX}/
  1423. # Add DOCS to the vlcdeps to have it added to vlc package later:          
  1424. mkdir -p $VLCDEPSDIR/doc/gsm
  1425. cp -a COPYRIGHT ChangeLog* INSTALL MACHINES MANIFEST README \
  1426.   $VLCDEPSDIR/doc/gsm || true
  1427. cd -
  1428. }
  1429.  
  1430.  
  1431. # -----------------------------------------------------------------------------
  1432. # Compile ffmpeg with support for AMR, LAME, XVID, FAAC, RTMP, ...
  1433. # Later, we will statically link VLC to the generated libavcodec libraries
  1434. # -----------------------------------------------------------------------------
  1435. make_ffmpeg()
  1436. {
  1437. echo -e "**\n**  ffmpeg ...\n**"
  1438. OLDDIR=$(pwd)
  1439. cd $TMP/tmp-$PRGNAM
  1440. # Take care of snaphot directory:
  1441. if [ -d ffmpeg-export-* ]; then
  1442.   rm -rf ffmpeg-${FFMPEG}
  1443.   mv ffmpeg-export-* ffmpeg-${FFMPEG}
  1444. fi
  1445.  
  1446. # Only use patented code if we are allowing it:
  1447. if [ "${USE_PATENTS}" == "YES" ]; then
  1448.   USE_PATENTED="--enable-libmp3lame \
  1449.                --enable-libfaac \
  1450.                --enable-libvo-aacenc \
  1451.                --enable-nonfree"
  1452. else
  1453.   USE_PATENTED=" "
  1454. fi
  1455.  
  1456. cd $TMP/tmp-$PRGNAM/ffmpeg-${FFMPEG}
  1457.  
  1458. if [ "$ARCH" = "x86_64" ]; then
  1459.   ARCHOPTS="--arch=x86_64 --enable-pic"
  1460. elif [ "$ARCH" = "armv7hl" ]; then
  1461.   ARCHOPTS="--enable-pic"
  1462. else
  1463.   ARCHOPTS=""
  1464. fi
  1465.  
  1466. ## Prevent static linking issues:
  1467. #sed -i -e "s/pkg_config --libs/pkg_config --static --libs/" \
  1468. #  configure
  1469.  
  1470. # Stamp the version into the source:
  1471. [ -f version.sh ] && sed -i -e "s/UNKNOWN/$FFMPEG/" version.sh
  1472.  
  1473. TMPDIR="$TMP" \
  1474. CFLAGS="$SLKCFLAGS" \
  1475. CXXFLAGS="$SLKCFLAGS" \
  1476. LDFLAGS="$SLKLDFLAGS" \
  1477. PKG_CONFIG_PATH="${VLCDEPSDIR}/usr/lib${LIBDIRSUFFIX}/pkgconfig" \
  1478. ./configure \
  1479.   --prefix=$VLCDEPSDIR/usr \
  1480.   --libdir=$VLCDEPSDIR/usr/lib${LIBDIRSUFFIX} \
  1481.   --shlibdir=$VLCDEPSDIR/usr/lib${LIBDIRSUFFIX} \
  1482.   ${USE_PATENTED} \
  1483.   --enable-gpl \
  1484.   --enable-version3 \
  1485.   --enable-libgsm \
  1486.   --enable-libopencore-amrnb \
  1487.   --enable-libopencore-amrwb \
  1488.   --enable-librtmp \
  1489.   --enable-libtheora \
  1490.   --enable-libvo-amrwbenc \
  1491.   --enable-libvpx \
  1492.   --enable-avfilter \
  1493.   --enable-postproc \
  1494.   --enable-pthreads \
  1495.   --enable-hardcoded-tables \
  1496.   --disable-ffserver \
  1497.   --disable-ffplay \
  1498.   --disable-ffmpeg \
  1499.   --disable-ffprobe \
  1500.   --enable-fastdiv \
  1501.   --disable-debug \
  1502.   --disable-shared \
  1503.   --enable-static \
  1504.   --enable-memalign-hack \
  1505.   --enable-bzlib \
  1506.   --enable-zlib \
  1507.   --enable-vaapi \
  1508.   --disable-vdpau \
  1509.   $ARCHOPTS \
  1510.   --extra-cflags="-I${VLCDEPSDIR}/usr/include -DRUNTIME_CPUDETECT" \
  1511.   --extra-ldflags="-L${VLCDEPSDIR}/usr/lib${LIBDIRSUFFIX} -ldl" \
  1512.   2>&1 | tee $OUTPUT/configure-${PRGNAM}_ffmpeg.log
  1513.  
  1514.   # Do not add '-fPIC -DPIC' to extra-cflags or "can't find
  1515.   # a register in class 'GENERAL_REGS' while reloading 'asm'" occurs
  1516.   # --enable-libogg \ Newer ffmpeg no longer need this.
  1517.   # --enable-libxvid \ generates vlc linker errors, so we use ffmpeg's
  1518.   #   native xvid encoder implementation instead
  1519.   #--enable-libvorbis \  # Use ffmpeg's native support
  1520.   #--disable-vhook \
  1521.   #--disable-devices \
  1522.   #--disable-protocols \
  1523.   #--logfile=$OUTPUT/ffmpeg.conf.log \
  1524.   # Remove this in 0.6.1 to avoid "error: libavcodec/cbrt_tables.h: No such file or directory"
  1525.   # (compile issue has been fixed in ffmpeg-git but I'll stick to 0.6.1 for now):
  1526.   # --enable-hardcoded-tables \
  1527.  
  1528. make -j${NUMJOBS} 2>&1 | tee $OUTPUT/make-${PRGNAM}_ffmpeg.log
  1529. [ $? -ne 0 ] && return 1
  1530.  
  1531. # Install ffmpeg into a temp location so vlc can pickup the libraries
  1532. make install-libs install-headers \
  1533.   2>&1 | tee -a $OUTPUT/make-${PRGNAM}_ffmpeg.log
  1534.  
  1535. # If we compiled vaapi support:
  1536. if [ ! -f $VLCDEPSDIR/usr/include/vaapi.h ]; then
  1537.   cp libavcodec/vaapi.h $VLCDEPSDIR/usr/include/
  1538. fi
  1539.  
  1540. # Add DOCS to the vlcdeps to have it added to vlc package later:
  1541. mkdir -p $VLCDEPSDIR/doc/ffmpeg/
  1542. cp COPYING* CREDITS Changelog MAINTAINERS README \
  1543.   $VLCDEPSDIR/doc/ffmpeg/ || true
  1544.  
  1545. cd $OLDDIR
  1546. }
  1547.  
  1548. # -----------------------------------------------------------------------------
  1549. # Next, compile Qt4
  1550. # We will link VLC statically to the generated libraries
  1551. # -----------------------------------------------------------------------------
  1552. make_qt4()
  1553. {
  1554. echo -e "**\n**  Qt4 ...\n**"
  1555.  
  1556. # If we build a static Qt4 gui, unset the QT-related environment variables,
  1557. # so that a pre-existing Qt4 will not be picked up and create errors later:
  1558. unset QTDIR
  1559. unset QT4DIR
  1560. NEWPATH="$VLCDEPSDIR/usr/bin"
  1561. for elem in $(echo $PATH | cut -d: --output-delimiter=' ' -f1-) ; do
  1562.   if ! $(echo "$elem"| grep -q /qt) ; then
  1563.     NEWPATH="$NEWPATH:$elem"
  1564.   fi
  1565. done
  1566. export PATH="$NEWPATH"
  1567.  
  1568. cd $TMP/tmp-$PRGNAM/$(ls --indicator-style=none | grep qt-*-src-${QT4})
  1569.  
  1570. export CFLAGS="-I$VLCDEPSDIR/usr/include $SLKCFLAGS"
  1571. export CXXFLAGS="-I$VLCDEPSDIR/usr/include $SLKCFLAGS"
  1572. export OPENSOURCE_CXXFLAGS="-I$VLCDEPSDIR/usr/include $SLKCFLAGS"
  1573. export LDFLAGS="-L$VLCDEPSDIR/usr/lib${LIBDIRSUFFIX} $SLKLDFLAGS"
  1574. export PKG_CONFIG_PATH="${VLCDEPSDIR}/usr/lib${LIBDIRSUFFIX}/pkgconfig"
  1575. echo "o
  1576. yes" | ./configure \
  1577.   -prefix $VLCDEPSDIR \
  1578.   -libdir $VLCDEPSDIR/lib${LIBDIRSUFFIX} \
  1579.   -release \
  1580.   -static \
  1581.   -fast \
  1582.   -no-phonon \
  1583.   -no-qt3support \
  1584.   -no-exceptions \
  1585.   -qt-gif \
  1586.   -qt-libpng \
  1587.   -qt-libjpeg \
  1588.   -qt-zlib \
  1589.   -nomake examples \
  1590.   -nomake demos \
  1591.   -nomake docs \
  1592.   -no-separate-debug-info \
  1593.   -no-pch \
  1594.   2>&1 | tee $OUTPUT/configure-${PRGNAM}_qt4.log
  1595. make -j${NUMJOBS} 2>&1 | tee $OUTPUT/make-${PRGNAM}_qt4.log || exit 1
  1596. # With the above prefix we can install without INSTALL_ROOT; we need this
  1597. # so the Qt4 binaries will be picked up by vlc's configure script:
  1598. #make install INSTALL_ROOT=$VLCDEPSDIR \
  1599. make install 2>&1 | tee $OUTPUT/install-${PRGNAM}_qt4.log
  1600. # Add DOCS to the vlcdeps to have it added to vlc package later:
  1601. mkdir -p $VLCDEPSDIR/doc/qt4/
  1602. cp *GPL_EXCEPTION* FAQ* INSTALL KNOWN* LICENSE* README* \
  1603.   $VLCDEPSDIR/doc/qt4/ || true
  1604. cd -
  1605. }
  1606.  
  1607. # -----------------------------------------------------------------------------
  1608. # ADDITIONAL CODECS AND INPUT LIBRARIES FOR VLC
  1609. # -----------------------------------------------------------------------------
  1610.  
  1611. # -----------------------------------------------------------------------------
  1612. # Compile faad2
  1613. # -----------------------------------------------------------------------------
  1614. make_faad2()
  1615. {
  1616. echo -e "**\n**  faad2 ...\n**"
  1617. cd $TMP/tmp-$PRGNAM/faad2-$FAAD2
  1618. #autoreconf -vif
  1619. CFLAGS="$SLKCFLAGS" \
  1620. CXXFLAGS="$SLKCFLAGS" \
  1621. LDFLAGS="$SLKLDFLAGS" \
  1622. ./configure \
  1623.   --prefix=$VLCDEPSDIR/usr \
  1624.   --libdir=$VLCDEPSDIR/usr/lib${LIBDIRSUFFIX} \
  1625.   --without-xmms \
  1626.   --enable-static \
  1627.   --disable-shared \
  1628.   --program-prefix= \
  1629.   --program-suffix= \
  1630.   --build=$ARCH-slackware-linux \
  1631.   2>&1 | tee $OUTPUT/configure-${PRGNAM}_faad2.log
  1632.   # No longer available:
  1633.   #--with-mp4v2 \
  1634.   # Gives errors "faad bitstream value not allowed by specification":
  1635.   #--with-drm \
  1636. make -j${NUMJOBS} 2>&1 | tee $OUTPUT/make-${PRGNAM}_faad2.log
  1637. # Add DOCS to the vlcdeps to have it added to vlc package later:
  1638. mkdir -p $VLCDEPSDIR/doc/faad2/
  1639. cp AUTHORS COPYING ChangeLog README* TODO \
  1640.   $VLCDEPSDIR/doc/faad2/ || true
  1641. cd -
  1642. }
  1643.  
  1644. # -----------------------------------------------------------------------------
  1645. # Compile a52 libraries
  1646. # -----------------------------------------------------------------------------
  1647. make_a52()
  1648. {
  1649. echo -e "**\n**  a52 ...\n**"
  1650. cd $TMP/tmp-$PRGNAM/a52dec-${A52}
  1651. CFLAGS="$SLKCFLAGS" \
  1652. CXXFLAGS="$SLKCFLAGS" \
  1653. LDFLAGS="$SLKLDFLAGS" \
  1654. ./configure \
  1655.   --prefix=$VLCDEPSDIR/usr \
  1656.   --libdir=$VLCDEPSDIR/usr/lib${LIBDIRSUFFIX} \
  1657.   --enable-static \
  1658.   --disable-shared \
  1659.   --program-prefix= \
  1660.   --program-suffix= \
  1661.   --build=$ARCH-slackware-linux \
  1662.   2>&1 | tee $OUTPUT/configure-${PRGNAM}_a52.log
  1663. make -j${NUMJOBS} 2>&1 | tee $OUTPUT/make-${PRGNAM}_a52.log
  1664. # Add DOCS to the vlcdeps to have it added to vlc package later:
  1665. mkdir -p $VLCDEPSDIR/doc/a52dec/
  1666. cp AUTHORS COPYING ChangeLog HISTORY INSTALL NEWS README TODO \
  1667.   $VLCDEPSDIR/doc/a52dec/ || true
  1668. cd -
  1669. }
  1670.  
  1671. # -----------------------------------------------------------------------------
  1672. # Compile live555
  1673. # -----------------------------------------------------------------------------
  1674. make_live555()
  1675. {
  1676. echo -e "**\n**  live555 ...\n**"
  1677. cd $TMP/tmp-$PRGNAM/live
  1678.  
  1679. # Force the use of our CFLAGS
  1680. sed -i -e "s|-O2|${SLKCFLAGS}|g" config.linux
  1681. # Live555 is not useable with vlc unless linked statically.
  1682. # We need this patch for the tarballs around end september 2009:
  1683. if ! $(grep -q Bstatic config.linux) ; then
  1684.   sed -i -e 's/\(LIBRARY_LINK =\).*/\1 $(LD) -o/g' \
  1685.          -e 's/\(LIBRARY_LINK_OPTS =\).*/\1 $(LINK_OPTS) -r -Bstatic/g' \
  1686.          config.linux
  1687. fi
  1688. ./genMakefiles linux 2>&1 | tee $OUTPUT/configure-${PRGNAM}_live.log
  1689. make -j${NUMJOBS} 2>&1 | tee $OUTPUT/make-${PRGNAM}_live.log
  1690. # Move the live555 stuff into place for vlc to pick it up:
  1691. mkdir -p $VLCDEPSDIR/usr/lib${LIBDIRSUFFIX} $VLCDEPSDIR/usr/include
  1692. cp \
  1693.   groupsock/libgroupsock.a \
  1694.   liveMedia/libliveMedia.a \
  1695.   UsageEnvironment/libUsageEnvironment.a \
  1696.   BasicUsageEnvironment/libBasicUsageEnvironment.a \
  1697.   $VLCDEPSDIR/usr/lib${LIBDIRSUFFIX}/
  1698. cp \
  1699.   groupsock/include/*.hh \
  1700.   groupsock/include/*.h \
  1701.   liveMedia/include/*.hh \
  1702.   UsageEnvironment/include/*.hh \
  1703.   BasicUsageEnvironment/include/*.hh \
  1704.   $VLCDEPSDIR/usr/include/
  1705. # Add DOCS to the vlcdeps to have it added to vlc package later:
  1706. mkdir -p $VLCDEPSDIR/doc/live555/
  1707. cp COPYING README \
  1708.   $VLCDEPSDIR/doc/live555/ || true
  1709. cd -
  1710. }
  1711.  
  1712. # -----------------------------------------------------------------------------
  1713. # Compile ebml
  1714. # -----------------------------------------------------------------------------
  1715. make_ebml()
  1716. {
  1717. echo -e "**\n**  ebml ...\n**"
  1718. OLDDIR=$(pwd)
  1719. cd $TMP/tmp-$PRGNAM/libebml-$EBML/make/linux
  1720. CFLAGS="$SLKCFLAGS" \
  1721. CXXFLAGS="$SLKCFLAGS" \
  1722. LDFLAGS="$SLKLDFLAGS" \
  1723. make -j${NUMJOBS} staticlib prefix=$VLCDEPSDIR/usr \
  1724.   2>&1 | tee $OUTPUT/make-${PRGNAM}_ebml.log
  1725. # Install into a temp directory where vlc & matroska can pick it up:
  1726. make install_staticlib install_headers \
  1727.   prefix=$VLCDEPSDIR/usr \
  1728.   includedir=$VLCDEPSDIR/usr/include/ebml \
  1729.   libdir=$VLCDEPSDIR/usr/lib${LIBDIRSUFFIX} \
  1730.   2>&1 | tee -a $OUTPUT/make-${PRGNAM}_ebml.log
  1731. cd $TMP/tmp-$PRGNAM/libebml-$EBML
  1732. # Add DOCS to the vlcdeps to have it added to vlc package later:
  1733. mkdir -p $VLCDEPSDIR/doc/libebml/
  1734. cp ChangeLog LICENSE.LGPL \
  1735.   $VLCDEPSDIR/doc/libebml/ || true
  1736. cd $OLDDIR
  1737. }
  1738.  
  1739. # -----------------------------------------------------------------------------
  1740. # Compile matroska
  1741. # -----------------------------------------------------------------------------
  1742. make_matroska()
  1743. {
  1744. echo -e "**\n**  matroska ...\n**"
  1745. OLDDIR=$(pwd)
  1746. cd $TMP/tmp-$PRGNAM/libmatroska-$MATROSKA/make/linux
  1747. CFLAGS="$SLKCFLAGS" \
  1748. CXXFLAGS="$SLKCFLAGS" \
  1749. LDFLAGS="$SLKLDFLAGS" \
  1750. make -j${NUMJOBS} staticlib prefix=$VLCDEPSDIR/usr \
  1751.   LIBEBML_INCLUDE_DIR=$(pwd)/../../../libebml-$EBML \
  1752.   LIBEBML_LIB_DIR=$(pwd)/../../../libebml-$EBML/make/linux \
  1753.   2>&1 | tee $OUTPUT/make-${PRGNAM}_matroska.log
  1754. # Install into a temp directory where vlc can pick it up:
  1755. make install_staticlib install_headers \
  1756.   prefix=$VLCDEPSDIR/usr \
  1757.   includedir=$VLCDEPSDIR/usr/include/matroska \
  1758.   libdir=$VLCDEPSDIR/usr/lib${LIBDIRSUFFIX} \
  1759.   LIBEBML_INCLUDE_DIR=$(pwd)/../../../libebml-$EBML \
  1760.   LIBEBML_LIB_DIR=$(pwd)/../../../libebml-$EBML/make/linux \
  1761.   2>&1 | tee -a $OUTPUT/make-${PRGNAM}_matroska.log
  1762. # Add DOCS to the vlcdeps to have it added to vlc package later:
  1763. cd $TMP/tmp-$PRGNAM/libmatroska-$MATROSKA
  1764. mkdir -p $VLCDEPSDIR/doc/libmatroska/
  1765. cp ChangeLog LICENSE.LGPL \
  1766.   $VLCDEPSDIR/doc/libmatroska/ || true
  1767. cd $OLDDIR
  1768. }
  1769.  
  1770. # -----------------------------------------------------------------------------
  1771. # Compile libmpeg2
  1772. # -----------------------------------------------------------------------------
  1773. make_libmpeg2()
  1774. {
  1775. echo -e "**\n**  libmpeg2 ...\n**"
  1776. cd $TMP/tmp-$PRGNAM/libmpeg2-$MPEG2DEC
  1777. if [ ! -r configure ]; then
  1778.   sh bootstrap
  1779. fi
  1780. CFLAGS="$SLKCFLAGS" \
  1781. CXXFLAGS="$SLKCFLAGS" \
  1782. LDFLAGS="$SLKLDFLAGS" \
  1783. ./configure \
  1784.   --prefix=$VLCDEPSDIR/usr \
  1785.   --libdir=$VLCDEPSDIR/usr/lib${LIBDIRSUFFIX} \
  1786.   --enable-static \
  1787.   --disable-shared \
  1788.   --program-prefix= \
  1789.   --program-suffix= \
  1790.   --build=$ARCH-slackware-linux \
  1791.   2>&1 | tee $OUTPUT/configure-${PRGNAM}_libmpeg2.log
  1792.   #--without-x \
  1793.   #--disable-sdl \
  1794. make -j${NUMJOBS} 2>&1 | tee $OUTPUT/make-${PRGNAM}_libmpeg2.log
  1795. # Install libmpeg2 into a temp location so vlc can pickup the library
  1796. make install 2>&1 | tee -a $OUTPUT/make-${PRGNAM}_mbpeg2.log
  1797. # Add DOCS to the vlcdeps to have it added to vlc package later:
  1798. mkdir -p $VLCDEPSDIR/doc/libmpeg2/
  1799. cp AUTHORS COPYING ChangeLog NEWS README TODO \
  1800.   $VLCDEPSDIR/doc/libmpeg2/ || true
  1801. cd -
  1802. }
  1803.  
  1804. # -----------------------------------------------------------------------------
  1805. # Compile libmpcdec
  1806. # -----------------------------------------------------------------------------
  1807. make_mpcdec()
  1808. {
  1809. echo -e "**\n**  libmpcdec ...\n**"
  1810. cd $TMP/tmp-$PRGNAM/libmpcdec-$MPCDEC
  1811.  
  1812. # Prevent a dependency on libreplaygain and libcuefile:
  1813. sed -i \
  1814.   -e 's,^add_subdirectory(mpcgain),,g' \
  1815.   -e 's,^add_subdirectory(mpcchap),,g' \
  1816.   CMakeLists.txt
  1817.  
  1818. # We want to use our own CFLAGS please:
  1819. sed -i \
  1820.   -e 's/set(CMAKE_C_FLAGS "\(.*\)")$/add_definitions(\1)/' \
  1821.   CMakeLists.txt
  1822.  
  1823. mkdir build
  1824. cd build
  1825.   CFLAGS="$SLKCFLAGS" \
  1826.   CXXFLAGS="$SLKCFLAGS" \
  1827.   LDFLAGS="$SLKLDFLAGS" \
  1828.   cmake .. \
  1829.     -DCMAKE_VERBOSE_MAKEFILE:BOOL=ON \
  1830.     -DCMAKE_INSTALL_PREFIX=/usr \
  1831.     -DLIB_SUFFIX=${LIBDIRSUFFIX} \
  1832.     -DSHARED=OFF \
  1833.     2>&1 | tee $OUTPUT/cmake-${PRGNAM}_mpcdec.log
  1834. make -j${NUMJOBS} 2>&1 | tee $OUTPUT/make-${PRGNAM}_mpcdec.log
  1835. # Install mpcdec into a temp location so vlc can pickup the library
  1836. # (with the move to 'cmake', the install target does not work any longer):
  1837. mkdir -p $VLCDEPSDIR/usr/lib${LIBDIRSUFFIX}
  1838. install -m0644 libmpcdec/libmpcdec_static.a \
  1839.   $VLCDEPSDIR/usr/lib${LIBDIRSUFFIX}/libmpcdec.a
  1840. # Add DOCS to the vlcdeps to have it added to vlc package later:
  1841. mkdir -p $VLCDEPSDIR/doc/libmpcdec/
  1842. cp AUTHORS COPYING ChangeLog README \
  1843.   $VLCDEPSDIR/doc/libmpcdec/ || true
  1844. cd -
  1845. }
  1846.  
  1847. # -----------------------------------------------------------------------------
  1848. # Compile libdvdnav
  1849. # -----------------------------------------------------------------------------
  1850. make_dvdnav()
  1851. {
  1852. echo -e "**\n**  libdvdnav  ...\n**"
  1853. cd $TMP/tmp-$PRGNAM/libdvdnav-$DVDNAV
  1854.  
  1855. ## Patch to fix aspect ratio in some DVD menus, incorporated into 4.2.0:
  1856. #cat $SRCDIR/libdvdnav-resolution.patch | patch -p0 --verbose \
  1857. #  2>&1 | tee $OUTPUT/patch-${PRGNAM}_dvdnav.log
  1858.  
  1859. CFLAGS="-I$VLCDEPSDIR/usr/include $SLKCFLAGS" \
  1860. CXXFLAGS="-I$VLCDEPSDIR/usr/include $SLKCFLAGS" \
  1861. LDFLAGS="-L$VLCDEPSDIR/usr/lib${LIBDIRSUFFIX} $SLKLDFLAGS" \
  1862. PKG_CONFIG_PATH="$VLCDEPSDIR/usr/lib${LIBDIRSUFFIX}/pkgconfig" \
  1863. PATH="$VLCDEPSDIR/usr/bin:$PATH" \
  1864. ./autogen.sh \
  1865.   --prefix=$VLCDEPSDIR/usr \
  1866.   --libdir=$VLCDEPSDIR/usr/lib${LIBDIRSUFFIX} \
  1867.   --enable-static \
  1868.   --disable-shared \
  1869.   --program-prefix= \
  1870.   --program-suffix= \
  1871.   --build=$ARCH-slackware-linux \
  1872.   2>&1 | tee $OUTPUT/configure-${PRGNAM}_dvdnav.log
  1873. make -j${NUMJOBS} 2>&1 | tee $OUTPUT/make-${PRGNAM}_dvdnav.log
  1874. # Install libdvdnav into a temp location so vlc can pickup the library
  1875. make install m4datadir=$VLCDEPSDIR/usr/share/aclocal \
  1876.   2>&1 | tee -a $OUTPUT/make-${PRGNAM}_dvdnav.log
  1877. # Make a symlink which vlc-20080730 needs:
  1878. ( cd $VLCDEPSDIR/usr/include
  1879.   ln -s dvdread libdvdread
  1880. )
  1881. # Add DOCS to the vlcdeps to have it added to vlc package later:
  1882. mkdir -p $VLCDEPSDIR/doc/libdvdnav/
  1883. cp AUTHORS COPYING ChangeLog NEWS README TODO \
  1884.   $VLCDEPSDIR/doc/libdvdnav/ || true
  1885. cd -
  1886. }
  1887.  
  1888.  
  1889. # -----------------------------------------------------------------------------
  1890. # Compile libdvdcss
  1891. # -----------------------------------------------------------------------------
  1892. make_dvdcss()
  1893. {
  1894. echo -e "**\n**  libdvdcss  ...\n**"
  1895. cd $TMP/tmp-$PRGNAM/libdvdcss-$DVDCSS
  1896. CFLAGS="$SLKCFLAGS" \
  1897. CXXFLAGS="$SLKCFLAGS" \
  1898. LDFLAGS="$SLKLDFLAGS" \
  1899. ./configure \
  1900.   --prefix=$VLCDEPSDIR/usr \
  1901.   --libdir=$VLCDEPSDIR/usr/lib${LIBDIRSUFFIX} \
  1902.   --disable-doc \
  1903.   --program-prefix= \
  1904.   --program-suffix= \
  1905.   --build=$ARCH-slackware-linux \
  1906.   2>&1 | tee $OUTPUT/configure-${PRGNAM}_dvdcss.log
  1907.   # Shared library needed so that libdvdread can query the library
  1908.   #--disable-shared \
  1909. make -j${NUMJOBS} 2>&1 | tee $OUTPUT/make-${PRGNAM}_dvdcss.log
  1910. # Install libdvdcss into a temp location so libdvdread can pickup the library
  1911. echo -e "\n**\n**\n"
  1912. make install 2>&1 | tee -a $OUTPUT/make-${PRGNAM}_dvdcss.log
  1913. # Add DOCS to the vlcdeps to have it added to vlc package later:
  1914. mkdir -p $VLCDEPSDIR/doc/libdvdcss/
  1915. cp AUTHORS COPYING ChangeLog NEWS README \
  1916.   $VLCDEPSDIR/doc/libdvdcss/ || true
  1917. cd -
  1918. }
  1919.  
  1920. # -----------------------------------------------------------------------------
  1921. # Compile libdvdread
  1922. # -----------------------------------------------------------------------------
  1923. make_dvdread()
  1924. {
  1925. echo -e "**\n**  libdvdread  ...\n**"
  1926. cd $TMP/tmp-$PRGNAM/libdvdread-$DVDREAD
  1927.  
  1928.  
  1929. if [ "${USE_PATENTS}" == "YES" ]; then
  1930.   # If we allow patented software, we also link libdvdcss statically into
  1931.   # libdvdread. Otherwise, you can just install libdvdcss additionally
  1932.   # and the dvdread library will find and load dvdcss support at runtime.
  1933.   cat $SRCDIR/dvdread-css-static.patch | patch -p1 --verbose \
  1934.     2>&1 | tee -a $OUTPUT/patch-${PRGNAM}_dvdread.log
  1935.   DO_CSS="--enable-libdvdcss"
  1936. else
  1937.   DO_CSS=""
  1938. fi
  1939.  
  1940. ./autogen.sh noconfig \
  1941.   2>&1 | tee $OUTPUT/configure-${PRGNAM}_dvdread.log
  1942.  
  1943. CFLAGS="-I$VLCDEPSDIR/usr/include $SLKCFLAGS" \
  1944. CXXFLAGS="-I$VLCDEPSDIR/usr/include $SLKCFLAGS" \
  1945. LDFLAGS="-L$VLCDEPSDIR/usr/lib${LIBDIRSUFFIX} $SLKLDFLAGS" \
  1946. PKG_CONFIG_PATH="$VLCDEPSDIR/usr/lib${LIBDIRSUFFIX}/pkgconfig" \
  1947. ./configure \
  1948.   --prefix=$VLCDEPSDIR/usr \
  1949.   --libdir=$VLCDEPSDIR/usr/lib${LIBDIRSUFFIX} \
  1950.   --enable-static \
  1951.   --disable-shared \
  1952.   --program-prefix= \
  1953.   --program-suffix= \
  1954.   ${DO_CSS} \
  1955.   --build=$ARCH-slackware-linux \
  1956.   2>&1 | tee -a $OUTPUT/configure-${PRGNAM}_dvdread.log
  1957. make -j${NUMJOBS} 2>&1 | tee $OUTPUT/make-${PRGNAM}_dvdread.log
  1958. # Install libdvdread into a temp location so libdvdnav can pickup the library
  1959. echo -e "\n**\n**\n"
  1960. make install m4datadir=$VLCDEPSDIR/usr/share/aclocal \
  1961.   2>&1 | tee -a $OUTPUT/make-${PRGNAM}_dvdread.log
  1962. # Add DOCS to the vlcdeps to have it added to vlc package later:
  1963. mkdir -p $VLCDEPSDIR/doc/libdvdread/
  1964. cp AUTHORS COPYING ChangeLog NEWS README TODO \
  1965.   $VLCDEPSDIR/doc/libdvdread/ || true
  1966. cd -
  1967. }
  1968.  
  1969.  
  1970. # -----------------------------------------------------------------------------
  1971. # Compile libcddb
  1972. # -----------------------------------------------------------------------------
  1973. make_cddb()
  1974. {
  1975. echo -e "**\n**  libcddb  ...\n**"
  1976. cd $TMP/tmp-$PRGNAM/libcddb-$CDDB
  1977. CFLAGS="-I$VLCDEPSDIR/usr/include $SLKCFLAGS" \
  1978. CXXFLAGS="-I$VLCDEPSDIR/usr/include $SLKCFLAGS" \
  1979. LDFLAGS="-L$VLCDEPSDIR/usr/lib${LIBDIRSUFFIX} $SLKLDFLAGS" \
  1980. ./configure \
  1981.   --prefix=$VLCDEPSDIR/usr \
  1982.   --libdir=$VLCDEPSDIR/usr/lib${LIBDIRSUFFIX} \
  1983.   --enable-static \
  1984.   --disable-shared \
  1985.   --program-prefix= \
  1986.   --program-suffix= \
  1987.   --build=$ARCH-slackware-linux \
  1988.   2>&1 | tee $OUTPUT/configure-${PRGNAM}_cddb.log
  1989. make -j${NUMJOBS} 2>&1 | tee $OUTPUT/make-${PRGNAM}_cddb.log
  1990. # Install libcddb into a temp location so cdio and vlc can pickup the library
  1991. echo -e "\n**\n**\n"
  1992. make install 2>&1 | tee -a $OUTPUT/make-${PRGNAM}_cddb.log
  1993. # Add DOCS to the vlcdeps to have it added to vlc package later:
  1994. mkdir -p $VLCDEPSDIR/doc/libcddb/
  1995. cp ABOUT-NLS AUTHORS COPYING ChangeLog NEWS README THANKS TODO \
  1996.   $VLCDEPSDIR/doc/libcddb/ || true
  1997. cd -
  1998. }
  1999.  
  2000. # -----------------------------------------------------------------------------
  2001. # Compile libcdio
  2002. # -----------------------------------------------------------------------------
  2003. make_cdio()
  2004. {
  2005. echo -e "**\n**  libcdio  ...\n**"
  2006. DO_VCD=${1:-" "}
  2007. cd $TMP/tmp-$PRGNAM/libcdio-$CDIO
  2008. ## Patch that allows vlc to detect required libs for cdio:
  2009. #cat $SRCDIR/libcdio-0.80_Makefile.patch | patch -p0 --verbose \
  2010. #  2>1 | tee -a $OUTPUT/patch-${PRGNAM}.log
  2011. ## Because of patching a .am file, need to reconf:
  2012. #autoreconf -vif
  2013. CFLAGS="-I$VLCDEPSDIR/usr/include $SLKCFLAGS" \
  2014. CXXFLAGS="-I$VLCDEPSDIR/usr/include $SLKCFLAGS" \
  2015. LDFLAGS="-L$VLCDEPSDIR/usr/lib${LIBDIRSUFFIX} $SLKLDFLAGS" \
  2016. PKG_CONFIG_PATH="$VLCDEPSDIR/usr/lib${LIBDIRSUFFIX}/pkgconfig" \
  2017. ./configure \
  2018.   --prefix=$VLCDEPSDIR/usr \
  2019.   --libdir=$VLCDEPSDIR/usr/lib${LIBDIRSUFFIX} \
  2020.   --enable-static \
  2021.   --disable-shared \
  2022.   --enable-joliet \
  2023.   --enable-rock \
  2024.   --disable-cddb \
  2025.   $DO_VCD \
  2026.   --program-prefix= \
  2027.   --program-suffix= \
  2028.   --build=$ARCH-slackware-linux \
  2029.   2>&1 | tee $OUTPUT/configure-${PRGNAM}_cdio.log
  2030. make -j${NUMJOBS} 2>&1 | tee $OUTPUT/make-${PRGNAM}_cdio.log
  2031. # Install libcdio into a temp location so vlc can pickup the library
  2032. echo -e "\n**\n**\n"
  2033. make install 2>&1 | tee -a $OUTPUT/make-${PRGNAM}_cdio.log
  2034. # Add DOCS to the vlcdeps to have it added to vlc package later:
  2035. mkdir -p $VLCDEPSDIR/doc/libcdio/
  2036. cp ABOUT-NLS AUTHORS COPYING ChangeLog NEWS README* THANKS TODO \
  2037.   $VLCDEPSDIR/doc/libcdio/  || true
  2038. cd -
  2039. }
  2040.  
  2041. # -----------------------------------------------------------------------------
  2042. # Compile libvcd
  2043. # -----------------------------------------------------------------------------
  2044. make_vcd()
  2045. {
  2046. echo -e "**\n**  libvcd  ...\n**"
  2047. cd $TMP/tmp-$PRGNAM/vcdimager-$VCD
  2048. CFLAGS="-I$VLCDEPSDIR/usr/include $SLKCFLAGS" \
  2049. CXXFLAGS="-I$VLCDEPSDIR/usr/include $SLKCFLAGS" \
  2050. LDFLAGS="-L$VLCDEPSDIR/usr/lib${LIBDIRSUFFIX} $SLKLDFLAGS" \
  2051. PKG_CONFIG_PATH="$VLCDEPSDIR/usr/lib${LIBDIRSUFFIX}/pkgconfig" \
  2052. ./configure \
  2053.   --prefix=$VLCDEPSDIR/usr \
  2054.   --libdir=$VLCDEPSDIR/usr/lib${LIBDIRSUFFIX} \
  2055.   --enable-static \
  2056.   --disable-shared \
  2057.   --program-prefix= \
  2058.   --program-suffix= \
  2059.   --build=$ARCH-slackware-linux \
  2060.   2>&1 | tee $OUTPUT/configure-${PRGNAM}_vcd.log
  2061. make -j${NUMJOBS} 2>&1 | tee $OUTPUT/make-${PRGNAM}_vcd.log
  2062. # Install libvcd into a temp location so vlc can pickup the library
  2063. echo -e "\n**\n**\n"
  2064. make install 2>&1 | tee -a $OUTPUT/make-${PRGNAM}_vcd.log
  2065. # Add DOCS to the vlcdeps to have it added to vlc package later:
  2066. mkdir -p $VLCDEPSDIR/doc/vcdimager/
  2067. cp AUTHORS BUGS COPYING ChangeLog* FAQ HACKING NEWS README THANKS TODO \
  2068.   $VLCDEPSDIR/doc/vcdimager/  || true
  2069. cd -
  2070. }
  2071.  
  2072. # -----------------------------------------------------------------------------
  2073. # Compile twolame
  2074. # -----------------------------------------------------------------------------
  2075. make_twolame()
  2076. {
  2077. echo -e "**\n**  twolame  ...\n**"
  2078. cd $TMP/tmp-$PRGNAM/twolame-$TWOLAME
  2079. CFLAGS="$SLKCFLAGS" \
  2080. CXXFLAGS="$SLKCFLAGS" \
  2081. LDFLAGS="$SLKLDFLAGS" \
  2082. ./configure \
  2083.   --prefix=$VLCDEPSDIR/usr \
  2084.   --libdir=$VLCDEPSDIR/usr/lib${LIBDIRSUFFIX} \
  2085.   --enable-static \
  2086.   --disable-shared \
  2087.   --program-prefix= \
  2088.   --program-suffix= \
  2089.   --build=$ARCH-slackware-linux \
  2090.   2>&1 | tee $OUTPUT/configure-${PRGNAM}_twolame.log
  2091. make -j${NUMJOBS} 2>&1 | tee $OUTPUT/make-${PRGNAM}_twolame.log
  2092. # Install twolame into a temp location so vlc can pickup the library
  2093. make install 2>&1 | tee -a $OUTPUT/make-${PRGNAM}_twolame.log
  2094. # Add DOCS to the vlcdeps to have it added to vlc package later:
  2095. mkdir -p $VLCDEPSDIR/doc/twolame/
  2096. cp AUTHORS COPYING ChangeLog README TODO \
  2097.   $VLCDEPSDIR/doc/twolame/  || true
  2098. cd -
  2099. }
  2100.  
  2101. # -----------------------------------------------------------------------------
  2102. # Compile libdaap
  2103. # -----------------------------------------------------------------------------
  2104. make_daap()
  2105. {
  2106. echo -e "**\n**  libdaap  ...\n**"
  2107. cd $TMP/tmp-$PRGNAM/libopendaap-$DAAP
  2108. CFLAGS="$SLKCFLAGS" \
  2109. CXXFLAGS="$SLKCFLAGS" \
  2110. LDFLAGS="$SLKLDFLAGS" \
  2111. ./configure \
  2112.   --prefix=$VLCDEPSDIR/usr \
  2113.   --libdir=$VLCDEPSDIR/usr/lib${LIBDIRSUFFIX} \
  2114.   --enable-static \
  2115.   --disable-shared \
  2116.   --disable-debug \
  2117.   --program-prefix= \
  2118.   --program-suffix= \
  2119.   --build=$ARCH-slackware-linux \
  2120.   2>&1 | tee $OUTPUT/configure-${PRGNAM}_daap.log
  2121. make -j${NUMJOBS} 2>&1 | tee $OUTPUT/make-${PRGNAM}_daap.log
  2122. # Install libdaap into a temp location so vlc can pickup the library
  2123. echo -e "\n**\n**\n"
  2124. make install 2>&1 | tee -a $OUTPUT/make-${PRGNAM}_daap.log
  2125. # Add DOCS to the vlcdeps to have it added to vlc package later:
  2126. mkdir -p $VLCDEPSDIR/doc/libopendaap/
  2127. cp AUTHORS COPYING ChangeLog NEWS README \
  2128.   $VLCDEPSDIR/doc/libopendaap/  || true
  2129. cd -
  2130. }
  2131.  
  2132.  
  2133. # -----------------------------------------------------------------------------
  2134. # Compile libupnp
  2135. # -----------------------------------------------------------------------------
  2136. make_upnp()
  2137. {
  2138. echo -e "**\n**  libupnp  ...\n**"
  2139. cd $TMP/tmp-$PRGNAM/libupnp-$UPNP
  2140. CFLAGS="$SLKCFLAGS" \
  2141. CXXFLAGS="$SLKCFLAGS" \
  2142. LDFLAGS="$SLKLDFLAGS" \
  2143. ./configure \
  2144.   --prefix=$VLCDEPSDIR/usr \
  2145.   --libdir=$VLCDEPSDIR/usr/lib${LIBDIRSUFFIX} \
  2146.   --enable-static \
  2147.   --disable-shared \
  2148.   --enable-client \
  2149.   --disable-webserver \
  2150.   --disable-samples \
  2151.   --disable-debug \
  2152.   --program-prefix= \
  2153.   --program-suffix= \
  2154.   --build=$ARCH-slackware-linux \
  2155.   2>&1 | tee $OUTPUT/configure-${PRGNAM}_upnp.log
  2156. make -j${NUMJOBS} 2>&1 | tee $OUTPUT/make-${PRGNAM}_upnp.log
  2157. # Install libupnp into a temp location so vlc can pickup the library
  2158. echo -e "\n**\n**\n"
  2159. # The 'make install' will install into $VLCDEPSDIR :
  2160. make install 2>&1 | tee -a $OUTPUT/make-${PRGNAM}_upnp.log
  2161. # Add DOCS to the vlcdeps to have it added to vlc package later:
  2162. mkdir -p $VLCDEPSDIR/doc/libupnp/
  2163. cp AUTHORS COPYING ChangeLog LICENSE NEWS README THANKS TODO \
  2164.   $VLCDEPSDIR/doc/libupnp/  || true
  2165. cd -
  2166. }
  2167.  
  2168.  
  2169. # -----------------------------------------------------------------------------
  2170. # Compile orc
  2171. # -----------------------------------------------------------------------------
  2172. make_orc()
  2173. {
  2174. echo -e "**\n**  orc ...\n**"
  2175.  
  2176. cd $TMP/tmp-$PRGNAM/orc-$ORC
  2177. ## Make the static build succeed:
  2178. #cat $SRCDIR/orc-0.4.3_static.diff | patch -p1 --verbose \
  2179. #  2>&1 | tee $OUTPUT/patch-${PRGNAM}_orc.log
  2180.  
  2181. CFLAGS="$SLKCFLAGS" \
  2182. CXXFLAGS="$SLKCFLAGS" \
  2183. LDFLAGS="$SLKLDFLAGS" \
  2184. ./configure \
  2185.   --prefix=$VLCDEPSDIR/usr \
  2186.   --libdir=$VLCDEPSDIR/usr/lib${LIBDIRSUFFIX} \
  2187.   --enable-static \
  2188.   --disable-shared \
  2189.   --program-prefix= \
  2190.   --program-suffix= \
  2191.   --build=$ARCH-slackware-linux \
  2192.   2>&1 | tee $OUTPUT/configure-${PRGNAM}_orc.log
  2193. make -j${NUMJOBS} 2>&1 | tee $OUTPUT/make-${PRGNAM}_orc.log
  2194. # Install orc into a temp location so schroedinger can pickup the library
  2195. echo -e "\n**\n**\n"
  2196. # We used --prefix=$VLCDEPSDIR/usr so that schroedinger's build will find the
  2197. # headers in the $VLCDEPS instead of the filesystem root:
  2198. make install 2>&1 | tee -a $OUTPUT/make-${PRGNAM}_orc.log
  2199. # Add DOCS to the vlcdeps to have it added to vlc package later:
  2200. mkdir -p $VLCDEPSDIR/doc/orc/
  2201. cp COPYING README TODO \
  2202.   $VLCDEPSDIR/doc/orc/  || true
  2203. cd -
  2204. }
  2205.  
  2206. # -----------------------------------------------------------------------------
  2207. # Compile schroedinger
  2208. # -----------------------------------------------------------------------------
  2209. make_schroedinger()
  2210. {
  2211. echo -e "**\n**  schroedinger ...\n**"
  2212. if [ "$ARCH" = "x86_64" -o "$ARCH" = "armv7hl" ]; then
  2213.   ARCHOPTS="--with-pic"
  2214. else
  2215.   ARCHOPTS=""
  2216. fi
  2217. cd $TMP/tmp-$PRGNAM/schroedinger-$SCHROEDINGER
  2218. CFLAGS="$SLKCFLAGS" \
  2219. CXXFLAGS="$SLKCFLAGS" \
  2220. LDFLAGS="$SLKLDFLAGS" \
  2221. PKG_CONFIG_PATH="$VLCDEPSDIR/usr/lib${LIBDIRSUFFIX}/pkgconfig" \
  2222. ./configure \
  2223.   --prefix=$VLCDEPSDIR/usr \
  2224.   --libdir=$VLCDEPSDIR/usr/lib${LIBDIRSUFFIX} \
  2225.   --disable-shared \
  2226.   --with-thread=none \
  2227.   --program-prefix= \
  2228.   --program-suffix= \
  2229.   $ARCHOPTS \
  2230.   --build=$ARCH-slackware-linux \
  2231.   2>&1 | tee $OUTPUT/configure-${PRGNAM}_schroedinger.log
  2232. make  2>&1 | tee $OUTPUT/make-${PRGNAM}_schroedinger.log
  2233. # Install schroedinger into a temp location so vlc can pickup the library
  2234. echo -e "\n**\n**\n"
  2235. make install 2>&1 | tee -a $OUTPUT/make-${PRGNAM}_schroedinger.log
  2236. # Or else the vlc build wil fail:
  2237. cp schroedinger.pc $VLCDEPSDIR/usr/lib${LIBDIRSUFFIX}/pkgconfig/schroedinger.pc
  2238. cp schroedinger.pc $VLCDEPSDIR/usr/lib${LIBDIRSUFFIX}/pkgconfig/schroedinger-1.0.pc
  2239. ( cd $VLCDEPSDIR/usr/include
  2240.   ln -sf schroedinger-1.0/schroedinger
  2241. )
  2242. # Add DOCS to the vlcdeps to have it added to vlc package later:
  2243. mkdir -p $VLCDEPSDIR/doc/schroedinger/
  2244. cp AUTHORS COPYING* NEWS TODO \
  2245.   $VLCDEPSDIR/doc/schroedinger/  || true
  2246. cd -
  2247. }
  2248.  
  2249. # -----------------------------------------------------------------------------
  2250. # Compile speex codec
  2251. # -----------------------------------------------------------------------------
  2252. make_speex()
  2253. {
  2254. echo -e "**\n**  speex  ...\n**"
  2255. cd $TMP/tmp-$PRGNAM/speex-$SPEEX
  2256. CFLAGS="$SLKCFLAGS" \
  2257. CXXFLAGS="$SLKCFLAGS" \
  2258. LDFLAGS="$SLKLDFLAGS" \
  2259. ./configure \
  2260.   --prefix=$VLCDEPSDIR/usr \
  2261.   --libdir=$VLCDEPSDIR/usr/lib${LIBDIRSUFFIX} \
  2262.   --enable-static \
  2263.   --disable-shared \
  2264.   --program-prefix= \
  2265.   --program-suffix= \
  2266.   --build=$ARCH-slackware-linux \
  2267.   2>&1 | tee $OUTPUT/configure-${PRGNAM}_speex.log
  2268. make -j${NUMJOBS} 2>&1 | tee $OUTPUT/make-${PRGNAM}_speex.log
  2269. # Install speex into a temp location so libshout and vlc can pickup the library
  2270. make install 2>&1 | tee -a $OUTPUT/make-${PRGNAM}_speex.log
  2271. # Add DOCS to the vlcdeps to have it added to vlc package later:
  2272. mkdir -p $VLCDEPSDIR/doc/speex/
  2273. cp AUTHORS COPYING ChangeLog NEWS README* TODO \
  2274.   $VLCDEPSDIR/doc/speex/  || true
  2275. cd -
  2276. }
  2277.  
  2278. # -----------------------------------------------------------------------------
  2279. # Compile libshout
  2280. # -----------------------------------------------------------------------------
  2281. make_shout()
  2282. {
  2283. echo -e "**\n**  libshout  ...\n**"
  2284. cd $TMP/tmp-$PRGNAM/libshout-$SHOUT
  2285. CFLAGS="-I$VLCDEPSDIR/usr/include $SLKCFLAGS" \
  2286. CPPFLAGS="-I$VLCDEPSDIR/usr/include $SLKCFLAGS" \
  2287. LDFLAGS="-L$VLCDEPSDIR/usr/lib${LIBDIRSUFFIX} $SLKLDFLAGS" \
  2288. PKG_CONFIG_PATH="$VLCDEPSDIR/usr/lib${LIBDIRSUFFIX}/pkgconfig" \
  2289. ./configure \
  2290.   --prefix=$VLCDEPSDIR/usr \
  2291.   --libdir=$VLCDEPSDIR/usr/lib${LIBDIRSUFFIX} \
  2292.   --enable-speex \
  2293.   --enable-static \
  2294.   --disable-shared \
  2295.   --program-prefix= \
  2296.   --program-suffix= \
  2297.   --build=$ARCH-slackware-linux \
  2298.   2>&1 | tee $OUTPUT/configure-${PRGNAM}_shout.log
  2299. make -j${NUMJOBS} 2>&1 | tee $OUTPUT/make-${PRGNAM}_shout.log
  2300. # Install libshout into a temp location so vlc can pickup the library
  2301. make install 2>&1 | tee -a $OUTPUT/make-${PRGNAM}_shout.log
  2302. # Add DOCS to the vlcdeps to have it added to vlc package later:
  2303. mkdir -p $VLCDEPSDIR/doc/libshout/
  2304. cp COPYING NEWS README \
  2305.   $VLCDEPSDIR/doc/libshout/  || true
  2306. cd -
  2307. }
  2308.  
  2309.  
  2310. # -----------------------------------------------------------------------------
  2311. # Compile goom
  2312. # -----------------------------------------------------------------------------
  2313. make_goom()
  2314. {
  2315. echo -e "**\n**  goom  ...\n**"
  2316. # First, fix a blatant bug in the archive:
  2317. find $TMP/tmp-$PRGNAM/goom${GOOM} -type d -exec chmod 755 {} \;
  2318. cd $TMP/tmp-$PRGNAM/goom${GOOM}
  2319.  
  2320. # I think MMX is crashing the goom plugin on 32-bit:
  2321. cat $SRCDIR/goom-2k4-0.nommx.patch | patch -p1 --verbose \
  2322.   2>&1 | tee $OUTPUT/patch-${PRGNAM}_goom.log
  2323.  
  2324. # Do not install the xmms plugin to the root filesystem:
  2325. cat $SRCDIR/goom2k4-xmmslibdir.patch | patch -p1 --verbose \
  2326.   2>&1 | tee -a $OUTPUT/patch-${PRGNAM}_goom.log
  2327.  
  2328. # Eliminate a double include:
  2329. sed -i \
  2330.   -e "/^goom2_library_include_HEADERS =/s/goom_tools.h //g" \
  2331.   -e "/^goom2_library_include_HEADERS =/s/$/ goom_tools.h/" \
  2332.   src/Makefile.am
  2333.  
  2334. # Squash the automake errors:
  2335. autoreconf -vif -I m4
  2336.  
  2337. CFLAGS="$SLKCFLAGS" \
  2338. CXXFLAGS="$SLKCFLAGS" \
  2339. LDFLAGS="$SLKLDFLAGS" \
  2340. ./configure \
  2341.   --prefix=$VLCDEPSDIR/usr \
  2342.   --libdir=$VLCDEPSDIR/usr/lib${LIBDIRSUFFIX} \
  2343.   --enable-static \
  2344.   --disable-shared \
  2345.   --program-prefix= \
  2346.   --program-suffix= \
  2347.   --build=$ARCH-slackware-linux \
  2348.   2>&1 | tee $OUTPUT/configure-${PRGNAM}_goom.log
  2349.  
  2350. make -j${NUMJOBS} 2>&1 | tee $OUTPUT/make-${PRGNAM}_goom.log
  2351. # Install libgoom into a temp location so vlc can pickup the library
  2352. make install 2>&1 | tee -a $OUTPUT/make-${PRGNAM}_goom.log
  2353. # Add DOCS to the vlcdeps to have it added to vlc package later:
  2354. mkdir -p $VLCDEPSDIR/doc/goom/
  2355. cp AUTHORS COPYING ChangeLog KNOWNBUGS NEWS README \
  2356.   $VLCDEPSDIR/doc/goom/  || true
  2357. cd -
  2358. }
  2359.  
  2360.  
  2361. # -----------------------------------------------------------------------------
  2362. # Compile projectM
  2363. # -----------------------------------------------------------------------------
  2364. make_projectm()
  2365. {
  2366. echo -e "**\n**  projectm  ...\n**"
  2367. cd $TMP/tmp-$PRGNAM/projectM-${PROJECTM}-Source
  2368.  
  2369. # Fix linking - get rid of unresolved symbols at runtime:
  2370. cat $SRCDIR/projectM_static.patch | patch -p1 --verbose \
  2371.   2>&1 | tee $OUTPUT/patch-${PRGNAM}_projectm.log
  2372.  
  2373. # We need to redefine the presets etc path:
  2374. sed -i -e "s#share/projectM#share/vlc/projectM#" $(grep -lr 'share/projectM' .)
  2375.  
  2376. mkdir build
  2377. cd build
  2378.   CFLAGS="$SLKCFLAGS" \
  2379.   CXXFLAGS="$SLKCFLAGS" \
  2380.   LDFLAGS="$SLKLDFLAGS" \
  2381.   cmake \
  2382.     -DCMAKE_VERBOSE_MAKEFILE:BOOL=ON \
  2383.     -DUSE_FTGL:BOOL=OFF \
  2384.     -DUSE_NATIVE_GLEW:BOOL=OFF \
  2385.     -DINCLUDE-PROJECTM-LIBVISUAL:BOOL=OFF \
  2386.     -DINCLUDE-PROJECTM-PULSEAUDIO:BOOL=OFF \
  2387.     -DINCLUDE-PROJECTM-QT:BOOL=OFF \
  2388.     -DDISABLE_NATIVE_PRESETS:BOOL=ON \
  2389.     -DBUILD_PROJECTM_STATIC:BOOL=ON \
  2390.     -DCMAKE_INSTALL_PREFIX=/usr \
  2391.     -DLIB_SUFFIX=${LIBDIRSUFFIX} \
  2392.     .. \
  2393.     2>&1 | tee $OUTPUT/cmake-${PRGNAM}_projectm.log
  2394.   make -j${NUMJOBS} 2>&1 | tee $OUTPUT/make-${PRGNAM}_projectm.log
  2395.   # Install projectm into a temp location so vlc can pickup the library
  2396.   make install DESTDIR=$VLCDEPSDIR \
  2397.     2>&1 | tee -a $OUTPUT/make-${PRGNAM}_projectm.log
  2398.   ## These are being forgotten...
  2399.   cp Renderer/libRenderer.a MilkdropPresetFactory/libMilkdropPresetFactory.a \
  2400.     $VLCDEPSDIR/usr/lib${LIBDIRSUFFIX}/
  2401. cd ..
  2402. # Add DOCS to the vlcdeps to have it added to vlc package later:
  2403. mkdir -p $VLCDEPSDIR/doc/projectm/
  2404. cp COPYING ChangeLog $VLCDEPSDIR/doc/projectm/  || true
  2405. cd -
  2406. }
  2407.  
  2408.  
  2409. # -----------------------------------------------------------------------------
  2410. # Compile ggi
  2411. # -----------------------------------------------------------------------------
  2412. make_ggi()
  2413. {
  2414. echo -e "**\n**  ggi  ...\n**"
  2415. INDIR=$(pwd)
  2416. # First libgii which is a dependency
  2417. cd $TMP/tmp-$PRGNAM/ggi-${GGI}-bundle/libgii-$GII
  2418. # Do not add '-fPIC' or "undefined reference to `ggGetSwarType'" will occur
  2419. # when building cpuinfo:
  2420. CFLAGS="$SLKCFLAGS" \
  2421. CXXFLAGS="$SLKCFLAGS" \
  2422. LDFLAGS="$SLKLDFLAGS" \
  2423. ./configure \
  2424.   --prefix=$VLCDEPSDIR/usr \
  2425.   --libdir=$VLCDEPSDIR/usr/lib${LIBDIRSUFFIX} \
  2426.   --sysconfdir=/usr/share/vlc/etc \
  2427.   --enable-static \
  2428.   --disable-shared \
  2429.   --disable-debug \
  2430.   --program-prefix= \
  2431.   --program-suffix= \
  2432.   --build=$ARCH-slackware-linux \
  2433.   2>&1 | tee $OUTPUT/configure-${PRGNAM}_ggi.log
  2434. make -j${NUMJOBS} 2>&1 | tee $OUTPUT/make-${PRGNAM}_ggi.log
  2435. # Install gii into a temp location so libggi can pickup the library
  2436. echo -e "\n**\n**\n"
  2437. make sysconfdir=$VLCDEPSDIR/etc install \
  2438.   2>&1 | tee -a $OUTPUT/make-${PRGNAM}_ggi.log
  2439. # Add DOCS to the vlcdeps to have it added to vlc package later:
  2440. mkdir -p $VLCDEPSDIR/doc/libgii/
  2441. cp ChangeLog* FAQ NEWS README \
  2442.   $VLCDEPSDIR/doc/libgii/  || true
  2443.  
  2444. # Next, libggi
  2445. cd $TMP/tmp-$PRGNAM/ggi-${GGI}-bundle/libggi-$GGI
  2446. CFLAGS="-I$VLCDEPSDIR/usr/include $SLKCFLAGS" \
  2447. CPPFLAGS="-I$VLCDEPSDIR/usr/include $SLKCFLAGS" \
  2448. LDFLAGS="-L$VLCDEPSDIR/usr/lib${LIBDIRSUFFIX} $SLKLDFLAGS" \
  2449. PKG_CONFIG_PATH="$VLCDEPSDIR/usr/lib${LIBDIRSUFFIX}/pkgconfig" \
  2450. ./configure \
  2451.   --prefix=$VLCDEPSDIR/usr \
  2452.   --libdir=$VLCDEPSDIR/usr/lib${LIBDIRSUFFIX} \
  2453.   --sysconfdir=/usr/share/vlc/etc \
  2454.   --enable-static \
  2455.   --disable-shared \
  2456.   --disable-debug \
  2457.   --with-gii=$VLCDEPSDIR/usr \
  2458.   --program-prefix= \
  2459.   --program-suffix= \
  2460.   --build=$ARCH-slackware-linux \
  2461.   2>&1 | tee -a $OUTPUT/configure-${PRGNAM}_ggi.log
  2462. make -j${NUMJOBS} 2>&1 | tee -a $OUTPUT/make-${PRGNAM}_ggi.log
  2463. # Install ggi into a temp location so vlc can pickup the library
  2464. echo -e "\n**\n**\n"
  2465. make sysconfdir=$VLCDEPSDIR/etc install \
  2466.   2>&1 | tee -a $OUTPUT/make-${PRGNAM}_ggi.log
  2467. # Add DOCS to the vlcdeps to have it added to vlc package later:
  2468. mkdir -p $VLCDEPSDIR/doc/libggi/
  2469. cp ChangeLog* FAQ NEWS README \
  2470.   $VLCDEPSDIR/doc/libggi/  || true
  2471.  
  2472. cd $INDIR
  2473. }
  2474.  
  2475. # -----------------------------------------------------------------------------
  2476. # Compile x264
  2477. # -----------------------------------------------------------------------------
  2478. make_x264()
  2479. {
  2480. echo -e "**\n**  x264  ...\n**"
  2481. if [ "$ARCH" = "x86_64" -o "$ARCH" = "armv7hl" ]; then
  2482.   ARCHOPTS="--enable-pic"
  2483. else
  2484.   ARCHOPTS=""
  2485. fi
  2486. cd $TMP/tmp-$PRGNAM/x264-snapshot-${X264}
  2487. CFLAGS="$SLKCFLAGS" \
  2488. CXXFLAGS="$SLKCFLAGS" \
  2489. LDFLAGS="$SLKLDFLAGS" \
  2490. ./configure \
  2491.   --prefix=$VLCDEPSDIR/usr \
  2492.   --libdir=$VLCDEPSDIR/usr/lib${LIBDIRSUFFIX} \
  2493.   --enable-static \
  2494.   --disable-cli \
  2495.   $ARCHOPTS \
  2496.   2>&1 | tee $OUTPUT/configure-${PRGNAM}_x264.log
  2497. make -j${NUMJOBS} 2>&1 | tee $OUTPUT/make-${PRGNAM}_x264.log
  2498. # Install x264 into a temp location so vlc can pickup the library
  2499. make install 2>&1 | tee -a $OUTPUT/make-${PRGNAM}_x264.log
  2500. # Add DOCS to the vlcdeps to have it added to vlc package later:
  2501. mkdir -p $VLCDEPSDIR/doc/x264/
  2502. cp AUTHORS COPYING \
  2503.   $VLCDEPSDIR/doc/x264/  || true
  2504. cd -
  2505. }
  2506.  
  2507. # -----------------------------------------------------------------------------
  2508. # Compile dv
  2509. # -----------------------------------------------------------------------------
  2510. make_dv()
  2511. {
  2512. echo -e "**\n**  dv  ...\n**"
  2513. cd $TMP/tmp-$PRGNAM/libdv-${DV}
  2514. CFLAGS="$SLKCFLAGS" \
  2515. CXXFLAGS="$SLKCFLAGS" \
  2516. LDFLAGS="$SLKLDFLAGS" \
  2517. ./configure \
  2518.   --prefix=$VLCDEPSDIR/usr \
  2519.   --libdir=$VLCDEPSDIR/usr/lib${LIBDIRSUFFIX} \
  2520.   --disable-gtk \
  2521.   --disable-xv \
  2522.   --enable-static \
  2523.   --disable-shared \
  2524.   --program-prefix= \
  2525.   --program-suffix= \
  2526.   --build=$ARCH-slackware-linux \
  2527.   2>&1 | tee $OUTPUT/configure-${PRGNAM}_dv.log
  2528. make -j${NUMJOBS} 2>&1 | tee $OUTPUT/make-${PRGNAM}_dv.log
  2529. # Install dv into a temp location so vlc can pickup the library
  2530. make install 2>&1 | tee -a $OUTPUT/make-${PRGNAM}_dv.log
  2531. # Add DOCS to the vlcdeps to have it added to vlc package later:
  2532. mkdir -p $VLCDEPSDIR/doc/libdv/
  2533. cp AUTHORS COPYING COPYRIGHT ChangeLog NEWS README* TODO \
  2534.   $VLCDEPSDIR/doc/libdv/  || true
  2535. cd -
  2536. }
  2537.  
  2538. # -----------------------------------------------------------------------------
  2539. # Compile libdvbpsi library
  2540. # -----------------------------------------------------------------------------
  2541. make_dvbpsi()
  2542. {
  2543. echo -e "**\n**  dvbpsi ...\n**"
  2544. cd $TMP/tmp-$PRGNAM/libdvbpsi-${DVBPSI}
  2545. CFLAGS="$SLKCFLAGS" \
  2546. CXXFLAGS="$SLKCFLAGS" \
  2547. LDFLAGS="$SLKLDFLAGS" \
  2548. ./configure \
  2549.   --prefix=$VLCDEPSDIR/usr \
  2550.   --libdir=$VLCDEPSDIR/usr/lib${LIBDIRSUFFIX} \
  2551.   --enable-static \
  2552.   --disable-shared \
  2553.   --disable-debug \
  2554.   --enable-release \
  2555.   --program-prefix= \
  2556.   --program-suffix= \
  2557.   --build=$ARCH-slackware-linux \
  2558.   2>&1 | tee $OUTPUT/configure-${PRGNAM}_dvbpsi.log
  2559. make -j${NUMJOBS} 2>&1 | tee $OUTPUT/make-${PRGNAM}_dvbpsi.log
  2560. # Install dvbpsi into a temp location so vlc can pickup the library
  2561. make install 2>&1 | tee -a $OUTPUT/make-${PRGNAM}_dvbpsi.log
  2562. # Add DOCS to the vlcdeps to have it added to vlc package later:
  2563. mkdir -p $VLCDEPSDIR/doc/libdvbpsi/
  2564. cp AUTHORS COPYING ChangeLog NEWS README \
  2565.   $VLCDEPSDIR/doc/libdvbpsi/  || true
  2566. cd -
  2567. }
  2568.  
  2569. # -----------------------------------------------------------------------------
  2570. # Compile libdca library
  2571. # -----------------------------------------------------------------------------
  2572. make_dca()
  2573. {
  2574. echo -e "**\n**  dca ...\n**"
  2575. cd $TMP/tmp-$PRGNAM/libdca-${DCA}
  2576. CFLAGS="$SLKCFLAGS" \
  2577. CXXFLAGS="$SLKCFLAGS" \
  2578. LDFLAGS="$SLKLDFLAGS" \
  2579. ./configure \
  2580.   --prefix=$VLCDEPSDIR/usr \
  2581.   --libdir=$VLCDEPSDIR/usr/lib${LIBDIRSUFFIX} \
  2582.   --enable-static \
  2583.   --disable-shared \
  2584.   --disable-debug \
  2585.   --program-prefix= \
  2586.   --program-suffix= \
  2587.   --build=$ARCH-slackware-linux \
  2588.   2>&1 | tee $OUTPUT/configure-${PRGNAM}_dca.log
  2589. make -j${NUMJOBS} 2>&1 | tee $OUTPUT/make-${PRGNAM}_dca.log
  2590. # Install dca into a temp location so vlc can pickup the library
  2591. make install 2>&1 | tee -a $OUTPUT/make-${PRGNAM}_dca.log
  2592. # Fix a broken symlink:
  2593. ( cd $VLCDEPSDIR/usr/lib${LIBDIRSUFFIX}
  2594.   if [ -L libdts.a ] ; then
  2595.     rm -f libdts.a ; ln -s libdca.a libdts.a
  2596.   fi
  2597. )
  2598. # Add DOCS to the vlcdeps to have it added to vlc package later:
  2599. mkdir -p $VLCDEPSDIR/doc/libdca/
  2600. cp AUTHORS COPYING ChangeLog NEWS README TODO \
  2601.   $VLCDEPSDIR/doc/libdca/  || true
  2602. cd -
  2603. }
  2604.  
  2605. # -----------------------------------------------------------------------------
  2606. # Compile avc1394 raw1394 and dc1394 libraries
  2607. # VLC will use these
  2608. # -----------------------------------------------------------------------------
  2609. make_1394()
  2610. {
  2611. echo -e "**\n**  1394 ...\n**"
  2612. OLDDIR=$(pwd)
  2613. cd $TMP/tmp-$PRGNAM/libraw1394-${RAW1394}
  2614.  
  2615. # Or else vlc compilation fails with "error: redefinition of typedef 'byte_t'"
  2616. patch -p0 --verbose < $SRCDIR/libraw1394_typedef.patch \
  2617.   2>&1 | tee -a $OUTPUT/patch-${PRGNAM}_raw1394.log
  2618.  
  2619. [ ! -x configure ] && ./autogen.sh
  2620.  
  2621. # Seems I need this ugly prefix or else I have to dig into the problem of vlc
  2622. # incorrectly interpreting *.la contents...
  2623. CFLAGS="$SLKCFLAGS" \
  2624. CXXFLAGS="$SLKCFLAGS" \
  2625. LDFLAGS="$SLKLDFLAGS" \
  2626. ./configure \
  2627.   --prefix=$VLCDEPSDIR/usr \
  2628.   --libdir=$VLCDEPSDIR/usr/lib${LIBDIRSUFFIX} \
  2629.   --mandir=$VLCDEPSDIR/usr/man \
  2630.   --enable-static \
  2631.   --disable-shared \
  2632.   --program-prefix= \
  2633.   --program-suffix= \
  2634.   --build=$ARCH-slackware-linux \
  2635.   2>&1 | tee $OUTPUT/configure-${PRGNAM}_raw1394.log
  2636. make -j${NUMJOBS} 2>&1 | tee $OUTPUT/make-${PRGNAM}_raw1394.log
  2637. # Install libraw1394 into a temp location so vlc can pickup the library
  2638. make install 2>&1 | tee -a $OUTPUT/make-${PRGNAM}_raw1394.log
  2639. # Add DOCS to the vlcdeps to have it added to vlc package later:
  2640. mkdir -p $VLCDEPSDIR/doc/libraw1394/
  2641. cp AUTHORS COPYING.LIB ChangeLog NEWS README \
  2642.   $VLCDEPSDIR/doc/libraw1394/  || true
  2643.  
  2644. echo -e "**\n**"
  2645.  
  2646. cd $TMP/tmp-$PRGNAM/libavc1394-${AVC1394}
  2647.  
  2648. CFLAGS="-I$VLCDEPSDIR/usr/include $SLKCFLAGS" \
  2649. CPPFLAGS="-I$VLCDEPSDIR/usr/include $SLKCFLAGS" \
  2650. LDFLAGS="-L$VLCDEPSDIR/usr/lib${LIBDIRSUFFIX} $SLKLDFLAGS" \
  2651. PKG_CONFIG_PATH="$VLCDEPSDIR/usr/lib${LIBDIRSUFFIX}/pkgconfig" \
  2652. LIBRAW1394_CFLAGS="-I$VLCDEPSDIR/usr/include" \
  2653. LIBRAW1394_LIBS="-L$VLCDEPSDIR/usr/lib${LIBDIRSUFFIX} -lraw1394" \
  2654. ./configure \
  2655.   --prefix=$VLCDEPSDIR/usr \
  2656.   --libdir=$VLCDEPSDIR/usr/lib${LIBDIRSUFFIX} \
  2657.   --enable-static \
  2658.   --disable-shared \
  2659.   --program-prefix= \
  2660.   --program-suffix= \
  2661.   --build=$ARCH-slackware-linux \
  2662.   2>&1 | tee $OUTPUT/configure-${PRGNAM}_avc1394.log
  2663. make -j${NUMJOBS} 2>&1 | tee $OUTPUT/make-${PRGNAM}_avc1394.log
  2664. # Install libavc1394 into a temp location so vlc can pickup the library
  2665. make install 2>&1 | tee -a $OUTPUT/make-${PRGNAM}_avc1394.log
  2666. # Add DOCS to the vlcdeps to have it added to vlc package later:
  2667. mkdir -p $VLCDEPSDIR/doc/libavc1394/
  2668. cp AUTHORS COPYING ChangeLog NEWS README TODO \
  2669.   $VLCDEPSDIR/doc/libavc1394/  || true
  2670.  
  2671. echo -e "**\n**"
  2672.  
  2673. cd $TMP/tmp-$PRGNAM/libdc1394-${DC1394}
  2674.  
  2675. ## Skip building the examples - those cause errors:
  2676. #cat $SRCDIR/libdc1394-noexamples.patch | patch -p1 --verbose \
  2677. #  2>&1 | tee $OUTPUT/patch-${PRGNAM}_dc1394.log
  2678.  
  2679. # Make sure that the static libdc1394 is found in the vlcdeps:
  2680. CFLAGS="-I$VLCDEPSDIR/usr/include $SLKCFLAGS" \
  2681. CPPFLAGS="-I$VLCDEPSDIR/usr/include $SLKCFLAGS" \
  2682. LDFLAGS="-L$VLCDEPSDIR/usr/lib${LIBDIRSUFFIX} -lraw1394 $SLKLDFLAGS" \
  2683. PKG_CONFIG_PATH="$VLCDEPSDIR/usr/lib${LIBDIRSUFFIX}/pkgconfig" \
  2684. ./configure \
  2685.   --prefix=$VLCDEPSDIR/usr \
  2686.   --libdir=$VLCDEPSDIR/usr/lib${LIBDIRSUFFIX} \
  2687.   --enable-static \
  2688.   --disable-shared \
  2689.   --disable-examples \
  2690.   --program-prefix= \
  2691.   --program-suffix= \
  2692.   --build=$ARCH-slackware-linux \
  2693.   2>&1 | tee $OUTPUT/configure-${PRGNAM}_dc1394.log
  2694.   # Building the examples fails on kernel >= 2.6.38 because that deprecated
  2695.   # the v4l1 interface. You'll get the error "dc1394_vloopback.c:49:28:
  2696.   # fatal error: linux/videodev.h: No such file or directory"
  2697. make -j${NUMJOBS} 2>&1 | tee $OUTPUT/make-${PRGNAM}_dc1394.log
  2698. # Install libdc1394 into a temp location so vlc can pickup the library
  2699. make install 2>&1 | tee -a $OUTPUT/make-${PRGNAM}_dc1394.log
  2700. # Fix the pkgconfig file to get rid of unresolved symbols at runtime:
  2701. sed -i -e "/^Libs:/s/$/ -lavc1394 -lraw1394/" $VLCDEPSDIR/usr/lib${LIBDIRSUFFIX}/pkgconfig/libdc1394-2.pc
  2702. # Add DOCS to the vlcdeps to have it added to vlc package later:
  2703. mkdir -p $VLCDEPSDIR/doc/libdc1394/
  2704. cp AUTHORS COPYING ChangeLog NEWS README \
  2705.   $VLCDEPSDIR/doc/libdc1394/  || true
  2706.  
  2707. cd $OLDDIR
  2708. }
  2709.  
  2710.  
  2711. # -----------------------------------------------------------------------------
  2712. # Compile fribidi
  2713. # -----------------------------------------------------------------------------
  2714. make_fribidi()
  2715. {
  2716. echo -e "**\n**  fribidi  ...\n**"
  2717. cd $TMP/tmp-$PRGNAM/fribidi-$FRIBIDI
  2718. if [ "$ARCH" = "x86_64" -o "$ARCH" = "armv7hl" ]; then
  2719.   ARCHOPTS="--with-pic"
  2720. else
  2721.   ARCHOPTS=""
  2722. fi
  2723.  
  2724. # Allow for internal use of the library:
  2725. cat $SRCDIR/fribidi.patch | patch -p1 --verbose \
  2726.   2>&1 | tee $OUTPUT/patch-${PRGNAM}_fribidi.log
  2727.  
  2728. # And since we patched the Makefile.am we have to bootstrap:
  2729. rm -f configure
  2730. ./bootstrap
  2731.  
  2732. CFLAGS="$SLKCFLAGS" \
  2733. CXXFLAGS="$SLKCFLAGS" \
  2734. LDFLAGS="$SLKLDFLAGS" \
  2735. ./configure \
  2736.   --prefix=$VLCDEPSDIR/usr \
  2737.   --libdir=$VLCDEPSDIR/usr/lib${LIBDIRSUFFIX} \
  2738.   --enable-static \
  2739.   --disable-shared \
  2740.   --program-prefix= \
  2741.   --program-suffix= \
  2742.   $ARCHOPTS \
  2743.   --build=$ARCH-slackware-linux \
  2744.   2>&1 | tee $OUTPUT/configure-${PRGNAM}_fribidi.log
  2745. make -j${NUMJOBS} 2>&1 | tee $OUTPUT/make-${PRGNAM}_fribidi.log
  2746. # Install fribidi into a temp location so vlc can pickup the library
  2747. echo -e "\n**\n**\n"
  2748. make install 2>&1 | tee -a $OUTPUT/make-${PRGNAM}_fribidi.log
  2749. # Add DOCS to the vlcdeps to have it added to vlc package later:
  2750. mkdir -p $VLCDEPSDIR/doc/fribidi/
  2751. cp AUTHORS COPYING ChangeLog NEWS README THANKS TODO \
  2752.   $VLCDEPSDIR/doc/fribidi/  || true
  2753. cd -
  2754. }
  2755.  
  2756.  
  2757. # -----------------------------------------------------------------------------
  2758. # Compile libass
  2759. # -----------------------------------------------------------------------------
  2760. make_ass()
  2761. {
  2762. echo -e "**\n**  ass  ...\n**"
  2763. cd $TMP/tmp-$PRGNAM/libass-$ASS
  2764. CFLAGS="-I$VLCDEPSDIR/usr/include $SLKCFLAGS" \
  2765. CXXFLAGS="-I$VLCDEPSDIR/usr/include $SLKCFLAGS" \
  2766. LDFLAGS="-L$VLCDEPSDIR/usr/lib${LIBDIRSUFFIX} $SLKLDFLAGS" \
  2767. PKG_CONFIG_PATH="$VLCDEPSDIR/usr/lib${LIBDIRSUFFIX}/pkgconfig" \
  2768. ./configure \
  2769.   --prefix=$VLCDEPSDIR/usr \
  2770.   --libdir=$VLCDEPSDIR/usr/lib${LIBDIRSUFFIX} \
  2771.   --enable-static \
  2772.   --disable-shared \
  2773.   --program-prefix= \
  2774.   --program-suffix= \
  2775.   --build=$ARCH-slackware-linux \
  2776.   2>&1 | tee $OUTPUT/configure-${PRGNAM}_ass.log
  2777. make -j${NUMJOBS} 2>&1 | tee $OUTPUT/make-${PRGNAM}_ass.log
  2778. # Install libass into a temp location so vlc can pickup the library
  2779. echo -e "\n**\n**\n"
  2780. make install 2>&1 | tee -a $OUTPUT/make-${PRGNAM}_ass.log
  2781. # Add DOCS to the vlcdeps to have it added to vlc package later:
  2782. mkdir -p $VLCDEPSDIR/doc/libass/
  2783. cp COPYING Changelog $VLCDEPSDIR/doc/libass/  || true
  2784. cd -
  2785. }
  2786.  
  2787.  
  2788. # -----------------------------------------------------------------------------
  2789. # Compile fluidsynth
  2790. # -----------------------------------------------------------------------------
  2791. make_fluid()
  2792. {
  2793. echo -e "**\n**  fluidsynth  ...\n**"
  2794. cd $TMP/tmp-$PRGNAM/fluidsynth-$FLUID
  2795. CFLAGS="$SLKCFLAGS" \
  2796. CXXFLAGS="$SLKCFLAGS" \
  2797. LDFLAGS="$SLKLDFLAGS" \
  2798. ./configure \
  2799.   --prefix=$VLCDEPSDIR/usr \
  2800.   --libdir=$VLCDEPSDIR/usr/lib${LIBDIRSUFFIX} \
  2801.   --enable-static \
  2802.   --disable-shared \
  2803.   --enable-double \
  2804.   --disable-jack-support \
  2805.   --without-readline \
  2806.   --program-prefix= \
  2807.   --program-suffix= \
  2808.   --build=$ARCH-slackware-linux \
  2809.   2>&1 | tee $OUTPUT/configure-${PRGNAM}_fluid.log
  2810. make -j${NUMJOBS} 2>&1 | tee $OUTPUT/make-${PRGNAM}_fluid.log
  2811. # Install fluid into a temp location so vlc can pickup the library
  2812. echo -e "\n**\n**\n"
  2813. make install 2>&1 | tee -a $OUTPUT/make-${PRGNAM}_fluid.log
  2814. # Fix a missing link dependency (resolves 'unknown symbols' runtime):
  2815. sed -i -e "/^Libs:/s/$/ -lasound -pthread -lgthread-2.0 -lrt -lglib-2.0/" $VLCDEPSDIR/usr/lib${LIBDIRSUFFIX}/pkgconfig/fluidsynth.pc
  2816. # Add DOCS to the vlcdeps to have it added to vlc package later:
  2817. mkdir -p $VLCDEPSDIR/doc/fluidsynth/
  2818. cp AUTHORS COPYING ChangeLog NEWS README THANKS TODO \
  2819.   $VLCDEPSDIR/doc/fluidsynth/  || true
  2820. cd -
  2821. }
  2822.  
  2823.  
  2824. # -----------------------------------------------------------------------------
  2825. # Compile kate
  2826. # -----------------------------------------------------------------------------
  2827. make_kate()
  2828. {
  2829. echo -e "**\n**  kate ...\n**"
  2830. cd $TMP/tmp-$PRGNAM/libkate-${KATE}
  2831.  
  2832. # Compatibility patch for libpng14:
  2833. cat $SRCDIR/libkate_png14.patch | patch -p0 --verbose \
  2834.   2>&1 | tee $OUTPUT/patch-${PRGNAM}_kate.log
  2835.  
  2836. CFLAGS="$SLKCFLAGS" \
  2837. CXXFLAGS="$SLKCFLAGS" \
  2838. LDFLAGS="$SLKLDFLAGS" \
  2839. PKG_CONFIG_PATH="$VLCDEPSDIR/usr/lib${LIBDIRSUFFIX}/pkgconfig" \
  2840. ./configure \
  2841.   --prefix=$VLCDEPSDIR/usr \
  2842.   --libdir=$VLCDEPSDIR/usr/lib${LIBDIRSUFFIX} \
  2843.   --enable-static \
  2844.   --disable-shared \
  2845.   --disable-valgrind \
  2846.   --disable-doc \
  2847.   --program-prefix= \
  2848.   --program-suffix= \
  2849.   --build=$ARCH-slackware-linux \
  2850.   2>&1 | tee $OUTPUT/configure-${PRGNAM}_kate.log
  2851. make -j${NUMJOBS} 2>&1 | tee $OUTPUT/make-${PRGNAM}_kate.log
  2852. # Install kate into a temp location so vlc can pickup the library
  2853. make install 2>&1 | tee -a $OUTPUT/make-${PRGNAM}_kate.log
  2854. # Add DOCS to the vlcdeps to have it added to vlc package later:
  2855. mkdir -p $VLCDEPSDIR/doc/libkate/
  2856. cp AUTHORS COPYING README THANKS \
  2857.   $VLCDEPSDIR/doc/libkate/ || true
  2858. cd -
  2859. }
  2860.  
  2861.  
  2862. # -----------------------------------------------------------------------------
  2863. # Compile libtiger
  2864. # -----------------------------------------------------------------------------
  2865. make_tiger()
  2866. {
  2867. echo -e "**\n**  tiger ...\n**"
  2868. cd $TMP/tmp-$PRGNAM/libtiger-${TIGER}
  2869.  
  2870. CFLAGS="-I$VLCDEPSDIR/usr/include $SLKCFLAGS" \
  2871. CXXFLAGS="-I$VLCDEPSDIR/usr/include $SLKCFLAGS" \
  2872. LDFLAGS="-L$VLCDEPSDIR/usr/lib${LIBDIRSUFFIX} $SLKLDFLAGS" \
  2873. PKG_CONFIG_PATH="$VLCDEPSDIR/usr/lib${LIBDIRSUFFIX}/pkgconfig" \
  2874. ./configure \
  2875.   --prefix=$VLCDEPSDIR/usr \
  2876.   --libdir=$VLCDEPSDIR/usr/lib${LIBDIRSUFFIX} \
  2877.   --enable-static \
  2878.   --disable-shared \
  2879.   --disable-doc \
  2880.   --program-prefix= \
  2881.   --program-suffix= \
  2882.   --build=$ARCH-slackware-linux \
  2883.   2>&1 | tee $OUTPUT/configure-${PRGNAM}_tiger.log
  2884. make -j${NUMJOBS} 2>&1 | tee $OUTPUT/make-${PRGNAM}_tiger.log
  2885. # Install tiger into a temp location so vlc can pickup the library
  2886. make install 2>&1 | tee -a $OUTPUT/make-${PRGNAM}_tiger.log
  2887. # Add DOCS to the vlcdeps to have it added to vlc package later:
  2888. mkdir -p $VLCDEPSDIR/doc/libtiger/
  2889. cp AUTHORS COPYING README THANKS \
  2890.   $VLCDEPSDIR/doc/libtiger/ || true
  2891. cd -
  2892. }
  2893.  
  2894.  
  2895. # -----------------------------------------------------------------------------
  2896. # Compile lua
  2897. # -----------------------------------------------------------------------------
  2898. make_lua()
  2899. {
  2900. echo -e "**\n**  lua ...\n**"
  2901. cd $TMP/tmp-$PRGNAM/lua-${LUA}
  2902.  
  2903. # Use 32-bits LUAC file format on all platforms. In other words,
  2904. # 64-bits platform will support 32-bits LUAC files and reject 64-bits LUAC
  2905. # files. This should ease cross-compilation and copying luac files manually.
  2906. cat $SRCDIR/luac-32bits.patch | patch -p1 --verbose \
  2907.   2>&1 | tee $OUTPUT/patch-${PRGNAM}_lua.log
  2908.  
  2909. # Make it use our CFLAGS:
  2910. sed -i "s/-DLUA_USE_LINUX/\"-DLUA_USE_LINUX $SLKCFLAGS\"/g" src/Makefile
  2911.  
  2912. # Fix paths (lib64 for x86_64):
  2913. sed -i "s#/lib#/lib${LIBDIRSUFFIX}#" Makefile
  2914. sed -i "s#/usr/local#/usr#" Makefile
  2915.  
  2916. MYLDFLAGS="$SLKLDFLAGS -ld" make linux -j${NUMJOBS} \
  2917.   2>&1 | tee $OUTPUT/make-${PRGNAM}_lua.log
  2918. # Install lua into a temp location so vlc can pickup the library
  2919. make install INSTALL_TOP=$VLCDEPSDIR/usr \
  2920.   2>&1 | tee -a $OUTPUT/make-${PRGNAM}_lua.log
  2921. # Install a pkg-config file:
  2922. install -D -m 0644 etc/lua.pc $VLCDEPSDIR/usr/lib${LIBDIRSUFFIX}/pkgconfig/lua.pc
  2923. # Add DOCS to the vlcdeps to have it added to vlc package later:
  2924. mkdir -p $VLCDEPSDIR/doc/lua
  2925. cp COPYRIGHT HISTORY README $VLCDEPSDIR/doc/lua/ || true
  2926. cd -
  2927. }
  2928.  
  2929.  
  2930. # -----------------------------------------------------------------------------
  2931. # Compile v4l libraries
  2932. # -----------------------------------------------------------------------------
  2933. make_v4l()
  2934. {
  2935. echo -e "**\n**  v4l ...\n**"
  2936. cd $TMP/tmp-$PRGNAM/v4l-utils-${V4L}
  2937.  
  2938. # Apply patch for proper DESTDIR support:
  2939. cat $SRCDIR/v4l-utils.destdir.patch | patch -p1 --verbose \
  2940.   2>&1 | tee $OUTPUT/patch-${PRGNAM}_v4l.log
  2941. mkdir ${VLCDEPSDIR}/etc
  2942.  
  2943. export CFLAGS="$SLKCFLAGS"
  2944. export CPPFLAGS="$SLKCFLAGS"
  2945. export LDFLAGS="$SLKLDFLAGS -ljpeg"
  2946. make -j${NUMJOBS} -C lib LINKTYPE=static PREFIX=$VLCDEPSDIR/usr LIBDIR=$VLCDEPSDIR/usr/lib${LIBDIRSUFFIX} SYSCONFDIR=$VLCDEPSDIR/etc 2>&1 | tee $OUTPUT/make-${PRGNAM}_v4l.log
  2947. # Strip the static lib to prevent linking errors in 64-bit,
  2948. # and fix the pkg-config file (to fix unresolved symbols in the plugin)
  2949. find . -name "*.a" | xargs strip --strip-unneeded
  2950. sed -i "/^Libs: /s/$/ -lv4l2 -lv4lconvert -ljpeg/" lib/libv4l1/libv4l1.pc
  2951. sed -i "/^Libs: /s/ -lv4l2/ -lv4l2 -lv4lconvert -ljpeg/" lib/libv4l2/libv4l2.pc
  2952. # Install libv4l into a temp directory so that vlc can pick it up later:
  2953. make -C lib install LINKTYPE=static PREFIX=$VLCDEPSDIR/usr LIBDIR=$VLCDEPSDIR/usr/lib${LIBDIRSUFFIX} SYSCONFDIR=$VLCDEPSDIR/etc 2>&1 | tee -a $OUTPUT/make-${PRGNAM}_v4l.log
  2954. # Add DOCS to the vlcdeps to have it added to vlc package later:
  2955. mkdir -p $VLCDEPSDIR/doc/v4l-utils/
  2956. cp COPYING* ChangeLog README* TODO $VLCDEPSDIR/doc/v4l-utils/ || true
  2957. cd -
  2958. }
  2959.  
  2960.  
  2961. # -----------------------------------------------------------------------------
  2962. # Compile libva
  2963. # -----------------------------------------------------------------------------
  2964. make_libva()
  2965. {
  2966. echo -e "**\n**  libva ...\n**"
  2967. cd $TMP/tmp-$PRGNAM/libva-$(echo "$LIBVA" |cut -d- -f1)
  2968.  
  2969. #
  2970. # == NOTE ON VAAPI ==
  2971. #
  2972. # VAAPI can enable hardware accelerated playback for MPEG-2/4, H.264/AVC
  2973. # and VC-1 video on certain graphics hardware.
  2974. # The VAAPI support in this VLC package depends on VA drivers that you have to
  2975. # install yourself for your specific hardware. The drivers should go into
  2976. # directory /usr/lib${LIBDIRSUFFIX}/va/drivers .
  2977. # If you install my libva package you can get MPEG-2 hardware acceleration on
  2978. # Intel graphics. If you additionally install my vdpau-video package, then you
  2979. # get hardware acceleration on Nvidia graphics (with nvidia's binary driver).
  2980. # If you own an Ati card and use the fglrx driver, then you can achieve
  2981. # hardware acceleration by installing the xvba-video driver from here:
  2982. # http://www.splitted-desktop.com/~gbeauchesne/xvba-video/ (since I do not own
  2983. # Ati hardware I can not build a package for xvba-video myself)
  2984. #
  2985.  
  2986. # Apply a wad of patches:
  2987. for DPATCH in $(ls debian/patches/*.patch) ; do
  2988.   cat $DPATCH |patch -p1 --verbose
  2989. done 2>&1 | tee $OUTPUT/patch-${PRGNAM}_libva.log
  2990.  
  2991. ## Slackware uses a newer aclocal:
  2992. autoreconf -vif
  2993.  
  2994. CFLAGS="$SLKCFLAGS" \
  2995. CXXFLAGS="$SLKCFLAGS" \
  2996. LDFLAGS="$SLKLDFLAGS" \
  2997. ./configure \
  2998.   --prefix=/usr \
  2999.   --libdir=/usr/lib${LIBDIRSUFFIX} \
  3000.   --enable-static \
  3001.   --enable-shared \
  3002.   --enable-glx \
  3003.   --with-drivers-path=/usr/lib${LIBDIRSUFFIX}/va/drivers \
  3004.   --program-prefix= \
  3005.   --program-suffix= \
  3006.   --build=$ARCH-slackware-linux \
  3007.   2>&1 | tee $OUTPUT/configure-${PRGNAM}_libva.log
  3008. make -j${NUMJOBS} 2>&1 | tee $OUTPUT/make-${PRGNAM}_libva.log
  3009. # Strip the static lib to prevent linking errors in 64-bit,
  3010. find . -name "*.a" | xargs strip --strip-unneeded
  3011. # Install libva into a temp location so vlc can pickup the library
  3012. echo -e "\n**\n**\n"
  3013. make install DESTDIR=$VLCDEPSDIR 2>&1 | tee -a $OUTPUT/make-${PRGNAM}_libva.log
  3014. # Remove the .so and .la files; we want static linking (but still use
  3015. # the drivers in $(libdir)/va/drivers):
  3016. rm -f $VLCDEPSDIR/usr/lib${LIBDIRSUFFIX}/libva*.so*
  3017. rm -f $VLCDEPSDIR/usr/lib${LIBDIRSUFFIX}/libva*.la
  3018. ## Fix the pkgconfig file to get rid of unresolved symbols at link time:
  3019. #sed -i -e "/^Libs:/s/$/ -ldl/" \
  3020. #  $VLCDEPSDIR/usr/lib${LIBDIRSUFFIX}/pkgconfig/libva*.pc
  3021. # Add DOCS to the vlcdeps to have it added to vlc package later:
  3022. mkdir -p $VLCDEPSDIR/doc/libva/
  3023. cp COPYING $VLCDEPSDIR/doc/libva/  || true
  3024. cd -
  3025. }
  3026.  
  3027.  
  3028. # -----------------------------------------------------------------------------
  3029. # Compile xulrunner
  3030. # -----------------------------------------------------------------------------
  3031. make_xul()
  3032. {
  3033. echo -e "**\n**  xul ...\n**"
  3034. cd $TMP/tmp-$PRGNAM/mozilla-$(echo $XUL | cut -d. -f1-3)
  3035.  
  3036. # Compiling xulrunner takes a long, long time. We will look for a pre-compiled
  3037. # version of the xulrunner SDK in the $SRCDIR and use that instead if available.
  3038. # You can find a tarball of this SDK after the xulrunner compilation has ended;
  3039. # check the ./dist/sdk subdirectory in the source tree and copy the file
  3040. # xulrunner-*.sdk.tar.bz2 to the directory containing vlc.SlackBuild.
  3041. MOZSDK=$(ls --indicator-style=none $SRCDIR/xulrunner-${XUL}.*.linux-$(uname -m).sdk.tar.bz2 | tail -1)
  3042.  
  3043. if [ -z "$MOZSDK" ]; then
  3044.   # We have to compile it now:
  3045.   export CFLAGS="$SLKCFLAGS"
  3046.   export CXXFLAGS="$SLKCFLAGS"
  3047.   export LDFLAGS="$SLKLDFLAGS"
  3048.   ./configure \
  3049.     --prefix=$VLCDEPSDIR/usr \
  3050.     --libdir=$VLCDEPSDIR/usr/lib${LIBDIRSUFFIX} \
  3051.     --disable-debug \
  3052.     --disable-installer \
  3053.     --disable-libnotify \
  3054.     --disable-shared \
  3055.     --disable-tests \
  3056.     --disable-updater \
  3057.     --enable-application=xulrunner \
  3058.     --enable-default-toolkit=cairo-gtk2 \
  3059.     --enable-javaxpcom \
  3060.     --enable-libxul \
  3061.     --enable-optimize="${CFLAGS}" \
  3062.     --enable-standalone-modules=xpcom,plugin \
  3063.     --enable-strip \
  3064.     --with-system-jpeg \
  3065.     --with-system-bz2 \
  3066.     --with-system-zlib \
  3067.     --build=$ARCH-slackware-linux \
  3068.     2>&1 | tee $OUTPUT/configure-${PRGNAM}_xul.log
  3069.   make MOZ_MAKE_FLAGS="$NUMJOBS" 2>&1 | tee $OUTPUT/make-${PRGNAM}_xul.log
  3070.   # Create an SDK package that we pass to vlc's configure:
  3071.   echo -e "\n**\n**\n"
  3072.   make sdk 2>&1 | tee -a $OUTPUT/make-${PRGNAM}_xul.log
  3073.   tar -C $VLCDEPSDIR/usr -xvf dist/sdk/xulrunner-${XUL}*.sdk.tar.bz2
  3074. else
  3075.   # Use our precompiled SDK - compiling it takes ages:
  3076.   echo "Using a precompiled mozilla SDK: $(basename $MOZSDK)"
  3077.   tar -C $VLCDEPSDIR/usr -xvf ${MOZSDK}
  3078. fi
  3079. # Add DOCS to the vlcdeps to have it added to vlc package later:
  3080. mkdir -p $VLCDEPSDIR/doc/xulrunner/
  3081. cp LEGAL LICENSE README.txt $VLCDEPSDIR/doc/xulrunner/  || true
  3082. cd -
  3083. }
  3084.  
  3085.  
  3086. # -----------------------------------------------------------------------------
  3087. # Compile VP8
  3088. # -----------------------------------------------------------------------------
  3089. make_vpx()
  3090. {
  3091. echo -e "**\n**  vpx  ...\n**"
  3092. cd $TMP/tmp-$PRGNAM/libvpx-${VPX}
  3093.  
  3094. case "$ARCH" in
  3095.   i?86)
  3096.     ARCHOPTS="--target=x86-linux-gcc"
  3097.     ;;
  3098.   x86_64)
  3099.     ARCHOPTS="--target=${ARCH}-linux-gcc --enable-pic"
  3100.     ;;
  3101.   armv7hl)
  3102.     ARCHOPTS="--target=armv7-linux-gcc --enable-pic"
  3103.     cat $SRCDIR/libvpx_fix-armhf-link.patch | patch -p1 --verbose
  3104.     export AS=as
  3105.     export AR=ar
  3106.     export CROSS="${TARGET}-"
  3107.     ;;
  3108.   arm*)
  3109.     ARCHOPTS="--target=armv5te-linux-gcc --enable-pic"
  3110.     export AS=as
  3111.     export AR=ar
  3112.     export CROSS="${TARGET}-"
  3113.     ;;
  3114.   *)
  3115.     ARCHOPTS="--target=${ARCH}-linux-gcc"
  3116.     ;;
  3117. esac
  3118.  
  3119. CFLAGS="$SLKCFLAGS" \
  3120. CXXFLAGS="$SLKCFLAGS" \
  3121. LDFLAGS="$SLKLDFLAGS" \
  3122. ./configure \
  3123.   --disable-install-bins \
  3124.   --disable-install-srcs \
  3125.   --disable-install-libs \
  3126.   --disable-debug-libs \
  3127.   --enable-postproc \
  3128.   $ARCHOPTS \
  3129.   2>&1 | tee $OUTPUT/configure-${PRGNAM}_vpx.log
  3130.   #--disable-examples \ causes errors
  3131. make -j${NUMJOBS} 2>&1 | tee $OUTPUT/make-${PRGNAM}_vpx.log
  3132. # Install libvpx into a temp location so vlc can pickup the library
  3133. make install 2>&1 | tee -a $OUTPUT/make-${PRGNAM}_vpx.log
  3134. # The build system vor libvpx is not yet mature:
  3135. cp -a --parents vpx/*.h ${VLCDEPSDIR}/usr/include/
  3136. cp -a libvpx.a ${VLCDEPSDIR}/usr/lib${LIBDIRSUFFIX}
  3137. cp -a libvpx_g.a ${VLCDEPSDIR}/usr/lib${LIBDIRSUFFIX}
  3138. # Add DOCS to the vlcdeps to have it added to vlc package later:
  3139. mkdir -p $VLCDEPSDIR/doc/vpx/
  3140. cp AUTHORS CHANGELOG LICENSE README \
  3141.   $VLCDEPSDIR/doc/vpx/  || true
  3142. cd -
  3143. }
  3144.  
  3145.  
  3146. # -----------------------------------------------------------------------------
  3147. # Compile npapi-vlc
  3148. # -----------------------------------------------------------------------------
  3149. make_npapi()
  3150. {
  3151. echo -e "**\n**  npapi ...\n**"
  3152. cd $TMP/tmp-$PRGNAM/$PRGNAM2-${NPAPI}
  3153.  
  3154. [ ! -x configure ] && ./autogen.sh 2>&1 | tee autogen-${PRGNAM}_npapi.log
  3155.  
  3156. CFLAGS="-I$VLCDEPSDIR/usr/include $SLKCFLAGS" \
  3157. CXXFLAGS="-I$VLCDEPSDIR/usr/include $SLKCFLAGS" \
  3158. LDFLAGS="-L$VLCDEPSDIR/usr/lib${LIBDIRSUFFIX} $SLKLDFLAGS" \
  3159. PKG_CONFIG_PATH="$VLCDEPSDIR/usr/lib${LIBDIRSUFFIX}/pkgconfig" \
  3160. ./configure \
  3161.   --prefix=/usr \
  3162.   --libdir=/usr/lib${LIBDIRSUFFIX} \
  3163.   --with-mozilla-sdk-path=$VLCDEPSDIR/usr/xulrunner-sdk \
  3164.   --program-prefix= \
  3165.   --program-suffix= \
  3166.   --build=$ARCH-slackware-linux \
  3167.   2>&1 | tee $OUTPUT/configure-${PRGNAM}_npapi.log
  3168. make -j${NUMJOBS} 2>&1 | tee $OUTPUT/make-${PRGNAM}_npapi.log
  3169. cd -
  3170. }
  3171.  
  3172.  
  3173. # -----------------------------------------------------------------------------
  3174. # Compile libbluray
  3175. # -----------------------------------------------------------------------------
  3176. make_bluray()
  3177. {
  3178. echo -e "**\n**  bluray ...\n**"
  3179. cd $TMP/tmp-$PRGNAM/libbluray-${BLURAY}
  3180.  
  3181. [ ! -x configure ] && sh bootstrap
  3182.  
  3183. CFLAGS="-I$VLCDEPSDIR/usr/include $SLKCFLAGS" \
  3184. CXXFLAGS="-I$VLCDEPSDIR/usr/include $SLKCFLAGS" \
  3185. LDFLAGS="-L$VLCDEPSDIR/usr/lib${LIBDIRSUFFIX} $SLKLDFLAGS" \
  3186. PKG_CONFIG_PATH="$VLCDEPSDIR/usr/lib${LIBDIRSUFFIX}/pkgconfig" \
  3187. ./configure \
  3188.   --prefix=$VLCDEPSDIR/usr \
  3189.   --libdir=$VLCDEPSDIR/usr/lib${LIBDIRSUFFIX} \
  3190.   --disable-examples \
  3191.   --disable-debug \
  3192.   --disable-bdjava \
  3193.   --disable-shared \
  3194.   --enable-static \
  3195.   --disable-doxygen-doc \
  3196.   --with-dlopen-crypto-libs \
  3197.   --program-prefix= \
  3198.   --program-suffix= \
  3199.   --build=$ARCH-slackware-linux \
  3200.   2>&1 | tee $OUTPUT/configure-${PRGNAM}_bluray.log
  3201. make -j${NUMJOBS} 2>&1 | tee $OUTPUT/make-${PRGNAM}_bluray.log
  3202. # Install libbluray into a temp location so vlc can pickup the library
  3203. make install 2>&1 | tee -a $OUTPUT/make-${PRGNAM}_bluray.log
  3204. # Add DOCS to the vlcdeps to have it added to vlc package later:
  3205. mkdir -p $VLCDEPSDIR/doc/libbluray/
  3206. cp COPYING *.txt $VLCDEPSDIR/doc/libbluray/  || true
  3207. cd -
  3208. }
  3209.  
  3210.  
  3211. # -----------------------------------------------------------------------------
  3212. # VLC
  3213. # -----------------------------------------------------------------------------
  3214. make_vlc()
  3215. {
  3216. echo -e "**\n**  VLC ...\n**"
  3217. OLDDIR=$(pwd)
  3218. cd $TMP/tmp-$PRGNAM
  3219.  
  3220. # Determine the actual version of the program, and
  3221. # optionally the development branch it came from:
  3222.  
  3223. if [ ! -d {PRGNAM}-${SRCVER} ]; then
  3224.   NEWVER=$(ls -1 -d --indicator-style=none vlc-* 2>/dev/null)
  3225.   if [ -n "$NEWVER" ]; then
  3226.     echo "##"
  3227.     echo -n "## Changing vlc VERSION from '$VERSION' to "
  3228.     SRCVER=$(echo $NEWVER | cut -d- -f2-)
  3229.     VERSION=$(echo $SRCVER | tr '-' '.')
  3230.     echo "'$VERSION'"
  3231.     echo "##"
  3232.   else
  3233.     echo "Can not determine which version of VLC I should build!"
  3234.     exit 1
  3235.   fi
  3236. fi
  3237. if [ "$BRANCH" != "master" -a "x$BRANCH" != "x" ]; then
  3238.   VERSION=$(echo "${BRANCH}_${VERSION}" | tr - _)
  3239. fi
  3240.  
  3241. # If we build a static Qt4 gui, unset the QT-related environment variables,
  3242. # so that a pre-existing Qt4 will not be picked up and create errors:
  3243. if [ "$STATIC_QT4" = "YES" ]; then
  3244.   unset QTDIR
  3245.   unset QT4DIR
  3246.   NEWPATH="$VLCDEPSDIR/usr/bin"
  3247.   for elem in $(echo $PATH | cut -d: --output-delimiter=' ' -f1-) ; do
  3248.     if ! $(echo "$elem"| grep -q /qt) ; then
  3249.       NEWPATH="$NEWPATH:$elem"
  3250.     fi
  3251.   done
  3252.   export PATH="$NEWPATH"
  3253. fi
  3254.  
  3255. cd $TMP/tmp-$PRGNAM/${PRGNAM}-${SRCVER}
  3256. echo "" >$OUTPUT/patch-${PRGNAM}.log
  3257.  
  3258. # Configure a default Slackware TTF font:
  3259. cat $SRCDIR/vlc-1.2_deffont.patch | patch -p1 --verbose \
  3260.   2>&1 | tee -a $OUTPUT/patch-${PRGNAM}.log
  3261.  
  3262. # Fix SDL header location:
  3263. sed -i -e "s#SDL_image.h#SDL/&#" -e "s#SDL.h#SDL/&#" $(grep -lr "SDL*.h" .)
  3264.  
  3265. # Only enable DLL loader on ELF ix86 platforms:
  3266. if [ "$ARCH" == "i486" -o "$ARCH" == "i686" ]; then
  3267.   DO_LOADER="--enable-loader"
  3268. else
  3269.   DO_LOADER=""
  3270. fi
  3271.  
  3272. # Only include libs for patented codecs if we are allowing/needing it:
  3273. if [ "${USE_PATENTS}" == "YES" -a "$STATIC_FFMPEG" == "YES" ]; then
  3274.   DO_FFMPEG_LIBS_PAT="-lmp3lame -lfaac"
  3275. else
  3276.   DO_FFMPEG_LIBS_PAT=""
  3277. fi
  3278.  
  3279. ## FFMPEG changed it's CPU flag definitions but VLC did not yet follow:
  3280. #if grep -q FF_MM_MMX modules/stream_out/switcher.c ; then
  3281. #  cat $SRCDIR/vlc_ffmpeg_mm_api.patch | patch -p1 --verbose \
  3282. #    2>&1 | tee -a  $OUTPUT/patch-${PRGNAM}.log
  3283. #fi
  3284.  
  3285. if [ "$STATIC_FFMPEG" == "YES" ]; then
  3286.   # Fix runtime errors about missing symbols:
  3287.   ## vlc-cache-gen trips over at the end of the build, when we add LIBS
  3288.   ## to avoid missing symbols in the avcodec plugin at runtime:
  3289.   if ! grep -q " -ldrm" ${VLCDEPSDIR}/usr/lib${LIBDIRSUFFIX}/pkgconfig/libavcodec.pc ; then
  3290.     sed -i "/^Libs: /s/$/ -lva -lva-x11 -lX11 -lXext -lXfixes -ldrm/" \
  3291.       ${VLCDEPSDIR}/usr/lib${LIBDIRSUFFIX}/pkgconfig/libavcodec.pc
  3292.   fi
  3293. fi
  3294.  
  3295. # If we built a static projectM support library, let's use it properly:
  3296. if [ -d $VLCDEPSDIR/usr/share/vlc/projectM ]; then
  3297.   sed -i -e "s#share/projectM#share/vlc/projectM#" \
  3298.     $(grep -lr 'share/projectM' .)
  3299.   sed -i -e "s#usr/share/fonts/truetype/ttf-dejavu#usr/share/fonts/TTF#" \
  3300.     $(grep -lr 'usr/share/fonts/truetype/ttf-dejavu' .)
  3301. fi
  3302.  
  3303. ## VLC 0.9.6 but also 0.9.9 needs to regenerate libtool (known bug)
  3304. #if ls m4/lt*.m4 1>/dev/null 2>/dev/null ; then
  3305. #  rm -f m4/{lt,lib}*.m4; autoreconf -svif
  3306. #fi
  3307. #
  3308. ## vlc checks eventfd availability in glibc rather awkwardly. Our glibc 2.7
  3309. ## implements the function but does not export it in a header. Still vlc thinks
  3310. ## it can make use of it. NOTE: with glibc 2.8 it will work... have to wait...
  3311. #sed -i -e 's/^#ifdef HAVE_EVENTFD/#ifdef HAVE_SYS_EVENTFD_H/' src/misc/objects.c
  3312.  
  3313. sh bootstrap
  3314.  
  3315. PROJECTM_LIBS="-lprojectM $VLCDEPSDIR/usr/lib${LIBDIRSUFFIX}/libMilkdropPresetFactory.a $VLCDEPSDIR/usr/lib${LIBDIRSUFFIX}/libRenderer.a -lGLU -lGLEW -lGL" \
  3316. PROJECTM2_LIBS="-lprojectM $VLCDEPSDIR/usr/lib${LIBDIRSUFFIX}/libMilkdropPresetFactory.a $VLCDEPSDIR/usr/lib${LIBDIRSUFFIX}/libRenderer.a -lGLU -lGLEW -lGL" \
  3317. CPPFLAGS="-I$VLCDEPSDIR/usr/include -I$VLCDEPSDIR/usr/include/xulrunner" \
  3318. CFLAGS="-I$VLCDEPSDIR/usr/include -I$VLCDEPSDIR/usr/include/xulrunner $SLKCFLAGS" \
  3319. CXXFLAGS="-I$VLCDEPSDIR/usr/include -I$VLCDEPSDIR/usr/include/xulrunner $SLKCFLAGS" \
  3320. LDFLAGS="-Wl,-Bsymbolic -L$VLCDEPSDIR/usr/lib${LIBDIRSUFFIX} $SLKLDFLAGS" \
  3321. PKG_CONFIG_PATH="$VLCDEPSDIR/usr/lib${LIBDIRSUFFIX}/pkgconfig" \
  3322. PATH="$VLCDEPSDIR/usr/bin:$PATH" \
  3323. ./configure \
  3324.   --prefix=/usr \
  3325.   --libdir=/usr/lib${LIBDIRSUFFIX} \
  3326.   --sysconfdir=/etc \
  3327.   --mandir=/usr/man \
  3328.   --docdir=/usr/doc/vlc-$VERSION \
  3329.   --localstatedir=/var \
  3330.   --without-contrib \
  3331.   --disable-rpath \
  3332.   --disable-debug \
  3333.   --disable-gnomevfs \
  3334.   --disable-zvbi \
  3335.   --disable-switcher \
  3336.   --disable-oss \
  3337.   --disable-dependency-tracking \
  3338.   --enable-jack
  3339.   --enable-alsa \
  3340.   --enable-shared \
  3341.   --enable-optimize-memory=no \
  3342.   --enable-qt4 \
  3343.   --enable-ncurses \
  3344.   --enable-lua \
  3345.   --enable-pvr \
  3346.   --enable-dc1394 \
  3347.   --enable-dv \
  3348.   --enable-dvbpsi \
  3349.   --enable-dvdnav \
  3350.   --enable-vcdx \
  3351.   --enable-libcddb \
  3352.   --enable-projectm \
  3353.   --enable-svg \
  3354.   --enable-telx \
  3355.   --enable-libass \
  3356.   --enable-caca \
  3357.   --enable-aa \
  3358.   --enable-upnp \
  3359.   --enable-flac \
  3360.   --enable-shout \
  3361.   --enable-schroedinger \
  3362.   --enable-live555 \
  3363.   --enable-real \
  3364.   --enable-realrtsp \
  3365.   --enable-speex \
  3366.   --enable-x264 \
  3367.   --enable-a52 \
  3368.   --with-a52-tree=$TMP/tmp-$PRGNAM/a52dec-$A52 \
  3369.   --enable-faad \
  3370.   --with-faad-tree=$TMP/tmp-$PRGNAM/faad2-$FAAD2 \
  3371.   --enable-twolame \
  3372.   --enable-ogg \
  3373.   --enable-vorbis \
  3374.   --enable-theora \
  3375.   --enable-avcodec \
  3376.   --enable-avformat \
  3377.   --enable-swscale \
  3378.   ${DO_LOADER} \
  3379.   --enable-run-as-root \
  3380.   --program-prefix= \
  3381.   --program-suffix= \
  3382.   --build=$ARCH-slackware-linux \
  3383.   2>&1 | tee $OUTPUT/configure-${PRGNAM}.log
  3384.  
  3385.   # Enabled by default:
  3386.   #--enable-dca \
  3387.   #--with-dca-tree=$TMP/tmp-$PRGNAM/libdca-$DCA \
  3388.  
  3389.   # Libdvdnav is now the default (which uses libdvdread in turn)
  3390.   #--enable-dvdread \
  3391.   #--with-dvdread-tree=$TMP/tmp-$PRGNAM/libdvdread-$DVDREAD \
  3392.   #--enable-goom \
  3393.   #--with-goom-tree=$TMP/tmp-$PRGNAM/goom$GOOM \
  3394.   #--enable-ggi \
  3395.  
  3396.   # Sometimes skins support breaks and we'll have to disable it:
  3397.   #--disable-skins2 \
  3398.  
  3399.   # Got errors about missing sdt.h in ./modules/access/dvb/access.c
  3400.   #--with-dvbpsi-tree=$TMP/tmp-$PRGNAM/libdvbpsi5-${DVBPSI} \
  3401.  
  3402.   # Leave this out so that linking the static x264.a into a shared
  3403.   # library works on x86_64:
  3404.   #--with-x264-tree=$TMP/tmp-$PRGNAM/x264-snapshot-$X264 \
  3405.  
  3406.   # Without these, we get also rid of "unknown symbols" runtime
  3407.   #--with-dv-raw1394=$TMP/tmp-$PRGNAM/libraw1394-${RAW1394} \
  3408.   #--with-dv-avc1394=$TMP/tmp-$PRGNAM/libavc1394-${AVC1394} \
  3409.  
  3410.   # Deprecated:
  3411.   #--enable-ffmpeg \
  3412.   #--with-ffmpeg-tree=$TMP/tmp-$PRGNAM/ffmpeg-${FFMPEG} \
  3413.   #--enable-daap \
  3414.   #--disable-musicbrainz \
  3415.   #--disable-arts \
  3416.   #--enable-esd \
  3417.   #--with-speex-tree=$TMP/tmp-$PRGNAM/speex-$SPEEX \
  3418.   #--disable-galaktos \
  3419.   #--with-twolame-tree=$TMP/tmp-$PRGNAM/twolame-$TWOLAME \
  3420.   #--with-dv-raw1394-tree=$TMP/tmp-$PRGNAM/libraw1394-${RAW1394} \
  3421.   #--with-dv-avc1394-tree=$TMP/tmp-$PRGNAM/libavc1394-${AVC1394} \
  3422.   #--disable-testsuite \
  3423.   #--enable-release \
  3424.   #--enable-libcdio \
  3425.   #--enable-cddax \
  3426.   #--disable-snapshot \
  3427.   #--with-dvdnav-config-path=$VLCDEPSDIR/usr/bin \
  3428.   #--enable-svgalib \
  3429.   #--enable-v4l \
  3430.   #--enable-id3tag \
  3431.  
  3432.  
  3433.   # Now finds the required libraries without manual tweaking:
  3434.   #AVCODEC_LIBS="-lavcodec -lbz2 -lz ${DO_FFMPEG_LIBS_PAT} -ldl -ltheora -lvorbisenc -lswscale -lavutil -lvorbis -lm -logg" \
  3435.   #AVCODEC_CFLAGS="" \
  3436.  
  3437. # Now, we are ready for the compile:
  3438. make -j${NUMJOBS} 2>&1 | tee $OUTPUT/make-${PRGNAM}.log
  3439.  
  3440. # If we are compiling the browser plugin, then we need to install to $VLCDEPSDIR
  3441. if [ "$MOZPLUGIN" == "YES" ]; then
  3442.   echo -e "\n**\n**\n" >> $OUTPUT/make-${PRGNAM}.log
  3443.   make install DESTDIR=$VLCDEPSDIR 2>&1 | tee -a $OUTPUT/make-${PRGNAM}.log
  3444.   # And remove the .la files because they confuse the plugin compilation.
  3445.   rm $VLCDEPSDIR/usr/lib${LIBDIRSUFFIX}/libvlc*.la
  3446. fi
  3447.  
  3448. cd $OLDDIR
  3449. }
  3450.  
  3451. # -----------------------------------------------------------------------------
  3452. # These routines do all the work of setting up the package contents
  3453. # and creating the actual Slackware packages in $OUTPUT
  3454. # -----------------------------------------------------------------------------
  3455.  
  3456. build_npapipkg()
  3457. {
  3458. echo -e "**\n**  creating $PRGNAM2 package ...\n**"
  3459. cd $TMP/tmp-$PRGNAM/$PRGNAM2-${NPAPI}
  3460. # Install the mozilla plugin:
  3461. mkdir -p $PKG2/usr/lib${LIBDIRSUFFIX}/mozilla/plugins/
  3462. make DESTDIR=$PKG2 install-strip
  3463.  
  3464. # Add package documentation:
  3465. mkdir -p $PKG2/usr/doc/$PRGNAM2-$NPAPI
  3466. cp -a AUTHORS COPYING ChangeLog NEWS README $PKG2/usr/doc/$PRGNAM2-$NPAPI || true
  3467. find $PKG2/usr/doc -type f -exec chmod 644 {} \;
  3468. chown -R root:root $PKG2/usr/doc/$PRGNAM2-$NPAPI/*
  3469.  
  3470. mkdir -p $PKG2/install
  3471. cat $SRCDIR/slack-desc.$PRGNAM2 > $PKG2/install/slack-desc
  3472. cat $SRCDIR/slack-required.$PRGNAM2 > $PKG2/install/slack-required
  3473.  
  3474. cd $PKG2
  3475. makepkg --linkadd y --chown n $OUTPUT/${PRGNAM2}-${NPAPI}-${ARCH}-${BUILD}${TAG}.${PKGTYPE} 2>&1 | tee $OUTPUT/makepkg-${PRGNAM}_${PRGNAM2}.log
  3476. cd $OUTPUT
  3477. md5sum ${PRGNAM2}-${NPAPI}-${ARCH}-${BUILD}${TAG}.${PKGTYPE} > ${PRGNAM2}-${NPAPI}-${ARCH}-${BUILD}${TAG}.${PKGTYPE}.md5
  3478. cd -
  3479. cat $PKG2/install/slack-desc | grep "^${PRGNAM2}" > $OUTPUT/${PRGNAM2}-${NPAPI}-${ARCH}-${BUILD}${TAG}.txt
  3480. cat $PKG2/install/slack-required > $OUTPUT/${PRGNAM2}-${NPAPI}-${ARCH}-${BUILD}${TAG}.dep
  3481.  
  3482. }
  3483.  
  3484. build_vlcpkg()
  3485. {
  3486. echo -e "**\n**  building the $PRGNAM package ...\n**"
  3487. #
  3488. # Install all the needed stuff to the package dir
  3489. #
  3490. cd $TMP/tmp-$PRGNAM/${PRGNAM}-${SRCVER}
  3491.  
  3492. make DESTDIR=$PKG install 2>&1 |tee $OUTPUT/install-${PRGNAM}.log
  3493.  
  3494. # We don't want the mozilla plugin here:
  3495. [ -d $PKG/usr/lib${LIBDIRSUFFIX}/mozilla ] && rm -rf $PKG/usr/lib${LIBDIRSUFFIX}/mozilla
  3496.  
  3497. # Copy the projectM presets and other requirements into the package if we
  3498. # are adding support for it:
  3499. if [ -d $VLCDEPSDIR/usr/share/vlc/projectM ]; then
  3500.   cp -a $VLCDEPSDIR/usr/share/vlc/projectM $PKG/usr/share/vlc/
  3501.   # Add missing directory:
  3502.   mkdir $PKG/usr/share/vlc/projectM/textures
  3503.   # Replace fonts with symlinks to preserve space:
  3504.   rm $PKG/usr/share/vlc/projectM/fonts/*
  3505.   ln -sf /usr/share/fonts/TTF/DejaVuSans.ttf $PKG/usr/share/vlc/projectM/fonts/Vera.ttf
  3506.   ln -sf /usr/share/fonts/TTF/DejaVuSansMono.ttf $PKG/usr/share/vlc/projectM/fonts/VeraMono.ttf
  3507. fi
  3508.  
  3509. # Copy libggi configuration files into the package if we added support for it:
  3510. if [ -f $VLCDEPSDIR/etc/ggi/libggi.conf ]; then
  3511.   mkdir -p $PKG/usr/share/vlc/etc/
  3512.   cp -a $VLCDEPSDIR/usr/lib${LIBDIRSUFFIX}/ggi $PKG/usr/share/vlc/
  3513.   cp -a $VLCDEPSDIR/etc/ggi $PKG/usr/share/vlc/etc/
  3514.   sed -i -e "s#$VLCDEPSDIR/usr/lib${LIBDIRSUFFIX}/#/usr/share/vlc/#" \
  3515.     $PKG/usr/share/vlc/etc/ggi/*.conf
  3516. fi
  3517.  
  3518. # Copy the vaapi drivers into the package.
  3519. if [ -d $VLCDEPSDIR/usr/lib${LIBDIRSUFFIX}/vlc/va ]; then
  3520.   cp -a $VLCDEPSDIR/usr/lib${LIBDIRSUFFIX}/vlc/va $PKG/usr/lib${LIBDIRSUFFIX}/vlc/
  3521. fi
  3522.  
  3523. # Add this to the doinst.sh:
  3524. mkdir -p $PKG/install
  3525. cat <<EOINS > $PKG/install/doinst.sh
  3526. # Update the desktop database:
  3527. if [ -x usr/bin/update-desktop-database ]; then
  3528.   chroot . /usr/bin/update-desktop-database usr/share/applications > /dev/null
  3529. 2>&1
  3530. fi
  3531.  
  3532. # Update hicolor theme cache:
  3533. if [ -d usr/share/icons/hicolor ]; then
  3534.   if [ -x /usr/bin/gtk-update-icon-cache ]; then
  3535.     chroot . /usr/bin/gtk-update-icon-cache -f -t usr/share/icons/hicolor 1> /dev/null 2> /dev/null
  3536.   fi
  3537. fi
  3538.  
  3539. # Update the mime database:
  3540. if [ -x usr/bin/update-mime-database ]; then
  3541.   chroot . /usr/bin/update-mime-database usr/share/mime >/dev/null 2>&1
  3542. fi
  3543.  
  3544. # Remove old cache data and regenerate the file:
  3545. chroot . <<EOCR 2>/dev/null
  3546. cd /usr/lib${LIBDIRSUFFIX}/vlc
  3547. find . -name "plugins*.dat" -exec rm -f {} \;
  3548. echo "Generating VLC plugins cache data..."
  3549. DISPLAY="" ./vlc-cache-gen -f .
  3550. EOCR
  3551.  
  3552. EOINS
  3553.  
  3554. ## Add the icons to be used in menu entries:
  3555. #mkdir -p $PKG/usr/share/pixmaps
  3556. #convert share/vlc512x512.png -resize 64x64 $PKG/usr/share/pixmaps/vlc.png
  3557. #for res in 16 32 48 64 128; do
  3558. #  mkdir -p  $PKG/usr/share/icons/hicolor/${res}x${res}/apps
  3559. #  convert share/vlc512x512.png -resize ${res}x${res} \
  3560. #    $PKG/usr/share/icons/hicolor/${res}x${res}/apps/vlc.png
  3561. #done
  3562.  
  3563. # Add the man page:
  3564. mkdir -p $PKG/usr/man/man1
  3565. gzip -9c doc/vlc.1 > $PKG/usr/man/man1/vlc.1.gz
  3566.  
  3567. # Add a vlc log syntax definition file for vim:
  3568. mkdir -p $PKG/$(cd /usr/share/vim/vim*/syntax ; pwd)
  3569. cp extras/analyser/vlc.vim $PKG/$(cd /usr/share/vim/vim*/syntax ; pwd)/
  3570.  
  3571. # Remove traces of our temporary install location from libtool files:
  3572. find $PKG/usr/lib${LIBDIRSUFFIX} -name "*.la" -o -name "*.pc" \
  3573.   | xargs sed -i -e "s#$VLCDEPSDIR##g"
  3574.  
  3575. # Add package documentation:
  3576. mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
  3577. mv $PKG/usr/share/doc/vlc/* $PKG/usr/doc/$PRGNAM-$VERSION || true
  3578. rm -rf $PKG/usr/share/doc
  3579. cp -a $DOCS $PKG/usr/doc/$PRGNAM-$VERSION || true
  3580. # Add all the supporting packages' documentation too:
  3581. cp -a $VLCDEPSDIR/doc/* $PKG/usr/doc/$PRGNAM-$VERSION || true
  3582. # Add the SlackBuild as well as all patches we used to create the package:
  3583. cat $SRCDIR/$(basename $0) > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild
  3584. ( cd $SRCDIR
  3585.   tar -zcf $PKG/usr/doc/$PRGNAM-$VERSION/${PRGNAM}_slackware_patches.tar.gz \
  3586.   *.diff *.patch
  3587. )
  3588. find $PKG/usr/doc -type f -exec chmod 644 {} \;
  3589. chown -R root:root $PKG/usr/doc/$PRGNAM-$VERSION/*
  3590.  
  3591. # Compress the man page(s):
  3592. if [ -d $PKG/usr/man ]; then
  3593.   find $PKG/usr/man -type f -name "*.?" -exec gzip -9f {} \;
  3594.   for i in $(find $PKG/usr/man -type l -name "*.?") ; do ln -s $( readlink $i ).gz $i.gz ; rm $i ; done
  3595. fi
  3596.  
  3597. # Strip binaries:
  3598. find $PKG -print0 | xargs -0 file | grep -e "executable" -e "shared object" \
  3599.   | grep ELF | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null
  3600.  
  3601. # Add a package description:
  3602. mkdir -p $PKG/install
  3603. cat $SRCDIR/slack-desc > $PKG/install/slack-desc
  3604. if [ -f $SRCDIR/doinst.sh ]; then
  3605.   cat $SRCDIR/doinst.sh >> $PKG/install/doinst.sh
  3606. fi
  3607. if [ -f $SRCDIR/slack-required ]; then
  3608.   cat $SRCDIR/slack-required > $PKG/install/slack-required
  3609. fi
  3610.  
  3611. # Build the package:
  3612. cd $PKG
  3613. makepkg --linkadd y --chown n $OUTPUT/${PRGNAM}-$(echo $VERSION |tr '-' '.')-${ARCH}-${BUILD}${TAG}.${PKGTYPE} 2>&1 | tee $OUTPUT/makepkg-${PRGNAM}.log
  3614. cd $OUTPUT
  3615. md5sum ${PRGNAM}-$(echo $VERSION |tr '-' '.')-${ARCH}-${BUILD}${TAG}.${PKGTYPE} > ${PRGNAM}-$(echo $VERSION |tr '-' '.')-${ARCH}-${BUILD}${TAG}.${PKGTYPE}.md5
  3616. cd -
  3617. cat $PKG/install/slack-desc | grep "^${PRGNAM}" > $OUTPUT/${PRGNAM}-$(echo $VERSION |tr '-' '.')-${ARCH}-${BUILD}${TAG}.txt
  3618. if [ -f $PKG/install/slack-required ]; then
  3619.   cat $PKG/install/slack-required > $OUTPUT/${PRGNAM}-$(echo $VERSION |tr '-' '.')-${ARCH}-${BUILD}${TAG}.dep
  3620. fi
  3621.  
  3622. }
  3623.  
  3624. # -----------------------------------------------------------------------------
  3625. # OK - we wrapped the separate components into convenience functions
  3626. # - now call them one by one:
  3627. # -----------------------------------------------------------------------------
  3628.  
  3629. if echo "$*" | grep -qw -- --unwrapvlcdeps ; then
  3630.   # We use a tarball with precompiled binaries instead of compiling all
  3631.   # dependencies at this moment (saves time when all we change is VLC code):
  3632.   if [ "${USE_PATENTS}" == "YES" ]; then
  3633.     DEPSFILE="$SRCDIR/$PRGNAM-vlcdeps_restricted-$ARCH.tar.bz2"
  3634.   else
  3635.     DEPSFILE="$SRCDIR/$PRGNAM-vlcdeps_unrestricted-$ARCH.tar.bz2"
  3636.   fi
  3637.   [ ! -f $DEPSFILE ] && DEPSFILE="$SRCDIR/$PRGNAM-vlcdeps-$ARCH.tar.bz2"
  3638.   cd $TMP/tmp-$PRGNAM
  3639.   echo "Extracting tarball with pre-compiled binary library code..."
  3640.   tar -xvf $DEPSFILE
  3641.   find . -name "*.la" -o -name "*.pc" | xargs sed -i -e "s#/vlcdepsdir#$TMP/tmp-$PRGNAM#g"
  3642.   cd -
  3643.  
  3644. else
  3645.   #if [ "xy" == "x" ]; then
  3646.  
  3647.   # Are we building the mozilla plugin?
  3648.   if [ "$MOZPLUGIN" = "YES" ]; then
  3649.     make_xul
  3650.   fi
  3651.  
  3652.   # qt4 is used for the vlc gui:
  3653.   if [ "$STATIC_QT4" = "YES" ]; then
  3654.     make_qt4
  3655.   fi
  3656.  
  3657.   # If anyone can fix the 'unresolved symbols' in several vlc plugins when
  3658.   # libva is compiled before ffmpeg, let me know!
  3659.   make_libva
  3660.  
  3661.   # CD/VCD image support:
  3662.   # Circular dependencies need these loops:
  3663.   make_cdio --disable-vcd-info
  3664.   make_vcd
  3665.   make_cdio
  3666.  
  3667.   # vlc wants this, but cdio chokes with "cannot find -lcddb" so build it after
  3668.   # cdio (which only used cddb for the cd-info binary which we don't use):
  3669.   make_cddb
  3670.  
  3671.   # DVD support:
  3672.   # Only use patented code if we are allowing it:
  3673.   if [ "${USE_PATENTS}" == "YES" ]; then
  3674.     make_dvdcss
  3675.   fi
  3676.   make_dvdread
  3677.   make_dvdnav
  3678.  
  3679.   if [ "$STATIC_FFMPEG" == "YES" ]; then
  3680.     # Needed before ffmpeg:
  3681.     make_vpx
  3682.     make_theora
  3683.     make_amr
  3684.     make_amrwbenc
  3685.     make_rtmp
  3686.     make_gsm
  3687.     # Only use patented code if we are allowing it:
  3688.     if [ "${USE_PATENTS}" == "YES" ]; then
  3689.       make_lame
  3690.       make_faac
  3691.       make_aacenc
  3692.     fi
  3693.  
  3694.     # ffmpeg uses the above static libraries:
  3695.     make_ffmpeg
  3696.   fi
  3697.  
  3698.   # Additional libraries that vlc will use:
  3699.   make_faad2
  3700.   make_a52
  3701.   make_dca
  3702.   make_ebml
  3703.   make_matroska
  3704.   make_x264
  3705.   make_libmpeg2
  3706.   make_mpcdec
  3707.   make_twolame
  3708.   #make_daap
  3709.   make_upnp
  3710.   make_orc
  3711.   make_schroedinger
  3712.   make_live555
  3713.   make_fribidi
  3714.   make_ass
  3715.   make_fluid
  3716.   make_1394
  3717.   make_kate
  3718.   make_tiger
  3719.   make_lua
  3720.   make_v4l
  3721.   make_bluray
  3722.  
  3723.   # Visualisations:
  3724.   make_goom
  3725.   make_ggi
  3726.   make_projectm
  3727.  
  3728.   # Digital video:
  3729.   make_dv
  3730.   make_dvbpsi
  3731.  
  3732.   # Speex before shout and vlc:
  3733.   make_speex
  3734.   make_shout
  3735.  
  3736.   #fi # End  ( "xy" == "x" )
  3737. fi
  3738.  
  3739. if echo "$*" | grep -qw -- --wrapvlcdeps ; then
  3740.   # Wrap the vlcdeps tree with all pre-compiled dependencies into a tarball:
  3741.   cd $TMP/tmp-$PRGNAM
  3742.   find . -name "*.la" -o -name "*.pc" | xargs sed -i -e "s#$TMP/tmp-$PRGNAM#/vlcdepsdir#g"
  3743.   tar -jcf $OUTPUT/$PRGNAM-vlcdeps-$ARCH.tar.bz2 \
  3744.     vlcdeps \
  3745.     a52dec-$A52 \
  3746.     faad2-$FAAD2
  3747.  
  3748.   echo "Created vlcdeps binary tarball in '$OUTPUT/$PRGNAM-vlcdeps-$ARCH.tar.bz2'..."
  3749.   cd -
  3750. else
  3751.   # Compile VLC using all the precompiled static libs in $VLCDEPSDIR :
  3752.   make_vlc
  3753.  
  3754.   # Wrap VLC into a Slackware package:
  3755.   build_vlcpkg "$*"
  3756.  
  3757.   # Should we also compile the mozilla plugin (npapi-vlc)?
  3758.   if [ "$MOZPLUGIN" == "YES" ]; then
  3759.     ## Unfortunately we need to spam the root partition with the vlc package:
  3760.     #upgradepkg --install-new $OUTPUT/${PRGNAM}-$(echo $VERSION |tr '-' '.')-${ARCH}-${BUILD}${TAG}.${PKGTYPE}
  3761.     make_npapi
  3762.     build_npapipkg
  3763.   fi
  3764. fi
Advertisement
Add Comment
Please, Sign In to add comment