Advertisement
Guest User

Untitled

a guest
May 28th, 2017
547
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.63 KB | None | 0 0
  1. #!/bin/sh
  2.  
  3. # Slackware build script for x264
  4.  
  5. # Copyright 2010-2013 Heinz Wiesinger, Amsterdam, The Netherlands
  6. # All rights reserved.
  7. #
  8. # Redistribution and use of this script, with or without modification, is
  9. # permitted provided that the following conditions are met:
  10. #
  11. # 1. Redistributions of this script must retain the above copyright
  12. # notice, this list of conditions and the following disclaimer.
  13. #
  14. # THIS SOFTWARE IS PROVIDED BY THE AUTHOR ''AS IS'' AND ANY EXPRESS OR IMPLIED
  15. # WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
  16. # MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
  17. # EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
  18. # SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
  19. # PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
  20. # OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
  21. # WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
  22. # OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
  23. # ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  24.  
  25. # Originally written by core (eroc@linuxmail.org)
  26.  
  27. # Modified again by Eric Fernandes Ferreira <candelabrus@gmail.com> for my personal Audio Project
  28.  
  29. PRGNAM=x264
  30. VERSION=${VERSION:-git}
  31. BUILD=${BUILD:-1}
  32. TAG=${TAG:-_SBo}
  33.  
  34. if [ -z "$ARCH" ]; then
  35. case "$( uname -m )" in
  36. i?86) ARCH=i586 ;;
  37. arm*) ARCH=arm ;;
  38. *) ARCH=$( uname -m ) ;;
  39. esac
  40. fi
  41.  
  42. CWD=$(pwd)
  43. TMP=${TMP:-/tmp/SBo}
  44. PKG=$TMP/package-$PRGNAM
  45. OUTPUT=${OUTPUT:-/tmp}
  46.  
  47. if [ "$ARCH" = "i586" ]; then
  48. SLKCFLAGS="-O2 -march=i586 -mtune=i686"
  49. LIBDIRSUFFIX=""
  50. elif [ "$ARCH" = "i686" ]; then
  51. SLKCFLAGS="-O2 -march=i686 -mtune=i686"
  52. LIBDIRSUFFIX=""
  53. elif [ "$ARCH" = "x86_64" ]; then
  54. SLKCFLAGS="-O2 -fPIC"
  55. LIBDIRSUFFIX="64"
  56. else
  57. SLKCFLAGS="-O2"
  58. LIBDIRSUFFIX=""
  59. fi
  60.  
  61. set -e
  62.  
  63. rm -rf $PKG
  64. mkdir -p $TMP $PKG $OUTPUT
  65. cd $TMP
  66. rm -rf $PRGNAM
  67. git clone git://git.videolan.org/x264.git
  68. cd $PRGNAM
  69. git checkout
  70. mkdir build-{8,10}bit
  71. chown -R root:root .
  72. find -L . \
  73. \( -perm 777 -o -perm 775 -o -perm 750 -o -perm 711 -o -perm 555 \
  74. -o -perm 511 \) -exec chmod 755 {} \; -o \
  75. \( -perm 666 -o -perm 664 -o -perm 640 -o -perm 600 -o -perm 444 \
  76. -o -perm 440 -o -perm 400 \) -exec chmod 644 {} \;
  77.  
  78. cd build-8bit
  79. CFLAGS="$SLKCFLAGS" \
  80. CXXFLAGS="$SLKCFLAGS" \
  81. ../configure \
  82. --prefix=/usr \
  83. --libdir=/usr/lib${LIBDIRSUFFIX} \
  84. --enable-shared \
  85. --enable-pic \
  86. --enable-strip \
  87. --disable-asm \
  88. --bit-depth=8
  89.  
  90. make
  91. cd ..
  92. make -C build-8bit DESTDIR=$PKG install-cli
  93. mv $PKG/usr/bin/x264 $PKG/usr/bin/x264-8bit
  94. make -C build-8bit DESTDIR=$PKG install-lib-shared
  95.  
  96. cd build-10bit
  97. CFLAGS="$SLKCFLAGS" \
  98. CXXFLAGS="$SLKCFLAGS" \
  99. ../configure \
  100. --prefix=/usr \
  101. --libdir=/usr/lib${LIBDIRSUFFIX} \
  102. --enable-shared \
  103. --enable-pic \
  104. --enable-strip \
  105. --disable-asm \
  106. --bit-depth=10
  107.  
  108. make
  109. cd ..
  110. make -C build-10bit DESTDIR=$PKG install-cli
  111. mv $PKG/usr/bin/x264 $PKG/usr/bin/x264-10bit
  112. make -C build-10bit DESTDIR=$PKG install-lib-shared
  113. ln -s x264-8bit $PKG/usr/bin/x264
  114.  
  115. find $PKG -print0 | xargs -0 file | grep -e "executable" -e "shared object" | grep ELF \
  116. | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null || true
  117.  
  118. mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
  119. cp -a AUTHORS COPYING doc/*.txt $PKG/usr/doc/$PRGNAM-$VERSION
  120. cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild
  121.  
  122. mkdir -p $PKG/install
  123. cat $CWD/slack-desc > $PKG/install/slack-desc
  124.  
  125. cd $PKG
  126. /sbin/makepkg -l y -c n -p $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.${PKGTYPE:-tgz}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement