1 # Build recipe for tcl.
3 # Copyright (c) 2018, 2020-2022 Matias Fonzo, <selk@dragora.org>.
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
9 # http://www.apache.org/licenses/LICENSE-2.0
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.
17 # Exit immediately on any error
22 series_version="${version%.*}"
25 # Define a category for the output of the package name
28 tarname=${program}${version}-src.tar.gz
31 fetch=https://prdownloads.sourceforge.net/tcl/$tarname
33 homepage=https://www.tcl.tk
36 Tool command language.
38 Tcl (Tool Command Language) is a very powerful but easy to learn
39 dynamic programming language, suitable for a very wide range of uses,
40 including web and desktop applications, networking, administration,
41 testing and many more. Open source and business-friendly, Tcl is a
42 mature yet evolving language that is truly cross platform, easily
43 deployed and highly extensible.
45 For more information, visit:
51 # Source documentation
52 docs="ChangeLog README.md changes license.terms"
53 docsdir="${docdir}/${program}-${version}"
55 # Custom source directory
56 srcdir=${program}${version}
60 unpack "${tardir}/$tarname"
64 # Set sane permissions
65 chmod -R u+w,go-w,a+rX-s .
69 # Determine whether to use 64 bit support
72 bit_flags=--enable-64bit
78 ./configure CPPFLAGS="$QICPPFLAGS" CFLAGS="$QICFLAGS" \
79 LDFLAGS="$QILDFLAGS" \
81 --libdir=/usr/lib${libSuffix} \
86 --enable-man-symlinks \
88 --build="$(gcc -dumpmachine)" \
94 # Current versions provided on this release
98 # Fix header and library paths
99 sed -e "s@^\(TCL_SRC_DIR='\).*@\1/usr/include'@" \
100 -e "/TCL_B/s@='\(-L\)\?.*unix@='\1/usr/lib${libSuffix}@" \
103 sed -e "s#${WD}/unix/pkgs/itcl${itcl_version}#/usr/lib${libSuffix}/itcl${itcl_version}#" \
104 -e "s#${WD}/pkgs/itcl${itcl_version}/generic#/usr/include#" \
105 -e "s#${WD}/pkgs/itcl${itcl_version}#/usr/include#" \
106 -i pkgs/itcl${itcl_version}/itclConfig.sh
108 sed -e "s#${WD}/unix/pkgs/tdbc${tdbc_version}#/usr/lib${libSuffix}/tdbc${tdbc_version}#" \
109 -e "s#${WD}/pkgs/tdbc${tdbc_version}/generic#/usr/include#" \
110 -e "s#${WD}/pkgs/tdbc${tdbc_version}/library#/usr/lib${libSuffix}/tcl${series_version}#" \
111 -e "s#${WD}/pkgs/tdbc${tdbc_version}#/usr/include#" \
112 -i pkgs/tdbc${tdbc_version}/tdbcConfig.sh
114 unset -v WD tdbc_version itcl_version
116 make -j${jobs} DESTDIR="$destdir" install
117 make -j${jobs} INSTALL_ROOT="$destdir" install-private-headers
119 # Make symlink(s) for compatibility
120 ln -s tclsh${series_version} "${destdir}/usr/bin/tclsh"
121 ln -s libtcl${series_version}.so "${destdir}/usr/lib${libSuffix}/libtcl.so"
122 ln -s libtclstub${series_version}.a "${destdir}/usr/lib${libSuffix}/libtclstub.a"
124 unset -v series_version
128 # Compress info documents deleting index file for the package
129 if test -d "${destdir}/$infodir"
131 rm -f "${destdir}/${infodir}/dir"
132 lzip -9 "${destdir}/${infodir}"/*
135 # Compress and link man pages (if needed)
136 if test -d "${destdir}/$mandir"
139 cd "${destdir}/$mandir"
140 find . -type f -exec lzip -9 {} +
141 find . -type l | while read -r file
143 ln -sf "$(readlink -- "$file").lz" "${file}.lz"
150 mkdir -p "${destdir}${docsdir}"
151 cp -p $docs "${destdir}${docsdir}"