kde-gtk-config.SlackBuild 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105
  1. #!/bin/sh
  2. # Slackware build script for kde-gtk-config
  3. # Copyright 2017 Daniel Prosser | Lexington Park, MD
  4. # All rights reserved.
  5. #
  6. # Originally by Luis Henrique <lmello.009@gmail.com>
  7. # and Ryan P.C. McQuen <ryanpcmcquen@member.fsf.org>
  8. # This program is free software: you can redistribute it and/or modify
  9. # it under the terms of the GNU General Public License as published by
  10. # the Free Software Foundation; either version 2 of the License, or
  11. # (at your option) any later version, with the following exception:
  12. # the text of the GPL license may be omitted.
  13. # This program is distributed in the hope that it will be useful, but
  14. # without any warranty; without even the implied warranty of
  15. # merchantability or fitness for a particular purpose. Compiling,
  16. # interpreting, executing or merely reading the text of the program
  17. # may result in lapses of consciousness and/or very being, up to and
  18. # including the end of all existence and the Universe as we know it.
  19. # See the GNU General Public License for more details.
  20. # You may have received a copy of the GNU General Public License along
  21. # with this program (most likely, a file named COPYING). If not, see
  22. # <http://www.gnu.org/licenses/>.
  23. PRGNAM=kde-gtk-config
  24. VERSION=${VERSION:-2.2_git}
  25. BUILD=${BUILD:-1}
  26. TAG=${TAG:-_SBo}
  27. if [ -z "$ARCH" ]; then
  28. case "$( uname -m )" in
  29. i?86) ARCH=i586 ;;
  30. arm*) ARCH=arm ;;
  31. *) ARCH=$( uname -m ) ;;
  32. esac
  33. fi
  34. CWD=$(pwd)
  35. TMP=${TMP:-/tmp/SBo}
  36. PKG=$TMP/package-$PRGNAM
  37. OUTPUT=${OUTPUT:-/tmp}
  38. if [ "$ARCH" = "i586" ]; then
  39. SLKCFLAGS="-O2 -march=i586 -mtune=i686"
  40. LIBDIRSUFFIX=""
  41. elif [ "$ARCH" = "i686" ]; then
  42. SLKCFLAGS="-O2 -march=i686 -mtune=i686"
  43. LIBDIRSUFFIX=""
  44. elif [ "$ARCH" = "x86_64" ]; then
  45. SLKCFLAGS="-O2 -fPIC"
  46. LIBDIRSUFFIX="64"
  47. else
  48. SLKCFLAGS="-O2"
  49. LIBDIRSUFFIX=""
  50. fi
  51. set -e
  52. rm -rf $PKG
  53. mkdir -p $TMP $PKG $OUTPUT
  54. cd $TMP
  55. rm -rf $PRGNAM
  56. tar xvf $CWD/$PRGNAM-$VERSION.tar.gz
  57. cd $PRGNAM
  58. chown -R root:root .
  59. find -L . \
  60. \( -perm 777 -o -perm 775 -o -perm 750 -o -perm 711 -o -perm 555 \
  61. -o -perm 511 \) -exec chmod 755 {} \; -o \
  62. \( -perm 666 -o -perm 664 -o -perm 640 -o -perm 600 -o -perm 444 \
  63. -o -perm 440 -o -perm 400 \) -exec chmod 644 {} \;
  64. # Patch some errors in cmake files to fix gtk_preview and gtk3_preview
  65. patch -p1 < $CWD/gtkproxies.diff
  66. patch -p1 < $CWD/gtk3proxies.diff
  67. mkdir -p build
  68. cd build
  69. cmake \
  70. -DCMAKE_C_FLAGS:STRING="$SLKCFLAGS" \
  71. -DCMAKE_CXX_FLAGS:STRING="$SLKCFLAGS" \
  72. -DCMAKE_INSTALL_PREFIX=/usr \
  73. -DLIB_SUFFIX=${LIBDIRSUFFIX} \
  74. -DCMAKE_BUILD_TYPE=Release ..
  75. make
  76. make install DESTDIR=$PKG
  77. cd ..
  78. find $PKG -print0 | xargs -0 file | grep -e "executable" -e "shared object" | grep ELF \
  79. | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null || true
  80. mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
  81. cp -a ChangeLog COPYING README $PKG/usr/doc/$PRGNAM-$VERSION
  82. cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild
  83. mkdir -p $PKG/install
  84. cat $CWD/slack-desc > $PKG/install/slack-desc
  85. cat $CWD/doinst.sh > $PKG/install/doinst.sh
  86. cd $PKG
  87. /sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.${PKGTYPE:-tgz}