shotcut.SlackBuild 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127
  1. #!/bin/bash
  2. #
  3. # Slackware build script for shotcut.
  4. #
  5. # Copyright 2015 Edinaldo P. Silva, Rio de Janeiro, Brazil.
  6. # Copyright 2016-2018 Larry Hajali <larryhaja[at]gmail[dot]com>
  7. # All rights reserved.
  8. #
  9. # Redistribution and use of this script, with or without modification, is
  10. # permitted provided that the following conditions are met:
  11. #
  12. # 1. Redistributions of this script must retain the above copyright
  13. # notice, this list of conditions and the following disclaimer.
  14. #
  15. # THIS SOFTWARE IS PROVIDED BY THE AUTHOR "AS IS" AND ANY EXPRESS OR IMPLIED
  16. # WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
  17. # MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
  18. # EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
  19. # SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
  20. # PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
  21. # OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
  22. # WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
  23. # OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
  24. # ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  25. cd $(dirname $0) ; CWD=$(pwd)
  26. PRGNAM=shotcut
  27. VERSION=${VERSION:-21.12.24}
  28. BUILD=${BUILD:-1}
  29. TAG=${TAG:-_SBo}
  30. PKGTYPE=${PKGTYPE:-tgz}
  31. if [ -z "$ARCH" ]; then
  32. case "$( uname -m )" in
  33. i?86) ARCH=i586 ;;
  34. arm*) ARCH=arm ;;
  35. *) ARCH=$( uname -m ) ;;
  36. esac
  37. fi
  38. # If the variable PRINT_PACKAGE_NAME is set, then this script will report what
  39. # the name of the created package would be, and then exit. This information
  40. # could be useful to other scripts.
  41. if [ ! -z "${PRINT_PACKAGE_NAME}" ]; then
  42. echo "$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE"
  43. exit 0
  44. fi
  45. TMP=${TMP:-/tmp/SBo}
  46. PKG=$TMP/package-$PRGNAM
  47. OUTPUT=${OUTPUT:-/tmp}
  48. if [ "$ARCH" = "i586" ]; then
  49. SLKCFLAGS="-O2 -march=i586 -mtune=i686"
  50. LIBDIRSUFFIX=""
  51. BITS="x86"
  52. elif [ "$ARCH" = "i686" ]; then
  53. SLKCFLAGS="-O2 -march=i686 -mtune=i686"
  54. LIBDIRSUFFIX=""
  55. BITS="x86"
  56. elif [ "$ARCH" = "x86_64" ]; then
  57. SLKCFLAGS="-O2 -fPIC"
  58. LIBDIRSUFFIX="64"
  59. BITS="x86_64"
  60. else
  61. SLKCFLAGS="-O2"
  62. LIBDIRSUFFIX=""
  63. fi
  64. set -e
  65. rm -rf $PKG
  66. mkdir -p $TMP $PKG $OUTPUT
  67. cd $TMP
  68. rm -rf $PRGNAM-$VERSION
  69. tar xvf $CWD/$PRGNAM-$VERSION.tar.gz
  70. cd $PRGNAM-$VERSION
  71. chown -R root:root .
  72. find -L . \
  73. \( -perm 777 -o -perm 775 -o -perm 750 -o -perm 711 -o -perm 555 \
  74. -o -perm 511 \) -exec chmod 755 {} \; -o \
  75. \( -perm 666 -o -perm 664 -o -perm 640 -o -perm 600 -o -perm 444 \
  76. -o -perm 440 -o -perm 400 \) -exec chmod 644 {} \;
  77. # Fix libpng warning.
  78. # [Warning] <> libpng warning: iCCP: profile 'icc': 'RGB ': RGB color space not permitted on grayscale PNG
  79. rm -fR packaging/windows/Microsoft* # avoids find's choking
  80. for i in $(find . -name "*\.png"); do
  81. mv $i ${i}.old.png
  82. convert $i.old.png $i
  83. touch -r ${i}.old.png $i
  84. rm $i.old.png
  85. done
  86. mkdir -p build
  87. cd build
  88. qmake PREFIX="/usr" QMAKE_CFLAGS+="$SLKCFLAGS" QMAKE_CXXFLAGS+="$SLKCFLAGS" \
  89. CONFIG+=release SHOTCUT_VERSION="$VERSION" DEFINES+=SHOTCUT_NOUPGRADE ..
  90. make
  91. lrelease ../translations/*.ts
  92. make install INSTALL_ROOT=$PKG
  93. cd ..
  94. find $PKG -print0 | xargs -0 file | grep -e "executable" -e "shared object" | grep ELF \
  95. | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null || true
  96. mv $PKG/usr/share/man $PKG/usr/man
  97. find $PKG/usr/man -type f -exec gzip -9 {} \;
  98. for i in $( find $PKG/usr/man -type l ) ; do ln -s $( readlink $i ).gz $i.gz ; rm $i ; done
  99. find $PKG/usr/share/$PRGNAM -type f -exec chmod 0644 '{}' \;
  100. mkdir -p $PKG/usr/share/applications
  101. install -m 0644 $CWD/$PRGNAM.desktop $PKG/usr/share/applications
  102. mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
  103. cp -a COPYING README.md CuteLogger/LICENSE.LGPL $PKG/usr/doc/$PRGNAM-$VERSION
  104. cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild
  105. mkdir -p $PKG/install
  106. cat $CWD/slack-desc > $PKG/install/slack-desc
  107. cat $CWD/doinst.sh > $PKG/install/doinst.sh
  108. cd $PKG
  109. /sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE