openshot.SlackBuild 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129
  1. #!/bin/bash
  2. # Copyright 2009, Jonathan Larsen (agentc0re), SLC, UT
  3. # Contact Info: agentc0re 'AT' learnix 'DOT' net
  4. #
  5. # Copyright 2016-2022 Christoph Willing, Brisbane Australia
  6. # All rights reserved.
  7. #
  8. # Redistribution and use of this script, with or without modification, is
  9. # permitted provided that the following conditions are met:
  10. #
  11. # 1. Redistributions of this script must retain the above copyright
  12. # notice, this list of conditions and the following disclaimer.
  13. #
  14. # THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
  15. # WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
  16. # MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
  17. # EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
  18. # SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
  19. # PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
  20. # OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
  21. # WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
  22. # OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
  23. # ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  24. #
  25. # Jan 10, 2010 - Initial Creation
  26. #
  27. # Feb 14, 2010 - Fixed version info as openshot got rid of the "-1" at the end.
  28. # Also updated README to reflect the missing required DEP - pyxdg
  29. #
  30. # Mar 3rd, 2010
  31. # Upgraded script to version 1.1.1
  32. # fixed the "strip" for bash 4 compatability
  33. #
  34. # Sept 18th, 2010
  35. # Version upgrade 1.1.3, script sync with 13.1 script updates
  36. #
  37. # Oct 11th, 2010
  38. # Version upgrade to 1.2.2
  39. #
  40. # Oct 2nd, 2012
  41. # Version upgrade to 1.4.3 - Matteo Bernardini <ponce@slackbuilds.org>
  42. #
  43. # From Oct 22nd, 2016-2020
  44. # Maintenance & various version upgrades - Christoph Willing <chris.willing@linux.com>
  45. # 20220421 bkw: Modified by SlackBuilds.org, BUILD=2:
  46. # - add gtk-update-icon-cache to doinst.sh.
  47. # - stop writing outside of $TMP (except /root/.openshot_qt/).
  48. cd $(dirname $0) ; CWD=$(pwd)
  49. PRGNAM=openshot
  50. SRCNAM=openshot-qt
  51. VERSION=${VERSION:-2.6.1}
  52. BUILD=${BUILD:-2}
  53. TAG=${TAG:-_SBo}
  54. PKGTYPE=${PKGTYPE:-tgz}
  55. if [ -z "$ARCH" ]; then
  56. case "$( uname -m )" in
  57. i?86) ARCH=i586 ;;
  58. arm*) ARCH=arm ;;
  59. *) ARCH=$( uname -m ) ;;
  60. esac
  61. fi
  62. if [ ! -z "${PRINT_PACKAGE_NAME}" ]; then
  63. echo "$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE"
  64. exit 0
  65. fi
  66. TMP=${TMP:-/tmp/SBo}
  67. PKG=$TMP/package-$PRGNAM
  68. OUTPUT=${OUTPUT:-/tmp}
  69. if [ "$ARCH" = "i586" ]; then
  70. SLKCFLAGS="-O2 -march=i586 -mtune=i686"
  71. LIBDIRSUFFIX=""
  72. elif [ "$ARCH" = "i686" ]; then
  73. SLKCFLAGS="-O2 -march=i686 -mtune=i686"
  74. LIBDIRSUFFIX=""
  75. elif [ "$ARCH" = "x86_64" ]; then
  76. SLKCFLAGS="-O2 -fPIC"
  77. LIBDIRSUFFIX="64"
  78. else
  79. SLKCFLAGS="-O2"
  80. LIBDIRSUFFIX=""
  81. fi
  82. set -e
  83. rm -rf $PKG
  84. mkdir -p $TMP $PKG $OUTPUT
  85. cd $TMP
  86. rm -rf $SRCNAM-$VERSION
  87. tar xf $CWD/$SRCNAM-$VERSION.tar.gz
  88. cd $SRCNAM-$VERSION
  89. chown -R root:root .
  90. find -L . \
  91. \( -perm 777 -o -perm 775 -o -perm 750 -o -perm 711 -o -perm 555 -o -perm 511 \) \
  92. -exec chmod 755 {} \; -o \
  93. \( -perm 666 -o -perm 664 -o -perm 600 -o -perm 444 -o -perm 440 -o -perm 400 \) \
  94. -exec chmod 644 {} \;
  95. # 20220421 bkw: setup.py doesn't need to call update-mime-database and
  96. # update-desktop-database; it spams the real /usr, and our doinst.sh
  97. # already does the job.
  98. sed -i '/^if ROOT and/,$d' setup.py
  99. python3 setup.py install --root=$PKG
  100. find $PKG | xargs file | grep -e "executable" -e "shared object" | grep ELF \
  101. | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null || true
  102. mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
  103. cp -a AUTHORS CONTRIBUTING.md COPYING README.md \
  104. $PKG/usr/doc/$PRGNAM-$VERSION
  105. cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild
  106. mkdir -p $PKG/install
  107. cat $CWD/slack-desc > $PKG/install/slack-desc
  108. cat $CWD/doinst.sh > $PKG/install/doinst.sh
  109. cd $PKG
  110. /sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE