wmusic.SlackBuild 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126
  1. #!/bin/bash
  2. # Slackware build script for wmusic
  3. #
  4. # Copyright 2015 Gethyn ThomasQuail <email removed>
  5. # All rights reserved.
  6. #
  7. # Based on:
  8. # SBo's cmake-template
  9. #
  10. # Redistribution and use of this script, with or without modification, is
  11. # permitted provided that the following conditions are met:
  12. #
  13. # 1. Redistributions of this script must retain the above copyright
  14. # notice, this list of conditions and the following disclaimer.
  15. #
  16. # THIS SOFTWARE IS PROVIDED BY THE AUTHOR ''AS IS'' AND ANY EXPRESS OR IMPLIED
  17. # WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
  18. # MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
  19. # EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
  20. # SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
  21. # PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
  22. # OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
  23. # WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
  24. # OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
  25. # ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  26. # Currently maintained by B. Watson <yalhcru@gmail.com>
  27. # 20211019 bkw: BUILD=2, fix build for updated playerctl.
  28. # 20180916 bkw: update for v2.0.0.
  29. # 20160816 bkw:
  30. # - take over maintenance
  31. # - BUILD=2
  32. # - actually use SLKCFLAGS
  33. # - install binary stripped
  34. # - remove 'see the Info files' from man page, as there is no info file.
  35. cd $(dirname $0) ; CWD=$(pwd)
  36. PRGNAM=wmusic
  37. VERSION=${VERSION:-2.0.0}
  38. BUILD=${BUILD:-2}
  39. TAG=${TAG:-_SBo}
  40. PKGTYPE=${PKGTYPE:-tgz}
  41. if [ -z "$ARCH" ]; then
  42. case "$( uname -m )" in
  43. i?86) ARCH=i586 ;;
  44. arm*) ARCH=arm ;;
  45. *) ARCH=$( uname -m ) ;;
  46. esac
  47. fi
  48. if [ ! -z "${PRINT_PACKAGE_NAME}" ]; then
  49. echo "$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE"
  50. exit 0
  51. fi
  52. TMP=${TMP:-/tmp/SBo}
  53. PKG=$TMP/package-$PRGNAM
  54. OUTPUT=${OUTPUT:-/tmp}
  55. if [ "$ARCH" = "i586" ]; then
  56. SLKCFLAGS="-O2 -march=i586 -mtune=i686"
  57. LIBDIRSUFFIX=""
  58. elif [ "$ARCH" = "i686" ]; then
  59. SLKCFLAGS="-O2 -march=i686 -mtune=i686"
  60. LIBDIRSUFFIX=""
  61. elif [ "$ARCH" = "x86_64" ]; then
  62. SLKCFLAGS="-O2 -fPIC"
  63. LIBDIRSUFFIX="64"
  64. else
  65. SLKCFLAGS="-O2"
  66. LIBDIRSUFFIX=""
  67. fi
  68. set -e
  69. rm -rf $PKG
  70. mkdir -p $TMP $PKG $OUTPUT
  71. cd $TMP
  72. rm -rf $PRGNAM-$VERSION
  73. tar xvf $CWD/$PRGNAM-$VERSION.tar.gz
  74. cd $PRGNAM-$VERSION
  75. chown -R root:root .
  76. find -L . -perm /111 -a \! -perm 755 -a -exec chmod 755 {} \+ -o \
  77. \! -perm /111 -a \! -perm 644 -a -exec chmod 644 {} \+
  78. # 20211019 bkw: Someone upgraded playerctl to an incompatible version,
  79. # without testing to see if it broke anything. Gee, thanks.
  80. if ! pkg-config --exists playerctl-1.0; then
  81. sed -i 's,playerctl-1.0,playerctl,g' configure
  82. fi
  83. # Stop spewing these:
  84. # GLib-GObject-CRITICAL **: g_object_get: assertion 'G_IS_OBJECT (object)' failed
  85. patch -p1 < $CWD/kill_glib_assertion_spam.diff
  86. CFLAGS="$SLKCFLAGS" \
  87. CXXFLAGS="$SLKCFLAGS" \
  88. ./configure \
  89. --prefix=/usr \
  90. --libdir=/usr/lib${LIBDIRSUFFIX} \
  91. --sysconfdir=/etc \
  92. --localstatedir=/var \
  93. --mandir=/usr/man \
  94. --docdir=/usr/doc/$PRGNAM-$VERSION \
  95. --build=$ARCH-slackware-linux
  96. make
  97. sed -i '/see the Info files/d' $PRGNAM.1
  98. make install-strip DESTDIR=$PKG
  99. gzip -9 $PKG/usr/man/man1/$PRGNAM.1
  100. mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
  101. cp -a README COPYING ChangeLog $PKG/usr/doc/$PRGNAM-$VERSION
  102. cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild
  103. mkdir -p $PKG/install
  104. cat $CWD/slack-desc > $PKG/install/slack-desc
  105. cd $PKG
  106. /sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE