wineasio.SlackBuild 2.2 KB

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