enlightenment.SlackBuild 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123
  1. #!/bin/bash
  2. # Slackware build script for Enlightenment
  3. # Erik Falor | Logan, UT, USA | ewfalor@gmail.com | February 2022
  4. # Previously by Ryan P.C. McQuen | Everett, WA | ryanpcmcquen@member.fsf.org
  5. # Originally by Aleksandar Samardzic <asamardzic@gmail.com>
  6. # This program is free software: you can redistribute it and/or modify
  7. # it under the terms of the GNU General Public License as published by
  8. # the Free Software Foundation; either version 2 of the License, or
  9. # (at your option) any later version, with the following exception:
  10. # the text of the GPL license may be omitted.
  11. # This program is distributed in the hope that it will be useful, but
  12. # without any warranty; without even the implied warranty of
  13. # merchantability or fitness for a particular purpose. Compiling,
  14. # interpreting, executing or merely reading the text of the program
  15. # may result in lapses of consciousness and/or very being, up to and
  16. # including the end of all existence and the Universe as we know it.
  17. # See the GNU General Public License for more details.
  18. # You may have received a copy of the GNU General Public License along
  19. # with this program (most likely, a file named COPYING). If not, see
  20. # <http://www.gnu.org/licenses/>.
  21. cd $(dirname $0) ; CWD=$(pwd)
  22. PRGNAM=enlightenment
  23. VERSION=${VERSION:-0.25.1}
  24. BUILD=${BUILD:-1}
  25. TAG=${TAG:-_SBo}
  26. PKGTYPE=${PKGTYPE:-tgz}
  27. SRC_VERSION=$(echo $VERSION | tr _ -)
  28. if [ -z "$ARCH" ]; then
  29. case "$( uname -m )" in
  30. i?86) ARCH=i586 ;;
  31. arm*) ARCH=arm ;;
  32. *) ARCH=$( uname -m ) ;;
  33. esac
  34. fi
  35. # If the variable PRINT_PACKAGE_NAME is set, then this script will report what
  36. # the name of the created package would be, and then exit. This information
  37. # could be useful to other scripts.
  38. if [ ! -z "${PRINT_PACKAGE_NAME}" ]; then
  39. echo "$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE"
  40. exit 0
  41. fi
  42. TMP=${TMP:-/tmp/SBo}
  43. PKG=$TMP/package-$PRGNAM
  44. OUTPUT=${OUTPUT:-/tmp}
  45. if [ "$ARCH" = "i586" ]; then
  46. SLKCFLAGS="-O2 -march=i586 -mtune=i686"
  47. LIBDIRSUFFIX=""
  48. elif [ "$ARCH" = "i686" ]; then
  49. SLKCFLAGS="-O2 -march=i686 -mtune=i686"
  50. LIBDIRSUFFIX=""
  51. elif [ "$ARCH" = "x86_64" ]; then
  52. SLKCFLAGS="-O2 -fPIC"
  53. LIBDIRSUFFIX="64"
  54. else
  55. SLKCFLAGS="-O2"
  56. LIBDIRSUFFIX=""
  57. fi
  58. DOCS="AUTHORS COPYING INSTALL NEWS README TODO"
  59. set -e
  60. rm -rf $PKG
  61. mkdir -p $TMP $PKG $OUTPUT
  62. cd $TMP
  63. rm -rf $PRGNAM-$SRC_VERSION
  64. tar xvf $CWD/$PRGNAM-$SRC_VERSION.tar.?z*
  65. cd $PRGNAM-$SRC_VERSION
  66. chown -R root:root .
  67. find -L . \
  68. \( -perm 777 -o -perm 775 -o -perm 750 -o -perm 711 -o -perm 555 \
  69. -o -perm 511 \) -exec chmod 755 {} \; -o \
  70. \( -perm 666 -o -perm 664 -o -perm 640 -o -perm 600 -o -perm 444 \
  71. -o -perm 440 -o -perm 400 \) -exec chmod 644 {} \;
  72. meson . build \
  73. --prefix=/usr/ \
  74. --libdir=/usr/lib${LIBDIRSUFFIX} \
  75. -Dsystemd=false \
  76. -Dpam=false \
  77. -Dbuild-id=$ARCH-slackware-linux
  78. CFLAGS="$SLKCFLAGS" \
  79. CXXFLAGS="$SLKCFLAGS" \
  80. "${NINJA:=ninja}" -C build -v
  81. DESTDIR=$PKG $NINJA -C build install
  82. # Don't clobber config files on upgrade
  83. mv $PKG/etc/enlightenment/sysactions.conf $PKG/etc/enlightenment/sysactions.conf.new
  84. mv $PKG/etc/xdg/menus/e-applications.menu $PKG/etc/xdg/menus/e-applications.menu.new
  85. # Handle the xinitrc file
  86. mkdir -p $PKG/etc/X11/xinit
  87. cat $CWD/xinitrc.enlightenment > $PKG/etc/X11/xinit/xinitrc.enlightenment.new
  88. chmod +x $PKG/etc/X11/xinit/xinitrc.enlightenment.new
  89. find $PKG -print0 | xargs -0 file | grep -e "executable" -e "shared object" | grep ELF \
  90. | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null || true
  91. mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
  92. cp -a $DOCS $PKG/usr/doc/$PRGNAM-$VERSION
  93. cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild
  94. mkdir -p $PKG/install
  95. cat $CWD/slack-desc > $PKG/install/slack-desc
  96. cat $CWD/doinst.sh > $PKG/install/doinst.sh
  97. cd $PKG
  98. /sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE