tclblt.SlackBuild 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155
  1. #!/bin/bash
  2. # Slackware build script for tclblt
  3. # Copyright 2019 Andrey Lipaev Moscow
  4. # All rights reserved.
  5. #
  6. # Redistribution and use of this script, with or without modification, is
  7. # permitted provided that the following conditions are met:
  8. #
  9. # 1. Redistributions of this script must retain the above copyright
  10. # notice, this list of conditions and the following disclaimer.
  11. #
  12. # THIS SOFTWARE IS PROVIDED BY THE AUTHOR "AS IS" AND ANY EXPRESS OR IMPLIED
  13. # WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
  14. # MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
  15. # EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
  16. # SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
  17. # PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
  18. # OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
  19. # WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
  20. # OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
  21. # ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  22. # 20220222 bkw: Modified by SlackBuilds.org, BUILD=2:
  23. # - add -j1 to make commands (parallel builds fail).
  24. # - do not install libraries to /usr/lib on x86_64.
  25. cd $(dirname $0) ; CWD=$(pwd)
  26. PRGNAM=tclblt
  27. VERSION=${VERSION:-2.5.3}
  28. BUILD=${BUILD:-2}
  29. TAG=${TAG:-_SBo}
  30. PKGTYPE=${PKGTYPE:-tgz}
  31. SRC="blt-src-2.5.3.zip"
  32. SRC_HOME="blt2.5"
  33. if [ -z "$ARCH" ]; then
  34. case "$( uname -m )" in
  35. i?86) ARCH=i586 ;;
  36. arm*) ARCH=arm ;;
  37. *) ARCH=$( uname -m ) ;;
  38. esac
  39. fi
  40. if [ ! -z "${PRINT_PACKAGE_NAME}" ]; then
  41. echo "$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE"
  42. exit 0
  43. fi
  44. TMP=${TMP:-/tmp/SBo}
  45. PKG=$TMP/package-$PRGNAM
  46. OUTPUT=${OUTPUT:-/tmp}
  47. if [ "$ARCH" = "i586" ]; then
  48. SLKCFLAGS="-O2 -march=i586 -mtune=i686"
  49. LIBDIRSUFFIX=""
  50. elif [ "$ARCH" = "i686" ]; then
  51. SLKCFLAGS="-O2 -march=i686 -mtune=i686"
  52. LIBDIRSUFFIX=""
  53. elif [ "$ARCH" = "x86_64" ]; then
  54. SLKCFLAGS="-O2 -fPIC"
  55. LIBDIRSUFFIX="64"
  56. else
  57. SLKCFLAGS="-O2"
  58. LIBDIRSUFFIX=""
  59. fi
  60. set -e
  61. rm -rf $PKG
  62. mkdir -p $TMP $PKG $OUTPUT
  63. cd $TMP
  64. rm -rf $SRC_HOME
  65. unzip $CWD/$SRC
  66. cd $SRC_HOME
  67. chown -R root:root .
  68. find -L . \
  69. \( -perm 777 -o -perm 775 -o -perm 750 -o -perm 711 -o -perm 555 \
  70. -o -perm 511 \) -exec chmod 755 {} \+ -o \
  71. \( -perm 666 -o -perm 664 -o -perm 640 -o -perm 600 -o -perm 444 \
  72. -o -perm 440 -o -perm 400 \) -exec chmod 644 {} \+
  73. #Here we will apply the patches from Debian project
  74. rm -rv library/dd_protocols && patch -p1 < $CWD/patches/source.patch && sed -i -e 's/\$$(ddFiles)//' library/Makefile.in
  75. PATCHLIST=" 02-debian-all.patch \
  76. 03-fedora-patch-2.patch \
  77. 04-fedora-tk8.5.6.patch \
  78. 05-tk8.5-zoomstack.patch \
  79. doc-typos.patch \
  80. tcl8.6.patch \
  81. tk8.6.patch \
  82. install.patch \
  83. usetclint.patch \
  84. table.patch \
  85. ldflags.patch \
  86. pkgindex.patch \
  87. decls.patch \
  88. bltnsutil.patch \
  89. blthash.patch \
  90. const.patch \
  91. uninitialized.patch \
  92. unused.patch \
  93. pointertoint.patch \
  94. autoreconf.patch \
  95. switch.patch"
  96. # usetkint.patch \
  97. for PATCH in $PATCHLIST ; do echo $CWD/patches/$PATCH ; patch -p1 < $CWD/patches/$PATCH ; done
  98. CFLAGS="$SLKCFLAGS" \
  99. CXXFLAGS="$SLKCFLAGS" \
  100. ./configure \
  101. --prefix=/usr \
  102. --libdir=/usr/lib${LIBDIRSUFFIX} \
  103. --sysconfdir=/etc \
  104. --localstatedir=/var \
  105. --mandir=/usr/man \
  106. --build=$ARCH-slackware-linux \
  107. --with-tcl=/usr/lib${LIBDIRSUFFIX} \
  108. --with-blt=/usr/lib${LIBDIRSUFFIX} \
  109. --with-tcllibs=/usr/lib${LIBDIRSUFFIX}
  110. make -j1
  111. make -j1 install INSTALL_ROOT=$PKG
  112. gzip -9 $PKG/usr/man/man*/*
  113. # 20220225 bkw: configure doesn't respect --disable-static, for now
  114. # just leave the static libs.
  115. # 20220225 bkw: documentation getting installed in /usr/lib
  116. PKGDOC=$PKG/usr/doc/$PRGNAM-$VERSION
  117. mkdir -p $PKGDOC
  118. mv $PKG/usr/lib/blt*/{NEWS,PROBLEMS,README,demos} $PKGDOC
  119. # 20220225 bkw: --libdir not fully respected
  120. if [ -n "$LIBDIRSUFFIX" ]; then
  121. mv $PKG/usr/lib/*.{so,a} $PKG/usr/lib$LIBDIRSUFFIX
  122. rm -rf $PKG/usr/lib
  123. fi
  124. strip $PKG/usr/bin/* $PKG/usr/lib$LIBDIRSUFFIX/*.so
  125. cp -a html $PKGDOC
  126. cp -a examples $PKGDOC
  127. cat $CWD/$PRGNAM.SlackBuild > $PKGDOC/$PRGNAM.SlackBuild
  128. find $PKGDOC -type f -exec chmod 644 {} \+
  129. mkdir -p $PKG/install
  130. cat $CWD/slack-desc > $PKG/install/slack-desc
  131. cd $PKG
  132. /sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE