recipe 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154
  1. # Build recipe for tcl.
  2. #
  3. # Copyright (c) 2018, 2020-2022 Matias Fonzo, <selk@dragora.org>.
  4. #
  5. # Licensed under the Apache License, Version 2.0 (the "License");
  6. # you may not use this file except in compliance with the License.
  7. # You may obtain a copy of the License at
  8. #
  9. # http://www.apache.org/licenses/LICENSE-2.0
  10. #
  11. # Unless required by applicable law or agreed to in writing, software
  12. # distributed under the License is distributed on an "AS IS" BASIS,
  13. # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  14. # See the License for the specific language governing permissions and
  15. # limitations under the License.
  16. # Exit immediately on any error
  17. set -e
  18. program=tcl
  19. version=8.6.13
  20. series_version="${version%.*}"
  21. release=1
  22. # Define a category for the output of the package name
  23. pkgcategory=devel
  24. tarname=${program}${version}-src.tar.gz
  25. # Remote source(s)
  26. fetch=https://prdownloads.sourceforge.net/tcl/$tarname
  27. homepage=https://www.tcl.tk
  28. description="
  29. Tool command language.
  30. Tcl (Tool Command Language) is a very powerful but easy to learn
  31. dynamic programming language, suitable for a very wide range of uses,
  32. including web and desktop applications, networking, administration,
  33. testing and many more. Open source and business-friendly, Tcl is a
  34. mature yet evolving language that is truly cross platform, easily
  35. deployed and highly extensible.
  36. For more information, visit:
  37. $homepage
  38. "
  39. license=Custom
  40. # Source documentation
  41. docs="ChangeLog README.md changes license.terms"
  42. docsdir="${docdir}/${program}-${version}"
  43. # Custom source directory
  44. srcdir=${program}${version}
  45. build()
  46. {
  47. unpack "${tardir}/$tarname"
  48. cd "$srcdir"
  49. # Set sane permissions
  50. chmod -R u+w,go-w,a+rX-s .
  51. WD="$(pwd)"
  52. # Determine whether to use 64 bit support
  53. case $arch in
  54. amd64 | x32 )
  55. bit_flags=--enable-64bit
  56. ;;
  57. esac
  58. cd unix
  59. ./configure CPPFLAGS="$QICPPFLAGS" CFLAGS="$QICFLAGS" \
  60. LDFLAGS="$QILDFLAGS" \
  61. $configure_args \
  62. --libdir=/usr/lib${libSuffix} \
  63. --infodir=$infodir \
  64. --mandir=$mandir \
  65. --enable-shared \
  66. --enable-threads \
  67. --enable-man-symlinks \
  68. --without-tzdata \
  69. --build="$(gcc -dumpmachine)" \
  70. $bit_flags
  71. unset -v bit_flags
  72. make -j${jobs} V=1
  73. # Current versions provided on this release
  74. itcl_version=4.2.3
  75. tdbc_version=1.1.5
  76. # Fix header and library paths
  77. sed -e "s@^\(TCL_SRC_DIR='\).*@\1/usr/include'@" \
  78. -e "/TCL_B/s@='\(-L\)\?.*unix@='\1/usr/lib${libSuffix}@" \
  79. -i tclConfig.sh
  80. sed -e "s#${WD}/unix/pkgs/itcl${itcl_version}#/usr/lib${libSuffix}/itcl${itcl_version}#" \
  81. -e "s#${WD}/pkgs/itcl${itcl_version}/generic#/usr/include#" \
  82. -e "s#${WD}/pkgs/itcl${itcl_version}#/usr/include#" \
  83. -i pkgs/itcl${itcl_version}/itclConfig.sh
  84. sed -e "s#${WD}/unix/pkgs/tdbc${tdbc_version}#/usr/lib${libSuffix}/tdbc${tdbc_version}#" \
  85. -e "s#${WD}/pkgs/tdbc${tdbc_version}/generic#/usr/include#" \
  86. -e "s#${WD}/pkgs/tdbc${tdbc_version}/library#/usr/lib${libSuffix}/tcl${series_version}#" \
  87. -e "s#${WD}/pkgs/tdbc${tdbc_version}#/usr/include#" \
  88. -i pkgs/tdbc${tdbc_version}/tdbcConfig.sh
  89. unset -v WD tdbc_version itcl_version
  90. make -j${jobs} DESTDIR="$destdir" install
  91. make -j${jobs} INSTALL_ROOT="$destdir" install-private-headers
  92. # Make symlink(s) for compatibility
  93. ln -s tclsh${series_version} "${destdir}/usr/bin/tclsh"
  94. ln -s libtcl${series_version}.so "${destdir}/usr/lib${libSuffix}/libtcl.so"
  95. ln -s libtclstub${series_version}.a "${destdir}/usr/lib${libSuffix}/libtclstub.a"
  96. unset -v series_version
  97. cd ..
  98. # Compress info documents deleting index file for the package
  99. if test -d "${destdir}/$infodir"
  100. then
  101. rm -f "${destdir}/${infodir}/dir"
  102. lzip -9 "${destdir}/${infodir}"/*
  103. fi
  104. # Compress and link man pages (if needed)
  105. if test -d "${destdir}/$mandir"
  106. then
  107. (
  108. cd "${destdir}/$mandir"
  109. find . -type f -exec lzip --force -9 {} +
  110. find . -type l | while read -r file
  111. do
  112. ln -sf "$(readlink -- "$file").lz" "${file}.lz"
  113. rm -- "$file"
  114. done
  115. )
  116. fi
  117. # Copy documentation
  118. mkdir -p "${destdir}/$docsdir"
  119. cp -p $docs "${destdir}/$docsdir"
  120. }