SuperCollider.SlackBuild 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125
  1. #!/bin/bash
  2. # Slackware build script for SuperCollider
  3. # Written by Felix Pfeifer
  4. # contact: pfeifer[dot]felix[at]googlemail[dot]com
  5. # 20220218 bkw: Modified by SlackBuilds.org: updated for v3.12.2 as
  6. # the previous version wouldn't build on Slackware 15.0. Build with
  7. # bundled yaml-cpp rather than depend on an external yaml-cpp.
  8. cd $(dirname $0) ; CWD=$(pwd)
  9. PRGNAM=SuperCollider
  10. VERSION=${VERSION:-3.12.2}
  11. BUILD=${BUILD:-1}
  12. TAG=${TAG:-_SBo}
  13. PKGTYPE=${PKGTYPE:-tgz}
  14. if [ -z "$ARCH" ]; then
  15. case "$( uname -m )" in
  16. i?86) ARCH=i686 ;;
  17. arm*) ARCH=arm ;;
  18. *) ARCH=$( uname -m ) ;;
  19. esac
  20. fi
  21. if [ ! -z "${PRINT_PACKAGE_NAME}" ]; then
  22. echo "$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE"
  23. exit 0
  24. fi
  25. TMP=${TMP:-/tmp/SBo}
  26. PKG=$TMP/package-$PRGNAM
  27. OUTPUT=${OUTPUT:-/tmp}
  28. if [ "$ARCH" = "i686" ]; then
  29. SLKCFLAGS="-O2 -march=i686 -mtune=i686"
  30. LIBDIRSUFFIX=""
  31. elif [ "$ARCH" = "x86_64" ]; then
  32. SLKCFLAGS="-O2 -fPIC"
  33. LIBDIRSUFFIX="64"
  34. else
  35. SLKCFLAGS="-O2"
  36. LIBDIRSUFFIX=""
  37. fi
  38. set -e
  39. rm -rf $PKG
  40. mkdir -p $TMP $PKG $OUTPUT
  41. cd $TMP
  42. rm -rf $PRGNAM-$VERSION-Source
  43. tar xvf $CWD/$PRGNAM-$VERSION-Source.tar.bz2
  44. cd $PRGNAM-$VERSION-Source
  45. chown -R root:root .
  46. find -L . \
  47. \( -perm 777 -o -perm 775 -o -perm 750 -o -perm 711 -o -perm 555 -o -perm 511 \) \
  48. -exec chmod 755 {} \+ -o \
  49. \( -perm 666 -o -perm 664 -o -perm 600 -o -perm 444 -o -perm 440 -o -perm 400 \) \
  50. -exec chmod 644 {} \+
  51. # Pass AVAHI=yes to the script to enable avahi support
  52. if [ "${AVAHI:-no}" = "yes" ]; then avahi="OFF"; else avahi="ON"; fi
  53. # Pass EMACS=no to the script to disable emacs support
  54. if [ "${EMACS:-yes}" = "no" ]; then emacs="no"; else emacs="yes"; fi
  55. # cwiid support is "autodetected"
  56. if [ -h /usr/lib$LIBDIRSUFFIX/libcwiid.so ]; then
  57. cwiid="ON"
  58. else
  59. cwiid="OFF"
  60. fi
  61. # Readline support don't work
  62. sed -i "s|^find_package(Readline\ 5\.0)|unset(READLINE_FOUND)|" lang/CMakeLists.txt
  63. mkdir -p build
  64. cd build
  65. cmake \
  66. -DCMAKE_C_FLAGS:STRING="$SLKCFLAGS" \
  67. -DCMAKE_CXX_FLAGS:STRING="$SLKCFLAGS" \
  68. -DCMAKE_INSTALL_PREFIX=/usr \
  69. -DNO_AVAHI="$avahi" \
  70. -DSC_WII="$cwiid" \
  71. -DSC_EL="$emacs" \
  72. -DSC_ED="2" \
  73. -DSYSTEM_YAMLCPP=OFF \
  74. -DCMAKE_BUILD_TYPE=Release ..
  75. make
  76. make install/strip DESTDIR=$PKG
  77. cd -
  78. # install scvim
  79. cd editors/scvim
  80. mkdirhier $PKG/usr/share/scvim/vim
  81. cp -rf bin/* $PKG/usr/bin
  82. cp -r ftplugin $PKG/usr/share/scvim/vim # copy this and the 2 following to
  83. cp -r indent $PKG/usr/share/scvim/vim # the vim runtimepath
  84. cp -r syntax $PKG/usr/share/scvim/vim # any idea where this might be globally?
  85. #cp scvimrc $PKG/usr/share/scvim
  86. cd -
  87. find $PKG -print0 | xargs -0 file | grep -e "executable" -e "shared object" | grep ELF \
  88. | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null || true
  89. #mv $PKG/usr/share/doc $PKG/usr
  90. mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
  91. cp -a AUTHORS CHANGELOG* COPYING README* $PKG/usr/doc/$PRGNAM-$VERSION
  92. cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild
  93. mkdir -p $PKG/install
  94. cat $CWD/slack-desc > $PKG/install/slack-desc
  95. cat $CWD/doinst.sh > $PKG/install/doinst.sh
  96. if [ "${CAPS:-yes}" = "yes" ]; then
  97. echo "setcap cap_ipc_lock,cap_sys_nice=ep usr/bin/sclang" >> $PKG/install/doinst.sh
  98. echo "setcap cap_ipc_lock,cap_sys_nice=ep usr/bin/scsynth" >> $PKG/install/doinst.sh
  99. echo "setcap cap_ipc_lock,cap_sys_nice=ep usr/bin/scvim" >> $PKG/install/doinst.sh
  100. echo "setcap cap_ipc_lock,cap_sys_nice=ep usr/bin/scide" >> $PKG/install/doinst.sh
  101. fi
  102. cd $PKG
  103. /sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE