1 # Build recipe for tk (Tcl/Tk).
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
35 The tk package contains the TCL GUI ToolKit.
37 For more information, visit:
43 # Source documentation
44 docs="ChangeLog README changes license.terms"
45 docsdir="${docdir}/${program}-${version}"
47 # Custom source directory
48 srcdir=${program}8.6.9
54 unpack "${tardir}/$tarname"
58 # Set sane permissions
59 chmod -R u+w,go-w,a+rX-s .
63 # Determine whether to use 64 bit support
66 bit_flags=--enable-64bit
70 ./configure CFLAGS="$QICFLAGS" LDFLAGS="$QILDFLAGS" \
72 --libdir=/usr/lib${libSuffix} \
77 --enable-man-symlinks \
80 --build="$(cc -dumpmachine)" \
84 make -j${jobs} V=1 TK_LIBRARY=/usr/lib${libSuffix}/tcl${series_version}
86 # Clean up build-directory references/traces
88 # Thanks to "Beyond of Linux From Scratch"
89 sed -e "s@^\(TK_SRC_DIR='\).*@\1/usr/include'@" \
90 -e "/TK_B/s@='\(-L\)\?.*unix@='\1/usr/lib${libSuffix}@" \
94 TK_LIBRARY=/usr/lib${libSuffix}/tcl${series_version} \
95 DESTDIR="$destdir" install
97 make -j${jobs} INSTALL_ROOT="$destdir" install-private-headers
99 # Make symlinks for compatibility
100 ln -s wish${series_version} "${destdir}/usr/bin/wish"
101 ln -s libtk${series_version}.so "${destdir}/usr/lib${libSuffix}/libtk.so"
102 ln -s libtkstub${series_version}.a "${destdir}/usr/lib${libSuffix}/libtkstub.a"
108 # Compress info documents deleting index file for the package
109 if test -d "${destdir}/$infodir"
111 rm -f "${destdir}/${infodir}/dir"
112 lzip -9 "${destdir}/${infodir}"/*
115 # Compress and link man pages (if needed)
116 if test -d "${destdir}/$mandir"
119 cd "${destdir}/$mandir"
120 find . -type f -exec lzip -9 '{}' +
121 find . -type l | while read -r file
123 ln -sf "$(readlink -- "$file").lz" "${file}.lz"
130 mkdir -p "${destdir}${docsdir}"
131 cp -p $docs "${destdir}${docsdir}"/