blender.SlackBuild 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128
  1. #!/bin/bash
  2. # Slackware build script for Blender
  3. # Ryan P.C. McQuen | Everett, WA | ryanpcmcquen@member.fsf.org
  4. # 2017 - Dhaby Xiloj <slack.dhabyx@gmail.com>
  5. # Copyright 2008-2013 Robby Workman Northport, AL, USA
  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. # 20220404 bkw: Modified by SlackBuilds.org, BUILD=2:
  25. # - strip the python interpreter and one shared lib that weren't already.
  26. # - remove the broken symlinks in the icons dir. upstream doesn't include
  27. # PNG icons (I assume it did at one time), only an SVG one.
  28. # - add SlackBuild to doc dir.
  29. # Thanks to Giorgio Peron <giorgio.peron@gmail.com> for some build tips
  30. cd $(dirname $0) ; CWD=$(pwd)
  31. PRGNAM=blender
  32. VERSION=${VERSION:-2.90.1}
  33. BUILD=${BUILD:-2}
  34. TAG=${TAG:-_SBo}
  35. PKGTYPE=${PKGTYPE:-tgz}
  36. SRCVERSION=${VERSION}-linux64
  37. # We'll remove the libGL* shared libaries that are shipped with blender (and
  38. # instead use the ones that are shipped with Slackware's Xorg)
  39. # If this is undesirable for you, pass LMTFA=yes to the script when building
  40. LMTFA=${LMTFA:-no}
  41. case "$( uname -m )" in
  42. i?86) ARCH=i686 ;;
  43. arm*) ARCH=arm ;;
  44. *) ARCH=$( uname -m ) ;;
  45. esac
  46. if [ ! -z "${PRINT_PACKAGE_NAME}" ]; then
  47. echo "$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE"
  48. exit 0
  49. fi
  50. TMP=${TMP:-/tmp/SBo}
  51. PKG=$TMP/package-$PRGNAM
  52. OUTPUT=${OUTPUT:-/tmp}
  53. set -e
  54. if [ "$ARCH" = "x86_64" ]; then
  55. break
  56. elif [ "$ARCH" = "i686" ]; then
  57. break
  58. else
  59. printf "\n\n$ARCH is not supported... \n"
  60. exit 1
  61. fi
  62. rm -rf $PKG
  63. mkdir -p $TMP $PKG $OUTPUT
  64. cd $TMP
  65. rm -rf $PRGNAM-$SRCVERSION
  66. tar xvf $CWD/$PRGNAM-$SRCVERSION.tar.xz
  67. cd $PRGNAM-$SRCVERSION
  68. chown -R root:root .
  69. # Move the docs to our standard location first
  70. mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
  71. cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild
  72. mv *.txt readme.html \
  73. $PKG/usr/doc/$PRGNAM-$VERSION
  74. # Now move everything else
  75. mkdir -p $PKG/opt/blender
  76. mv * $PKG/opt/blender
  77. # Add profile scripts to append to PATH
  78. mkdir -p $PKG/etc/profile.d
  79. cp $CWD/profile.d/* $PKG/etc/profile.d/
  80. chmod 0755 $PKG/etc/profile.d/*
  81. # Leave me alone?
  82. if [ "$LMTFA" != "yes" ]; then
  83. rm -f $PKG/opt/blender/lib/libGL*
  84. fi
  85. # 20220404 bkw: a couple of things aren't stripped... this
  86. # is noticeably faster than the template find|strip.
  87. find $PKG/opt/blender -type f -print0 | \
  88. xargs -0 file -m /etc/file/magic/elf | \
  89. grep 'ELF.*dynamic.*not stripped' | \
  90. cut -d: -f1 | xargs strip
  91. # Put symlinks to icons in the standard places.
  92. # 20220404 bkw: looks like upstream got rid of PNG icons and only
  93. # ships an SVG (which has moved).
  94. mkdir -p $PKG/usr/share/icons/hicolor/scalable/apps
  95. ln -s ../../../../../../opt/blender/blender.svg \
  96. $PKG/usr/share/icons/hicolor/scalable/apps/
  97. # Add a desktop menu entry
  98. mkdir -p $PKG/usr/share/applications
  99. cat $CWD/blender.desktop > $PKG/usr/share/applications/blender.desktop
  100. mkdir -p $PKG/install
  101. cat $CWD/slack-desc > $PKG/install/slack-desc
  102. cat $CWD/doinst.sh > $PKG/install/doinst.sh
  103. cd $PKG
  104. /sbin/makepkg -c n -l y $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE