Advertisement
timcowchip

audacity.Slackbuild

Oct 8th, 2013
64
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.47 KB | None | 0 0
  1. #!/bin/sh
  2.  
  3. # Slackware build script for Audacity
  4.  
  5. # Copyright 2006-2010 Chess Griffin <chess@chessgriffin.com>
  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. # Thanks to Eric Hameleers for adding the audacity.desktop file
  26. # and other tweaks and bug fixes. Thanks to Heinz Wiesinger for
  27. # bug fixes and the soundtouch and twolame improvements.
  28.  
  29. # Modified by the SlackBuilds.org project
  30. # Modified by Chris Farrell <timcowchip@gmail.com>
  31.  
  32. PRGNAM=audacity
  33. VERSION=${VERSION:-2.0.3}
  34. BUILD=${BUILD:-1}
  35. TAG=${TAG:-_SBo}
  36.  
  37. if [ -z "$ARCH" ]; then
  38. case "$( uname -m )" in
  39. i?86) ARCH=i486 ;;
  40. arm*) ARCH=arm ;;
  41. *) ARCH=$( uname -m ) ;;
  42. esac
  43. fi
  44.  
  45. CWD=$(pwd)
  46. TMP=${TMP:-/tmp/SBo}
  47. PKG=$TMP/package-$PRGNAM
  48. OUTPUT=${OUTPUT:-/tmp}
  49.  
  50. if [ "$ARCH" = "i486" ]; then
  51. SLKCFLAGS="-O2 -march=i486 -mtune=i686"
  52. LIBDIRSUFFIX=""
  53. elif [ "$ARCH" = "i686" ]; then
  54. SLKCFLAGS="-O2 -march=i686 -mtune=i686"
  55. LIBDIRSUFFIX=""
  56. elif [ "$ARCH" = "x86_64" ]; then
  57. SLKCFLAGS="-O2 -fPIC"
  58. LIBDIRSUFFIX="64"
  59. else
  60. SLKCFLAGS="-O2"
  61. LIBDIRSUFFIX=""
  62. fi
  63.  
  64. do_soundtouch="out" ; [ "${SOUNDTOUCH:-no}" != "no" ] && do_soundtouch=""
  65. do_twolame="out" ; [ "${TWOLAME:-no}" != "no" ] && do_twolame=""
  66. do_vamp="out" ; [ "${VAMP:-no}" != "no" ] && do_vamp=""
  67.  
  68. set -e
  69.  
  70. rm -rf $PKG
  71. mkdir -p $TMP $PKG $OUTPUT
  72. cd $TMP
  73. rm -rf $PRGNAM-src-$VERSION
  74. tar xvf $CWD/$PRGNAM-minsrc-$VERSION.tar.?z*
  75. cd $PRGNAM-src-$VERSION
  76. chown -R root:root .
  77. find . \
  78. \( -perm 777 -o -perm 775 -o -perm 711 -o -perm 555 -o -perm 511 \) \
  79. -exec chmod 755 {} \; -o \
  80. \( -perm 666 -o -perm 664 -o -perm 600 -o -perm 444 -o -perm 440 -o -perm 400 \) \
  81. -exec chmod 644 {} \;
  82.  
  83. # Fix vamp plugin search path on x86_64 - thanks to B. Watson
  84. sed -i "s,lib/vamp,lib$LIBDIRSUFFIX/vamp,g" \
  85. lib-src/libvamp/src/vamp-hostsdk/PluginHostAdapter.cpp
  86. PKG_CONFIG_PATH+="/usr/lib64/ffmpeg-compat/pkgconfig" \
  87.  
  88. Qmake_PREFIX=/usr \
  89. QMAKE_CXXFLAGS="-I/usr/lib/ffmpeg-compat -I/usr/include/ffmpeg-compat/libavformat -I/usr/include/ffmpeg-compat/libavcodec $CXXFLAGS" \
  90. CFLAGS="$SLKCFLAGS" \
  91. CXXFLAGS="$SLKCFLAGS" \
  92. ./configure \
  93. --prefix=/usr \
  94. --libdir=/usr/lib${LIBDIRSUFFIX} \
  95. --enable-unicode \
  96. --enable-nyquist \
  97. --enable-vamp \
  98. --with-ffmpeg \
  99. --with-expat \
  100. --with-libvorbis \
  101. --with-libmad \
  102. --with-libflac \
  103. --with-libsndfile \
  104. --with-libid3tag \
  105. --with-libresample \
  106. --with$do_soundtouch-soundtouch \
  107. --with$do_twolame-libtwolame \
  108. --with$do_vamp-libvamp
  109.  
  110. make
  111. make install DESTDIR=$PKG
  112.  
  113. find $PKG | xargs file | grep -e "executable" -e "shared object" | grep ELF \
  114. | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null || true
  115.  
  116. # We're going to overwrite the included audacity.desktop file with ours,
  117. # and the icon isn't added at all by upstream, so we'll do that here
  118. install -D -m 0644 $CWD/audacity.desktop \
  119. $PKG/usr/share/applications/audacity.desktop
  120. install -D -m 0644 images/AudacityLogo48x48.xpm \
  121. $PKG/usr/share/pixmaps/audacity.xpm
  122.  
  123. # Move manpage directory to proper location; pages are already gzipped
  124. mv $PKG/usr/share/man $PKG/usr
  125.  
  126. mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
  127. rm -fr $PKG/usr/share/doc
  128. cp LICENSE.txt README.txt $PKG/usr/doc/$PRGNAM-$VERSION
  129. cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild
  130.  
  131. mkdir -p $PKG/install
  132. cat $CWD/slack-desc > $PKG/install/slack-desc
  133. cat $CWD/doinst.sh > $PKG/install/doinst.sh
  134.  
  135. cd $PKG
  136. /sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.${PKGTYPE:-tgz}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement