Some SlackBuild scripts for Slackware.
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.

116 lines
3.1 KiB

  1. #!/bin/bash
  2. # Build script for Slackware
  3. # Copyright (C) 2018,2019,2020 Damien Goutte-Gattat
  4. #
  5. # Redistribution and use of this script, with or without modifications,
  6. # is permitted provided that the following conditions are met:
  7. #
  8. # 1. Redistributions of this script must retain the above copyright
  9. # notice, this list of conditions and the following disclaimer.
  10. #
  11. # THIS SOFTWARE IS PROVIDED BY THE AUTHOR AS IS'' AND ANY EXPRESS OR
  12. # IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
  13. # WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
  14. # DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT,
  15. # INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
  16. # (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
  17. # SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
  18. # HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
  19. # STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
  20. # IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
  21. # POSSIBILITY OF SUCH DAMAGE.
  22. #
  23. # Contact: Damien Goutte-Gattat <dgouttegattat@incenp.org>
  24. #
  25. # Latest efl sourcecode is available at:
  26. # <https://www.enlightenment.org/>.
  27. #
  28. # Depends: d/luajit
  29. # Source package infos
  30. NAMESRC=${NAMESRC:-efl}
  31. VERSION=${VERSION:-1.24.3}
  32. ARCHIVE=${ARCHIVE:-$NAMESRC-$VERSION.tar.xz}
  33. WGET=${WGET:-https://download.enlightenment.org/rel/libs/efl/$ARCHIVE}
  34. # Build infos
  35. NAMEPKG=${NAMEPKG:-efl}
  36. BUILD=${BUILD:-1GGD}
  37. ARCH=${ARCH:-$(uname -m | sed 's/^i.86$/i486/;s/^arm.*/arm/')}
  38. JOBS=${JOBS:-1}
  39. EXT=${EXT:-txz}
  40. # Directories
  41. TMP=${TMP:-/tmp}
  42. OUT=${OUT:-$TMP/build}
  43. PKG=${PKG:-$OUT/$NAMEPKG}
  44. CWD=$(pwd)
  45. LIBDIRSUFFIX=
  46. [ x$ARCH = xx86_64 ] && LIBDIRSUFFIX=64
  47. set -e # Quit if a command returns non-zero
  48. # Sanity checks
  49. if [ $UID -eq 0 ]; then
  50. echo "You should NOT run this script as ROOT!"
  51. exit 1
  52. fi
  53. if [ ! -d $TMP ]; then
  54. echo "$TMP does not exists or is not a directory!"
  55. exit 1
  56. fi
  57. # Get and verify the source archive
  58. if [ ! -r $ARCHIVE ]; then
  59. wget -c -O $ARCHIVE.part "$WGET"
  60. mv $ARCHIVE.part $ARCHIVE
  61. fi
  62. sha256sum -c $ARCHIVE.sha256
  63. NAME=$(tar ft $ARCHIVE | head -n 1 | cut -d / -f 1)
  64. # Compile
  65. cd $TMP
  66. echo "Building $ARCHIVE..."
  67. tar xf $CWD/$ARCHIVE
  68. cd $NAME
  69. meson \
  70. --prefix /usr \
  71. --mandir /usr/man \
  72. --strip \
  73. -Dsystemd=false \
  74. -Decore-imf-loaders-disabler=ibus \
  75. -Dphysics=false \
  76. -Dbuild-tests=false \
  77. build .
  78. ninja -C $JOBS -C build
  79. DESTDIR=$PKG ninja -C build install
  80. # Install the documentation
  81. mkdir -p $PKG/usr/doc/$NAME
  82. install -m 644 AUTHORS COMPLIANCE COPYING* ChangeLog NEWS README \
  83. $PKG/usr/doc/$NAME
  84. # Copy slack-desc and doinst.sh files
  85. install -D -m 644 $CWD/slack-desc $PKG/install/slack-desc
  86. install -m 755 $CWD/doinst.sh $PKG/install/doinst.sh
  87. # Add dependency infos
  88. cat <<EOF > $PKG/install/slack-required
  89. luajit
  90. EOF
  91. # Package the tree
  92. cd $PKG
  93. mkdir -p $OUT
  94. PACKAGING="
  95. chown root:root . -R
  96. /sbin/makepkg -l y -c n $OUT/$NAMEPKG-$VERSION-$ARCH-$BUILD.$EXT
  97. rm -rf $PKG
  98. rm -rf $TMP/$NAME
  99. "
  100. if type -p fakeroot ; then
  101. echo "$PACKAGING" | fakeroot
  102. else
  103. su -c "$PACKAGING"
  104. fi