Advertisement
timcowchip

ffmpeg-compat.Slackbuild

Oct 8th, 2013
155
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.02 KB | None | 0 0
  1. #!/bin/sh
  2.  
  3. # Slackware build script for ffmpeg-compat
  4.  
  5. # Written by core (eroc@linuxmail.org)
  6. # Modified by Robby Workman <rworkman@slackbuilds.org>
  7. # Modified by Heinz Wiesinger <pprkut@liwjatan.org>
  8. # Modified by Chris Farrell <timcowchip@gmail.com>
  9.  
  10. PRGNAM=ffmpeg-compat
  11. VERSION=${VERSION:-0.10.8}
  12. BUILD=${BUILD:-2}
  13. TAG=${TAG:-_SBo}
  14.  
  15. if [ -z "$ARCH" ]; then
  16. case "$( uname -m )" in
  17. i?86) ARCH=i486 ;;
  18. arm*) ARCH=arm ;;
  19. *) ARCH=$( uname -m ) ;;
  20. esac
  21. fi
  22.  
  23. CWD=$(pwd)
  24. TMP=${TMP:-/tmp/SBo}
  25. PKG=$TMP/package-$PRGNAM
  26. OUTPUT=${OUTPUT:-/tmp}
  27.  
  28. if [ "$ARCH" = "i486" ]; then
  29. SLKCFLAGS="-O2 -march=i486 -mtune=i686"
  30. LIBDIRSUFFIX=""
  31. elif [ "$ARCH" = "i686" ]; then
  32. SLKCFLAGS="-O2 -march=i686 -mtune=i686"
  33. LIBDIRSUFFIX=""
  34. elif [ "$ARCH" = "x86_64" ]; then
  35. SLKCFLAGS="-O2 -fPIC"
  36. LIBDIRSUFFIX="64"
  37. else
  38. SLKCFLAGS="-O2"
  39. LIBDIRSUFFIX=""
  40. fi
  41.  
  42. # environment sanity checks
  43. TEXI2HTML=$(which texi2html 2>/dev/null)
  44.  
  45. if [ "$TEXI2HTML" = "" ]; then
  46. echo "Could not find texi2html! Please make sure to have tetex or texlive installed"
  47. echo "and that texi2html is in PATH."
  48. exit 1
  49. fi
  50.  
  51. # --enable-runtime-cpu is meant for libswscale only and
  52. # has no influence on the other parts of ffmpeg so there's
  53. # not really a point in bothering
  54. PKGARCH=$(uname -m)_custom
  55.  
  56. # Configure ffmpeg features not autodetected by default
  57. # Unfortunately ffmpeg's configure doesn't support --enable-feature=yes
  58. # syntax, so we have to do it the complicated way :/
  59.  
  60. libcelt="" ; [ "${CELT:-no}" != "no" ] && libcelt="--enable-libcelt"
  61. libdc1394="" ; [ "${DC1394:-no}" != "no" ] && libdc1394="--enable-libdc1394"
  62. libfrei0r="" ; [ "${FREI0R:-no}" != "no" ] && libfrei0r="--enable-frei0r"
  63. libgsm="" ; [ "${GSM:-no}" != "no" ] && libgsm="--enable-libgsm"
  64. librtmp="" ; [ "${RTMP:-no}" != "no" ] && librtmp="--enable-librtmp"
  65. dirac_fast="" ; [ "${SCHROEDINGER:-no}" != "no" ] && dirac_fast="--enable-libschroedinger"
  66. libspeex="" ; [ "${SPEEX:-no}" != "no" ] && libspeex="--enable-libspeex"
  67. libvpx="" ; [ "${VPX:-no}" != "no" ] && libvpx="--enable-libvpx"
  68. libxvid="" ; [ "${XVID:-no}" != "no" ] && libxvid="--enable-libxvid"
  69. libbluray="" ; [ "${BLURAY:-no}" != "no" ] && libbluray="--enable-libbluray"
  70. libass="" ; [ "${ASS:-no}" != "no" ] && libass="--enable-libass"
  71. libopenal="" ; [ "${OPENAL:-no}" != "no" ] && libopenal="--enable-openal"
  72.  
  73. opencore_amr="" ; [ "${OPENCORE:-no}" != "no" ] && \
  74. opencore_amr="--enable-libopencore-amrnb --enable-libopencore-amrwb"
  75. libfaac="" ; [ "${FAAC:-no}" != "no" ] && \
  76. { libfaac="--enable-libfaac" ; non_free="--enable-nonfree" ; }
  77. ssl="" ; [ "${OPENSSL:-no}" != "no" ] && \
  78. { ssl="--enable-openssl" ; non_free="--enable-nonfree" ; }
  79. openjpeg="" ; [ "${JP2:-no}" != "no" ] && \
  80. { openjpeg="--enable-libopenjpeg" ; \
  81. SLKCFLAGS="$SLKCFLAGS -I/usr/include/openjpeg-1.5" ; }
  82.  
  83. mp3lame="--enable-libmp3lame" ; [ "${LAME:-yes}" != "yes" ] && mp3lame=""
  84. libx264="--enable-libx264" ; [ "${X264:-yes}" != "yes" ] && libx264=""
  85.  
  86. # opencv support is currently broken: http://code.opencv.org/issues/1925
  87. #libopencv="" ; [ "${OPENCV:-no}" != "no" ] && libopencv="--enable-libopencv"
  88.  
  89. set -e
  90.  
  91. rm -rf $PKG
  92. mkdir -p $TMP $PKG $OUTPUT
  93. cd $TMP
  94. rm -rf ffmpeg-$VERSION
  95. tar xvf $CWD/ffmpeg-$VERSION.tar.bz2
  96. cd ffmpeg-$VERSION
  97. chown -R root:root .
  98. chmod -R u+w,go+r-w,a-s .
  99.  
  100. CFLAGS="$SLKCFLAGS" \
  101. CXXFLAGS="$SLKCFLAGS" \
  102. ./configure \
  103. --prefix=/usr \
  104. --incdir=/usr/include/$PRGNAM \
  105. --libdir=/usr/lib${LIBDIRSUFFIX}/$PRGNAM \
  106. --shlibdir=/usr/lib${LIBDIRSUFFIX}/$PRGNAM \
  107. --mandir=/usr/man \
  108. --disable-debug \
  109. --enable-shared \
  110. --disable-static \
  111. --enable-pthreads \
  112. --enable-libtheora \
  113. --enable-libvorbis \
  114. --enable-gpl \
  115. --enable-version3 \
  116. --enable-postproc \
  117. --enable-swscale \
  118. --enable-x11grab \
  119. --enable-avfilter \
  120. --enable-gnutls \
  121. --enable-libcdio \
  122. --arch=$ARCH \
  123. $openjpeg \
  124. $libdc1394 \
  125. $mp3lame \
  126. $libfaac \
  127. $libxvid \
  128. $libx264 \
  129. $libspeex \
  130. $dirac_fast \
  131. $non_free \
  132. $libgsm \
  133. $libvpx \
  134. $librtmp \
  135. $opencore_amr \
  136. $libfrei0r \
  137. $libcelt \
  138. $libbluray \
  139. $libass \
  140. $libopenal \
  141. $ssl
  142.  
  143. make
  144. make install DESTDIR=$PKG
  145.  
  146. rm -r $PKG/usr/{bin,share}
  147.  
  148. find $PKG -print0 | xargs -0 file | grep -e "executable" -e "shared object" | \
  149. grep ELF | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null || true
  150.  
  151. find $PKG/usr/man -type f -exec gzip -9 {} \;
  152.  
  153. mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
  154. cp -a Changelog COPYING* CREDITS INSTALL LICENSE MAINTAINERS README RELEASE \
  155. VERSION doc/RELEASE_NOTES doc/*.txt $PKG/usr/doc/$PRGNAM-$VERSION
  156. cp -a doc/*.html $PKG/usr/doc/$PRGNAM-$VERSION
  157. cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild
  158.  
  159. mkdir -p $PKG/install
  160. cat $CWD/slack-desc > $PKG/install/slack-desc
  161.  
  162. cd $PKG
  163. /sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$PKGARCH-$BUILD$TAG.${PKGTYPE:-tgz}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement