aseqview.SlackBuild 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108
  1. #!/bin/bash
  2. # Slackware build script for aseqview
  3. # Written by B. Watson (urchlay@slackware.uk)
  4. # Licensed under the WTFPL. See http://www.wtfpl.net/txt/copying/ for details.
  5. # 20210805 bkw, BUILD=2:
  6. # - build with gtk2 rather than gtk1, apply a couple of upstream fixes.
  7. cd $(dirname $0) ; CWD=$(pwd)
  8. PRGNAM=aseqview
  9. VERSION=${VERSION:-0.2.8}
  10. BUILD=${BUILD:-2}
  11. TAG=${TAG:-_SBo}
  12. PKGTYPE=${PKGTYPE:-tgz}
  13. if [ -z "$ARCH" ]; then
  14. case "$( uname -m )" in
  15. i?86) ARCH=i586 ;;
  16. arm*) ARCH=arm ;;
  17. *) ARCH=$( uname -m ) ;;
  18. esac
  19. fi
  20. if [ ! -z "${PRINT_PACKAGE_NAME}" ]; then
  21. echo "$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE"
  22. exit 0
  23. fi
  24. TMP=${TMP:-/tmp/SBo}
  25. PKG=$TMP/package-$PRGNAM
  26. OUTPUT=${OUTPUT:-/tmp}
  27. if [ "$ARCH" = "i586" ]; then
  28. SLKCFLAGS="-O2 -march=i586 -mtune=i686"
  29. LIBDIRSUFFIX=""
  30. elif [ "$ARCH" = "i686" ]; then
  31. SLKCFLAGS="-O2 -march=i686 -mtune=i686"
  32. LIBDIRSUFFIX=""
  33. elif [ "$ARCH" = "x86_64" ]; then
  34. SLKCFLAGS="-O2 -fPIC"
  35. LIBDIRSUFFIX="64"
  36. else
  37. SLKCFLAGS="-O2"
  38. LIBDIRSUFFIX=""
  39. fi
  40. set -e
  41. rm -rf $PKG
  42. mkdir -p $TMP $PKG $OUTPUT
  43. cd $TMP
  44. rm -rf $PRGNAM-$VERSION
  45. tar xvf $CWD/$PRGNAM-$VERSION.tar.gz
  46. cd $PRGNAM-$VERSION
  47. chown -R root:root .
  48. find -L . -perm /111 -a \! -perm 755 -a -exec chmod 755 {} \+ -o \
  49. \! -perm /111 -a \! -perm 644 -a -exec chmod 644 {} \+
  50. # From upstream's github: fix a segfault and a possible autotools issue.
  51. # Commits b31044a and e40717b.
  52. patch -p1 < $CWD/b31044a.patch
  53. patch -p1 < $CWD/e40717b.patch
  54. # 20180916 bkw: need this due to these:
  55. # levelbar.o: In function `g_bit_nth_lsf':
  56. # levelbar.c:(.text+0x410): multiple definition of `g_bit_nth_lsf'
  57. # aseqview.o:aseqview.c:(.text+0x23c0): first defined here
  58. SLKCFLAGS="$SLKCFLAGS -std=gnu89"
  59. CFLAGS="$SLKCFLAGS" \
  60. CXXFLAGS="$SLKCFLAGS" \
  61. ./configure \
  62. --prefix=/usr \
  63. --libdir=/usr/lib${LIBDIRSUFFIX} \
  64. --sysconfdir=/etc \
  65. --localstatedir=/var \
  66. --mandir=/usr/man \
  67. --docdir=/usr/doc/$PRGNAM-$VERSION \
  68. --enable-gtk2 \
  69. --build=$ARCH-slackware-linux
  70. make
  71. make install-strip DESTDIR=$PKG
  72. gzip -9 $PKG/usr/man/man?/*.?
  73. # NEWS is a 0-byte placeholder
  74. mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
  75. cp -a AUTHORS COPYING README ChangeLog $PKG/usr/doc/$PRGNAM-$VERSION
  76. cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild
  77. # .desktop file written by SlackBuild author. I picked a generic
  78. # audio-related icon that ships with Slackware. Want a better icon? Please
  79. # design one and send it to me. IANAGD (I am not a graphic designer).
  80. mkdir -p $PKG/usr/share/applications
  81. cat $CWD/$PRGNAM.desktop > $PKG/usr/share/applications/$PRGNAM.desktop
  82. mkdir -p $PKG/install
  83. cat $CWD/slack-desc > $PKG/install/slack-desc
  84. cat $CWD/doinst.sh > $PKG/install/doinst.sh
  85. cd $PKG
  86. /sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE