vlc.SlackBuild 5.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178
  1. #!/bin/bash
  2. # Slackware build script for VLC media player
  3. # Written by Andrea De Pasquale <andrea@de-pasquale.name>
  4. # Based on Eric Hameleers' Slackware build script,
  5. # modified to build VLC only, shared libraries needed.
  6. # Copyright (c) 2007,2008,2009,2010,2011 Eric Hameleers, Eindhoven, Netherlands
  7. # Copyright (c) 2014-2022 Christoph Willing, Brisbane, Australia
  8. # Copyright (c) 2022 Bill Kirkpatrick, Bay City, Texas, USA
  9. # All rights reserved.
  10. #
  11. # Redistribution and use of this script, with or without modification is
  12. # permitted, provided that the following conditions are met:
  13. # 1. Redistribution of this script must retain the above copyright notice,
  14. # this list of conditions and the following disclaimer.
  15. # copies.
  16. #
  17. # THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESSED OR IMPLIED
  18. # WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
  19. # MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
  20. # IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
  21. # INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
  22. # BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
  23. # LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
  24. # CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
  25. # LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
  26. # WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
  27. # POSSIBILITY OF SUCH DAMAGE.
  28. # -----------------------------------------------------------------------------
  29. # 20220215 bkw: Modified by SlackBuilds.org:
  30. # - stop the build if libebml is installed, since it will fail.
  31. cd $(dirname $0) ; CWD=$(pwd)
  32. PRGNAM=vlc
  33. VERSION=${VERSION:-3.0.17.3}
  34. BUILD=${BUILD:-3}
  35. TAG=${TAG:-_SBo}
  36. PKGTYPE=${PKGTYPE:-tgz}
  37. if [ -z "$ARCH" ]; then
  38. case "$( uname -m )" in
  39. i?86) ARCH=i586 ;;
  40. arm*) ARCH=arm ;;
  41. *) ARCH=$( uname -m ) ;;
  42. esac
  43. fi
  44. # If the variable PRINT_PACKAGE_NAME is set, then this script will report what
  45. # the name of the created package would be, and then exit. This information
  46. # could be useful to other scripts.
  47. if [ ! -z "${PRINT_PACKAGE_NAME}" ]; then
  48. echo "$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE"
  49. exit 0
  50. fi
  51. TMP=${TMP:-/tmp/SBo}
  52. PKG=$TMP/package-$PRGNAM
  53. OUTPUT=${OUTPUT:-/tmp}
  54. if [ "$ARCH" = "i586" ]; then
  55. SLKCFLAGS="-O2 -march=i586 -mtune=i686"
  56. LIBDIRSUFFIX=""
  57. elif [ "$ARCH" = "x86_64" ]; then
  58. SLKCFLAGS="-O2 -fPIC"
  59. LIBDIRSUFFIX="64"
  60. else
  61. SLKCFLAGS="-O2"
  62. LIBDIRSUFFIX=""
  63. fi
  64. SLKLDFLAGS="-lrt"
  65. DOCS="ABOUT-NLS AUTHORS COPYING INSTALL NEWS README THANKS"
  66. # 20220215 bkw: this compiles for a long time, then fails, if libebml is
  67. # installed. Better to fail immediately and let the user know how to fix it.
  68. if [ "${FORCE:-no}" != "yes" ] && pkg-config --exists libebml; then
  69. cat <<EOF
  70. **********************************************************
  71. * Conflicting package found: libebml *
  72. **********************************************************
  73. * This build is known to fail when libebml is installed. *
  74. * Run "removepkg libebml", then re-run this script. *
  75. * You can reinstall libebml after vlc finishes building. *
  76. **********************************************************
  77. If you want to try building vlc anyway, export FORCE=yes
  78. in the environment.
  79. EOF
  80. exit 1
  81. fi
  82. set -e
  83. rm -rf $PKG
  84. mkdir -p $TMP $PKG $OUTPUT
  85. cd $TMP
  86. rm -rf $PRGNAM-$VERSION
  87. tar xvf $CWD/$PRGNAM-$VERSION.tar.xz
  88. cd $PRGNAM-$VERSION
  89. sed -i '/DEPRECATED/s:^://:' modules/text_renderer/freetype/text_layout.c
  90. patch -p0 < $CWD/patch-dvdread-503.diff
  91. patch -p0 < $CWD/patch-dvdnav-503.diff
  92. patch -p0 < $CWD/patch-projectM-fontpath.diff
  93. patch -p0 < $CWD/patch_vlc_cache_gen.diff
  94. # Don't enable wayland by default
  95. wayland="--disable-wayland" ; [ "${WAYLAND:-no}" != "no" ] && wayland="--enable-wayland"
  96. # Enable vlc to be run as root
  97. runasroot=""; [ "${RUNASROOT:-no}" != "no" ] && runasroot="--enable-run-as-root"
  98. # Give the possibility to explicitly disable aom support
  99. aom=""; [ "${AOM:-yes}" = "no" ] && aom="--disable-aom"
  100. autoreconf -fiv
  101. chown -R root:root .
  102. find -L . \
  103. \( -perm 777 -o -perm 775 -o -perm 750 -o -perm 711 -o -perm 555 -o -perm 511 \) \
  104. -exec chmod 755 {} \+ -o \
  105. \( -perm 666 -o -perm 664 -o -perm 600 -o -perm 444 -o -perm 440 -o -perm 400 \) \
  106. -exec chmod 644 {} \+
  107. CFLAGS="$SLKCFLAGS" \
  108. CXXFLAGS="$SLKCFLAGS" \
  109. LDFLAGS="$SLKLDFLAGS" \
  110. ./configure \
  111. --prefix=/usr \
  112. --libdir=/usr/lib${LIBDIRSUFFIX} \
  113. --sysconfdir=/etc \
  114. --mandir=/usr/man \
  115. --docdir=/usr/doc/vlc-$VERSION \
  116. --localstatedir=/var \
  117. --build=$ARCH-slackware-linux \
  118. --enable-qt=5 \
  119. --enable-merge-ffmpeg \
  120. --disable-upnp \
  121. $wayland \
  122. $runasroot \
  123. $aom \
  124. make
  125. make DESTDIR=$PKG install
  126. mkdir -p $PKG/usr/man/man1
  127. gzip -9c doc/vlc.1 > $PKG/usr/man/man1/vlc.1.gz
  128. install -D -m0644 extras/analyser/vlc.vim $PKG/usr/share/vim/vimfiles/syntax/vlc.vim
  129. mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
  130. cp -a $DOCS $PKG/usr/doc/$PRGNAM-$VERSION
  131. cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild
  132. find $PKG/usr/doc -type f -exec chmod 644 {} \;
  133. chown -R root:root $PKG/usr/doc/$PRGNAM-$VERSION/*
  134. find $PKG/usr/man -type f -name "*.?" -exec gzip -9f {} \;
  135. for i in $(find $PKG/usr/man -type l -name "*.?") ; do ln -s $( readlink $i ).gz $i.gz ; rm $i ; done
  136. find $PKG -print0 | xargs -0 file | grep -e "executable" -e "shared object" \
  137. | grep ELF | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null
  138. rm -f $PKG/usr/lib*/*.la
  139. mkdir -p $PKG/install
  140. cat $CWD/slack-desc > $PKG/install/slack-desc
  141. ###sbolint off
  142. sed -e s/%LIBDIRSUFFIX%/$LIBDIRSUFFIX/g $CWD/doinst.sh.in > $PKG/install/doinst.sh
  143. ###sbolint on
  144. cd $PKG
  145. /sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE