wineasio.SlackBuild 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293
  1. #!/bin/bash
  2. # Slackware build script for wineasio
  3. # Written by B. Watson (urchlay@slackware.uk)
  4. # Licensed under the WTFPL. See http://www.wtfpl.net/txt/copying/ for details.
  5. cd $(dirname $0) ; CWD=$(pwd)
  6. # 20220101 bkw:
  7. # - update to v1.0.0, switch to falkTX's fork (which is actually maintained).
  8. # - 64-bit support.
  9. # - asio.h no longer needed, update README.
  10. PRGNAM=wineasio
  11. VERSION=${VERSION:-1.0.0}
  12. BUILD=${BUILD:-1}
  13. TAG=${TAG:-_SBo}
  14. PKGTYPE=${PKGTYPE:-tgz}
  15. if [ -z "$ARCH" ]; then
  16. case "$( uname -m )" in
  17. i?86) ARCH=i586 ;;
  18. arm*) ARCH=arm ;;
  19. *) ARCH=$( uname -m ) ;;
  20. esac
  21. fi
  22. if [ ! -z "${PRINT_PACKAGE_NAME}" ]; then
  23. echo "$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE"
  24. exit 0
  25. fi
  26. TMP=${TMP:-/tmp/SBo}
  27. PKG=$TMP/package-$PRGNAM
  28. OUTPUT=${OUTPUT:-/tmp}
  29. SLKCFLAGS32="-O2 -march=i586 -mtune=i686"
  30. SLKCFLAGS64="-O2 -fPIC"
  31. set -e
  32. rm -rf $PKG
  33. mkdir -p $TMP $PKG $OUTPUT
  34. cd $TMP
  35. rm -rf $PRGNAM-$VERSION
  36. tar xvf $CWD/$PRGNAM-$VERSION.tar.gz
  37. cd $PRGNAM-$VERSION
  38. chown -R root:root .
  39. find -L . -perm /111 -a \! -perm 755 -a -exec chmod 755 {} \+ -o \
  40. \! -perm /111 -a \! -perm 644 -a -exec chmod 644 {} \+
  41. # 20220102 bkw: support multilib, if possible. we will try both
  42. # 32 and 64 bit builds, and it's only a fatal error if both fail.
  43. # This is UNTESTED but should work. I think.
  44. trymake() {
  45. local BITS="$1"
  46. local WINELIB="$2"
  47. local FLAGS="$3"
  48. if make $BITS CFLAGS="$FLAGS" CXXFLAGS="$FLAGS"; then
  49. mkdir -p $WINELIB
  50. install -m0755 -s build$BITS/wineasio.dll.so $WINELIB
  51. fi
  52. }
  53. trymake 32 $PKG/usr/lib/wine "$SLKCFLAGS32"
  54. if [ "$ARCH" = "x86_64" ]; then
  55. make clean
  56. trymake 64 $PKG/usr/lib64/wine "$SLKCFLAGS64"
  57. fi
  58. count="$( find $PKG/usr -name '*.dll.so' | wc -l )"
  59. case "$count" in
  60. 1) MULTILIB="" ;;
  61. 2) MULTILIB=" This package supports both 32-bit and 64-bit WINE." ;;
  62. *) echo "*** Failed to build either 32-bit or 64-bit $PRGNAM."
  63. exit 1 ;;
  64. esac
  65. mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
  66. cp -a COPYING.* *.md $PKG/usr/doc/$PRGNAM-$VERSION
  67. cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild
  68. mkdir -p $PKG/install
  69. sed "15s,\$,$MULTILIB," $CWD/slack-desc > $PKG/install/slack-desc
  70. cd $PKG
  71. /sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE