jack-tools.SlackBuild 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144
  1. #!/bin/bash
  2. # Slackware build script for jack-tools
  3. # Written by B. Watson (yalhcru@gmail.com)
  4. # Licensed under the WTFPL. See http://www.wtfpl.net/txt/copying/ for details.
  5. # 20211128 bkw:
  6. # - Update for v20210917_ab297f4 (latest git).
  7. # - Now that Slackware-current has asciidoctor, use it to generate
  8. # man pages (and get rid of my own hacked-up ones).
  9. # - Binary names all changed from jack-* to rju-*, note in README.
  10. # - Add git2tarxz.sh now that upstream's switched to git.
  11. # 20180617 bkw:
  12. # - BUILD=2
  13. # - Get rid of VST headers, since Steinberg doesn't want us to
  14. # distribute them. Thanks to idlemoor for cleaning up the mess
  15. # in the git history.
  16. # - If the user really needs native VST support, he can get the
  17. # headers the legit way (from Steinberg) and the script will
  18. # pick them up. Otherwise, jack-lxvst is just not built. Add
  19. # README_VST.txt to hopefully clarify the situation.
  20. # 20170127 bkw:
  21. # - Updated for 20170117 (latest commit). Also updated c-common to
  22. # latest.
  23. # - Added man pages for the new jack-data and jack-lxvst utils.
  24. # - Added VST headers to get jack-lxvst to build. Not sure the
  25. # licensing status of these, but they were cloned from a public
  26. # github repo.
  27. # 20151110 bkw:
  28. # - Updated for 20141211. This is the date of the latest darcs
  29. # commit. Note that the c-common/ in the source tarball is the
  30. # old one (from my jack-tools-20130616.tar.gz), since jack-tools
  31. # won't compile against the latest c-common. Only jack-scope
  32. # and jack-play have changed.
  33. # - Add capability stuff.
  34. cd $(dirname $0) ; CWD=$(pwd)
  35. PRGNAM=jack-tools
  36. VERSION=${VERSION:-20210917_ab297f4}
  37. BUILD=${BUILD:-1}
  38. TAG=${TAG:-_SBo}
  39. PKGTYPE=${PKGTYPE:-tgz}
  40. if [ -z "$ARCH" ]; then
  41. case "$( uname -m )" in
  42. i?86) ARCH=i586 ;;
  43. arm*) ARCH=arm ;;
  44. *) ARCH=$( uname -m ) ;;
  45. esac
  46. fi
  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" = "i686" ]; then
  58. SLKCFLAGS="-O2 -march=i686 -mtune=i686"
  59. LIBDIRSUFFIX=""
  60. elif [ "$ARCH" = "x86_64" ]; then
  61. SLKCFLAGS="-O2 -fPIC"
  62. LIBDIRSUFFIX="64"
  63. else
  64. SLKCFLAGS="-O2"
  65. LIBDIRSUFFIX=""
  66. fi
  67. set -e
  68. rm -rf $PKG
  69. mkdir -p $TMP $PKG $OUTPUT
  70. cd $TMP
  71. rm -rf $PRGNAM-$VERSION
  72. tar xvf $CWD/${PRGNAM}-$VERSION.tar.xz
  73. # Sources live in a subdir (but the docs don't).
  74. cd $PRGNAM-$VERSION/cmd
  75. # apply our flags. -Wl,-s strips the binaries.
  76. sed -i "s/-O./$SLKCFLAGS -Wl,-s/" Makefile r-common/c/Makefile
  77. # If the Steinberg VST headers are found, put them where the build can find
  78. # them. Neither SBo nor upstream can distribute the headers, you have to get
  79. # them direct from Steinberg.
  80. VST_HEADERS=${VST_HEADERS:-$CWD}
  81. if [ -e $VST_HEADERS/aeffect.h -a -e $VST_HEADERS/aeffectx.h ]; then
  82. # Steinberg me harder!
  83. mkdir -p pluginterfaces/vst2.x
  84. cp $VST_HEADERS/aeffect.h $VST_HEADERS/aeffectx.h pluginterfaces/vst2.x
  85. WITH=WITH
  86. else
  87. sed -i '/^bin *=/s,\(rju-lxvst\|lxvst-query\),,g' Makefile
  88. WITH=WITHOUT
  89. # Don't install the lxvst man page if building without VST.
  90. rm -f ../md/*lxvst*
  91. fi
  92. make
  93. make all VST_SDK=$(pwd)
  94. mkdir -p $PKG/usr/bin $PKG/usr/include
  95. make install prefix=$PKG/usr
  96. # Back to parent source dir.
  97. cd $TMP/$PRGNAM-$VERSION
  98. # generate man pages. results aren't perfectly formatted, but not too bad.
  99. # upstream doesn't have a lxvst-query.md.
  100. asciidoctor -b manpage -d manpage md/rju-*.md
  101. mkdir -p $PKG/usr/man/man1
  102. cp md/*.1 $PKG/usr/man/man1
  103. gzip -9 $PKG/usr/man/man1/*
  104. mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
  105. cat README.md > $PKG/usr/doc/$PRGNAM-$VERSION/README
  106. cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild
  107. mkdir -p $PKG/install
  108. sed "s,@WITH@,$WITH," $CWD/slack-desc > $PKG/install/slack-desc
  109. # Only add capability stuff if not disabled:
  110. if [ "${SETCAP:-yes}" = "yes" ]; then
  111. cat $CWD/setcap.sh >> $PKG/install/doinst.sh
  112. chown root:audio $PKG/usr/bin/*
  113. chmod 0750 $PKG/usr/bin/*
  114. fi
  115. cd $PKG
  116. /sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE