linux-libre upgraded to version 4.19.14
[dragora.git] / recipes / devel / tcl / recipe
blob25b87577f3040133698018eff9000795d37e0c7f
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.
17 program=tcl
18 version=8.6.9
19 series_version=8.6
20 release=1
22 # Set 'outdir' for a nice and well-organized output directory
23 outdir="${outdir}/${arch}/devel"
25 tarname=${program}${version}-src.tar.gz
27 # Remote source(s)
28 fetch=http://prdownloads.sourceforge.net/tcl/$tarname
30 homepage=http://www.tcl.tk
32 description="
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:
43 $homepage
46 license=Custom
48 # Source documentation
49 docs="ChangeLog README changes license.terms"
50 docsdir="${docdir}/${program}-${version}"
52 # Custom source directory
53 srcdir=${program}${version}
55 build()
57     set -e
59     unpack "${tardir}/$tarname"
61     cd "$srcdir"
63     # Set sane permissions
64     chmod -R u+w,go-w,a+rX-s .
66     WD="$(pwd)"
68     cd unix
70     # Determine whether to use 64 bit support
71     case $arch in
72     x86_64)
73         bit_flags=--enable-64bit
74         ;;
75     esac
77     ./configure CFLAGS="$QICFLAGS" LDFLAGS="$QILDFLAGS" \
78      $configure_args \
79      --libdir=/usr/lib${libSuffix} \
80      --infodir=$infodir \
81      --mandir=$mandir \
82      --enable-shared \
83      --enable-threads \
84      --enable-man-symlinks \
85      --enable-man-suffix \
86      --without-tzdata \
87      --build="$(cc -dumpmachine)" \
88      $bit_flags
90     unset bit_flags
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
96     tdbc_version=1.1.0
97     itcl_version=4.1.2
99     sed -e "s#${WD}/unix#/usr/lib${libSuffix}#"                                                   \
100         -e "s#${WD}#/usr/include#"                                                                \
101         -i tclConfig.sh
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
116     make -j${jobs} \
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"
127     unset series_version
129     cd ..
131     # Compress info documents deleting index file for the package
132     if test -d "${destdir}/$infodir"
133     then
134         rm -f "${destdir}/${infodir}/dir"
135         lzip -9 "${destdir}/${infodir}"/*
136     fi
138     # Compress and link man pages (if needed)
139     if test -d "${destdir}/$mandir"
140     then
141         (
142             cd "${destdir}/$mandir"
143             find . -type f -exec lzip -9 '{}' +
144             find . -type l | while read -r file
145             do
146                 ln -sf "$(readlink -- "$file").lz" "${file}.lz"
147                 rm -- "$file"
148             done
149         )
150     fi
152     # Copy documentation
153     mkdir -p "${destdir}${docsdir}"
154     cp -p $docs "${destdir}${docsdir}"/