You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

109 lines
3.3 KiB

  1. #!/bin/sh
  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. # Thanks to Giorgio Peron <giorgio.peron@gmail.com> for some build tips
  25. PRGNAM=blender
  26. VERSION=${VERSION:-2.78c}
  27. BUILD=${BUILD:-1}
  28. TAG=${TAG:-_SBo}
  29. SRCVERSION=${VERSION}-linux-glibc219
  30. # We'll remove the libGL* shared libaries that are shipped with blender (and
  31. # instead use the ones that are shipped with Slackware's Xorg)
  32. # If this is undesirable for you, pass LMTFA=yes to the script when building
  33. LMTFA=${LMTFA:-no}
  34. case "$( uname -m )" in
  35. i?86) ARCH=i686 ;;
  36. arm*) ARCH=arm ;;
  37. *) ARCH=$( uname -m ) ;;
  38. esac
  39. CWD=$(pwd)
  40. TMP=${TMP:-/tmp/SBo}
  41. PKG=$TMP/package-$PRGNAM
  42. OUTPUT=${OUTPUT:-/tmp}
  43. set -e
  44. if [ "$ARCH" = "x86_64" ]; then
  45. break
  46. elif [ "$ARCH" = "i686" ]; then
  47. break
  48. else
  49. printf "\n\n$ARCH is not supported... \n"
  50. exit 1
  51. fi
  52. rm -rf $PKG
  53. mkdir -p $TMP $PKG $OUTPUT
  54. cd $TMP
  55. rm -rf $PRGNAM-$SRCVERSION-${ARCH}
  56. tar xvf $CWD/$PRGNAM-$SRCVERSION-${ARCH}.tar.bz2
  57. cd $PRGNAM-$SRCVERSION-${ARCH}
  58. chown -R root:root .
  59. # Move the docs to our standard location first
  60. mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
  61. mv GPL-license.txt copyright.txt Python-license.txt readme.html \
  62. $PKG/usr/doc/$PRGNAM-$VERSION
  63. # Now move everything else
  64. mkdir -p $PKG/opt/blender
  65. mv * $PKG/opt/blender
  66. # Add profile scripts to append to PATH
  67. mkdir -p $PKG/etc/profile.d
  68. cp $CWD/profile.d/* $PKG/etc/profile.d/
  69. chmod 0755 $PKG/etc/profile.d/*
  70. # Leave me alone?
  71. if [ "$LMTFA" != "yes" ]; then
  72. rm -f $PKG/opt/blender/lib/libGL*
  73. fi
  74. # Put symlinks to icons in the standard places
  75. for size in 16x16 22x22 24x24 32x32 48x48 ; do
  76. mkdir -p $PKG/usr/share/icons/hicolor/$size/apps
  77. ln -s /opt/blender/icons/$size/apps/blender.png \
  78. $PKG/usr/share/icons/hicolor/$size/apps/
  79. done
  80. mkdir -p $PKG/usr/share/icons/hicolor/scalable/apps
  81. ln -s /opt/blender/icons/scalable/apps/blender.svg \
  82. $PKG/usr/share/icons/hicolor/scalable/apps/
  83. # Add a desktop menu entry
  84. mkdir -p $PKG/usr/share/applications
  85. cat $CWD/blender.desktop > $PKG/usr/share/applications/blender.desktop
  86. mkdir -p $PKG/install
  87. cat $CWD/slack-desc > $PKG/install/slack-desc
  88. cat $CWD/doinst.sh > $PKG/install/doinst.sh
  89. cd $PKG
  90. /sbin/makepkg -c n -l y $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.${PKGTYPE:-tgz}