recipe 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157
  1. # Build recipe for tcl.
  2. #
  3. # Copyright (c) 2018 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. program=tcl
  17. version=8.6.9
  18. series_version=8.6
  19. release=1
  20. # Set 'outdir' for a nice and well-organized output directory
  21. outdir="${outdir}/${arch}/devel"
  22. tarname=${program}${version}-src.tar.gz
  23. # Remote source(s)
  24. fetch=http://prdownloads.sourceforge.net/tcl/$tarname
  25. homepage=http://www.tcl.tk
  26. description="
  27. Tool command language.
  28. Tcl (Tool Command Language) is a very powerful but easy to learn
  29. dynamic programming language, suitable for a very wide range of uses,
  30. including web and desktop applications, networking, administration,
  31. testing and many more. Open source and business-friendly, Tcl is a
  32. mature yet evolving language that is truly cross platform, easily
  33. deployed and highly extensible.
  34. For more information, visit:
  35. $homepage
  36. "
  37. license=Custom
  38. # Source documentation
  39. docs="ChangeLog README changes license.terms"
  40. docsdir="${docdir}/${program}-${version}"
  41. # Custom source directory
  42. srcdir=${program}${version}
  43. build()
  44. {
  45. set -e
  46. unpack "${tardir}/$tarname"
  47. cd "$srcdir"
  48. # Set sane permissions
  49. chmod -R u+w,go-w,a+rX-s .
  50. WD="$(pwd)"
  51. cd unix
  52. # Determine whether to use 64 bit support
  53. case $arch in
  54. x86_64)
  55. bit_flags=--enable-64bit
  56. ;;
  57. esac
  58. ./configure CFLAGS="$QICFLAGS" LDFLAGS="$QILDFLAGS" \
  59. $configure_args \
  60. --libdir=/usr/lib${libSuffix} \
  61. --infodir=$infodir \
  62. --mandir=$mandir \
  63. --enable-shared \
  64. --enable-threads \
  65. --enable-man-symlinks \
  66. --enable-man-suffix \
  67. --without-tzdata \
  68. --build="$(cc -dumpmachine)" \
  69. $bit_flags
  70. unset bit_flags
  71. make -j${jobs} V=1 TCL_LIBRARY=/usr/lib${libSuffix}/tcl${series_version}
  72. # Clean up build-directory references/traces
  73. # Current versions provided on this release
  74. tdbc_version=1.1.0
  75. itcl_version=4.1.2
  76. sed -e "s#${WD}/unix#/usr/lib${libSuffix}#" \
  77. -e "s#${WD}#/usr/include#" \
  78. -i tclConfig.sh
  79. sed -e "s#${WD}/unix/pkgs/tdbc${tdbc_version}#/usr/lib${libSuffix}/tdbc${tdbc_version}#" \
  80. -e "s#${WD}/pkgs/tdbc${tdbc_version}/generic#/usr/include#" \
  81. -e "s#${WD}/pkgs/tdbc${tdbc_version}/library#/usr/lib${libSuffix}/tcl${series_version}#" \
  82. -e "s#${WD}/pkgs/tdbc${tdbc_version}#/usr/include#" \
  83. -i pkgs/tdbc${tdbc_version}/tdbcConfig.sh
  84. sed -e "s#${WD}/unix/pkgs/itcl${itcl_version}#/usr/lib${libSuffix}/itcl${itcl_version}#" \
  85. -e "s#${WD}/pkgs/itcl${itcl_version}/generic#/usr/include#" \
  86. -e "s#${WD}/pkgs/itcl${itcl_version}#/usr/include#" \
  87. -i pkgs/itcl${itcl_version}/itclConfig.sh
  88. unset WD tdbc_version itcl_version
  89. make -j${jobs} \
  90. TCL_LIBRARY=/usr/lib${libSuffix}/tcl${series_version} \
  91. DESTDIR="$destdir" install
  92. make -j${jobs} INSTALL_ROOT="$destdir" install-private-headers
  93. # Make symlinks for compatibility
  94. ln -s tclsh${series_version} "${destdir}/usr/bin/tclsh"
  95. ln -s libtcl${series_version}.so "${destdir}/usr/lib${libSuffix}/libtcl.so"
  96. ln -s libtclstub${series_version}.a "${destdir}/usr/lib${libSuffix}/libtclstub.a"
  97. unset series_version
  98. cd ..
  99. # Compress info documents deleting index file for the package
  100. if test -d "${destdir}/$infodir"
  101. then
  102. rm -f "${destdir}/${infodir}/dir"
  103. lzip -9 "${destdir}/${infodir}"/*
  104. fi
  105. # Compress and link man pages (if needed)
  106. if test -d "${destdir}/$mandir"
  107. then
  108. (
  109. cd "${destdir}/$mandir"
  110. find . -type f -exec lzip -9 '{}' +
  111. find . -type l | while read -r file
  112. do
  113. ln -sf "$(readlink -- "$file").lz" "${file}.lz"
  114. rm -- "$file"
  115. done
  116. )
  117. fi
  118. # Copy documentation
  119. mkdir -p "${destdir}${docsdir}"
  120. cp -p $docs "${destdir}${docsdir}"/
  121. }