sooperlooper.SlackBuild 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152
  1. #!/bin/bash
  2. # Slackware build script for sooperlooper
  3. # Written by B. Watson (yalhcru@gmail.com)
  4. # Licensed under the WTFPL. See http://www.wtfpl.net/txt/copying/ for details.
  5. # 20211126 bkw: update for v1.7.8, new-style icons.
  6. # 20201104 bkw: update for v1.7.6. The wxPython (wx 2.8) build is
  7. # currently broken. Temporarily disabled, but I dunno if upstream
  8. # will fix it (may not care about 2.8 any longer).
  9. # 20201028 bkw: update for v1.7.4. patches/* removed, no longer needed.
  10. # 20170622 bkw: fix build on -current, BUILD=3
  11. # 20150514 bkw: update for v1.7.3
  12. # 20140910 bkw:
  13. # - update for v1.7.2
  14. # - explicitly use the correct config script for wx, instead of relying
  15. # on /usr/bin/wx-config
  16. # - add option to build against wxGTK3
  17. cd $(dirname $0) ; CWD=$(pwd)
  18. PRGNAM=sooperlooper
  19. VERSION=${VERSION:-1.7.8}
  20. BUILD=${BUILD:-1}
  21. TAG=${TAG:-_SBo}
  22. PKGTYPE=${PKGTYPE:-tgz}
  23. if [ -z "$ARCH" ]; then
  24. case "$( uname -m )" in
  25. i?86) ARCH=i586 ;;
  26. arm*) ARCH=arm ;;
  27. *) ARCH=$( uname -m ) ;;
  28. esac
  29. fi
  30. if [ ! -z "${PRINT_PACKAGE_NAME}" ]; then
  31. echo "$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE"
  32. exit 0
  33. fi
  34. TMP=${TMP:-/tmp/SBo}
  35. PKG=$TMP/package-$PRGNAM
  36. OUTPUT=${OUTPUT:-/tmp}
  37. if [ "$ARCH" = "i586" ]; then
  38. SLKCFLAGS="-O2 -march=i586 -mtune=i686"
  39. LIBDIRSUFFIX=""
  40. elif [ "$ARCH" = "i686" ]; then
  41. SLKCFLAGS="-O2 -march=i686 -mtune=i686"
  42. LIBDIRSUFFIX=""
  43. elif [ "$ARCH" = "x86_64" ]; then
  44. SLKCFLAGS="-O2 -fPIC"
  45. LIBDIRSUFFIX="64"
  46. else
  47. SLKCFLAGS="-O2"
  48. LIBDIRSUFFIX=""
  49. fi
  50. set -e
  51. # We can't trust the /usr/bin/wx-config symlink.
  52. # Find the correct wx-config, if it exists.
  53. # 20201104 bkw: in 1.7.6, the 2.8 build is broken, it's 3.0 or nothing.
  54. # 20211126 bkw: wx-2.8 build still broken in 1.7.8.
  55. WXVER=3.0
  56. WXCONFIG="$( ls /usr/lib$LIBDIRSUFFIX/wx/config/*-$WXVER 2>/dev/null | head -1 )"
  57. if [ ! -x "$WXCONFIG" ]; then
  58. echo "*** $0: can't find wxGTK 3.0.x installation (2.8 not supported)" 1>&2
  59. exit 1
  60. fi
  61. rm -rf $PKG
  62. mkdir -p $TMP $PKG $OUTPUT
  63. cd $TMP
  64. rm -rf $PRGNAM-$VERSION
  65. tar xvf $CWD/$PRGNAM-$VERSION.tar.gz
  66. cd $PRGNAM-$VERSION
  67. chown -R root:root .
  68. find -L . -perm /111 -a \! -perm 755 -a -exec chmod 755 {} \+ -o \
  69. \! -perm /111 -a \! -perm 644 -a -exec chmod 644 {} \+
  70. # Note: the CFLAGS are actually ignored here. Oh well.
  71. CFLAGS="$SLKCFLAGS" \
  72. CXXFLAGS="$SLKCFLAGS" \
  73. CPPFLAGS="-std=c++11" \
  74. ./configure \
  75. --with-wxconfig-path=$WXCONFIG \
  76. --prefix=/usr \
  77. --libdir=/usr/lib${LIBDIRSUFFIX} \
  78. --sysconfdir=/etc \
  79. --localstatedir=/var \
  80. --mandir=/usr/man \
  81. --docdir=/usr/doc/$PRGNAM-$VERSION \
  82. --build=$ARCH-slackware-linux
  83. make
  84. make install DESTDIR=$PKG
  85. # 'make install-strip' in 1.7.0 fails to strip the slconsole
  86. # and slregister binaries. Rather than plumb the murky depths of
  87. # autotools, I'll just do it manually.
  88. strip $PKG/usr/bin/*
  89. # Icons extracted from the OSX dmg. Had to use dmg2img, then "7z x"
  90. # on the .img file, then find the .icns file (there were 2 identical
  91. # ones) and use icns2png on that. Worth it, these look nicer than the
  92. # old 32x32 icon from Debian.
  93. for i in $CWD/icons/*.png; do
  94. px="$( basename $i .png )"
  95. size=${px}x${px}
  96. dir=$PKG/usr/share/icons/hicolor/$size/apps
  97. mkdir -p $dir
  98. cat $i > $dir/$PRGNAM.png
  99. done
  100. mkdir -p $PKG/usr/share/pixmaps
  101. ln -s ../icons/hicolor/48x48/apps/$PRGNAM.png $PKG/usr/share/pixmaps/$PRGNAM.png
  102. # Man pages and desktop borrowed from Debian (thanks!)
  103. mkdir -p $PKG/usr/share/applications
  104. cat $CWD/$PRGNAM.desktop > $PKG/usr/share/applications/$PRGNAM.desktop
  105. mkdir -p $PKG/usr/man/man1
  106. for page in $CWD/man/*; do
  107. gzip -9c $page > $PKG/usr/man/man1/$( basename $page ).gz
  108. done
  109. mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
  110. cp -a COPYING OSC README $PKG/usr/doc/$PRGNAM-$VERSION
  111. cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild
  112. mkdir -p $PKG/install
  113. cat $CWD/slack-desc > $PKG/install/slack-desc
  114. cat $CWD/doinst.sh > $PKG/install/doinst.sh
  115. if [ "${SETCAP:-yes}" = "yes" ]; then
  116. PROGS="slconsole slgui slregister $PRGNAM"
  117. cat $CWD/setcap.sh >> $PKG/install/doinst.sh
  118. for file in $PROGS; do
  119. chown root:audio $PKG/usr/bin/$file
  120. chmod 0750 $PKG/usr/bin/$file
  121. done
  122. fi
  123. cd $PKG
  124. /sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE