1 # Build recipe for tcl.
3 # Copyright (c) 2018 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.
22 # Set 'outdir' for a nice and well-organized output directory
23 outdir="${outdir}/${arch}/devel"
25 tarname=${program}${version}-src.tar.gz
28 fetch=http://prdownloads.sourceforge.net/tcl/$tarname
30 homepage=http://www.tcl.tk
33 Tool command language.
35 Tcl (Tool Command Language) is a very powerful but easy to learn
36 dynamic programming language, suitable for a very wide range of uses,
37 including web and desktop applications, networking, administration,
38 testing and many more. Open source and business-friendly, Tcl is a
39 mature yet evolving language that is truly cross platform, easily
40 deployed and highly extensible.
42 For more information, visit:
48 # Source documentation
49 docs="ChangeLog README changes license.terms"
50 docsdir="${docdir}/${program}-${version}"
52 # Custom source directory
53 srcdir=${program}${version}
59 unpack "${tardir}/$tarname"
63 # Set sane permissions
64 chmod -R u+w,go-w,a+rX-s .
70 # Determine whether to use 64 bit support
73 bit_flags=--enable-64bit
77 ./configure CFLAGS="$QICFLAGS" LDFLAGS="$QILDFLAGS" \
79 --libdir=/usr/lib${libSuffix} \
84 --enable-man-symlinks \
87 --build="$(cc -dumpmachine)" \
91 make -j${jobs} V=1 TCL_LIBRARY=/usr/lib${libSuffix}/tcl${series_version}
93 # Clean up build-directory references/traces
95 # Current versions provided on this release
99 sed -e "s#${WD}/unix#/usr/lib${libSuffix}#" \
100 -e "s#${WD}#/usr/include#" \
103 sed -e "s#${WD}/unix/pkgs/tdbc${tdbc_version}#/usr/lib${libSuffix}/tdbc${tdbc_version}#" \
104 -e "s#${WD}/pkgs/tdbc${tdbc_version}/generic#/usr/include#" \
105 -e "s#${WD}/pkgs/tdbc${tdbc_version}/library#/usr/lib${libSuffix}/tcl${series_version}#" \
106 -e "s#${WD}/pkgs/tdbc${tdbc_version}#/usr/include#" \
107 -i pkgs/tdbc${tdbc_version}/tdbcConfig.sh
109 sed -e "s#${WD}/unix/pkgs/itcl${itcl_version}#/usr/lib${libSuffix}/itcl${itcl_version}#" \
110 -e "s#${WD}/pkgs/itcl${itcl_version}/generic#/usr/include#" \
111 -e "s#${WD}/pkgs/itcl${itcl_version}#/usr/include#" \
112 -i pkgs/itcl${itcl_version}/itclConfig.sh
114 unset WD tdbc_version itcl_version
117 TCL_LIBRARY=/usr/lib${libSuffix}/tcl${series_version} \
118 DESTDIR="$destdir" install
120 make -j${jobs} INSTALL_ROOT="$destdir" install-private-headers
122 # Make symlinks for compatibility
123 ln -s tclsh${series_version} "${destdir}/usr/bin/tclsh"
124 ln -s libtcl${series_version}.so "${destdir}/usr/lib${libSuffix}/libtcl.so"
125 ln -s libtclstub${series_version}.a "${destdir}/usr/lib${libSuffix}/libtclstub.a"
131 # Compress info documents deleting index file for the package
132 if test -d "${destdir}/$infodir"
134 rm -f "${destdir}/${infodir}/dir"
135 lzip -9 "${destdir}/${infodir}"/*
138 # Compress and link man pages (if needed)
139 if test -d "${destdir}/$mandir"
142 cd "${destdir}/$mandir"
143 find . -type f -exec lzip -9 '{}' +
144 find . -type l | while read -r file
146 ln -sf "$(readlink -- "$file").lz" "${file}.lz"
153 mkdir -p "${destdir}${docsdir}"
154 cp -p $docs "${destdir}${docsdir}"/