This repository has been archived by the owner on Aug 9, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathplan.sh
100 lines (92 loc) · 3.25 KB
/
plan.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
pkg_name=tcl
pkg_origin=core
pkg_version=8.6.11
pkg_maintainer="The Habitat Maintainers <[email protected]>"
pkg_description="Tool Command Language -- A dynamic programming language."
pkg_upstream_url="http://tcl.sourceforge.net/"
pkg_license=('custom')
pkg_source="http://downloads.sourceforge.net/sourceforge/${pkg_name}/${pkg_name}${pkg_version}-src.tar.gz"
pkg_shasum="8c0486668586672c5693d7d95817cb05a18c5ecca2f40e2836b9578064088258"
pkg_dirname="${pkg_name}${pkg_version}"
pkg_deps=(
core/glibc
core/gcc-libs
core/zlib
)
pkg_build_deps=(
core/coreutils
core/diffutils
core/patch
core/make
core/gcc
core/sed
)
pkg_bin_dirs=(bin)
pkg_include_dirs=(include)
pkg_lib_dirs=(lib)
pkg_pconfig_dirs=(lib/pkgconfig)
do_build() {
pushd unix > /dev/null
export LDFLAGS="-lgcc_s ${LDFLAGS}"
./configure \
--prefix="$pkg_prefix" \
--enable-threads \
--enable-64bit
make
# The Tcl package expects that its source tree is preserved so that
# packages depending on it for their compilation can utilize it. These sed
# remove the references to the build directory and replace them with more
# reasonable system-wide locations.
#
# Thanks to: http://www.linuxfromscratch.org/blfs/view/stable/general/tcl.html
# Thanks to: https://projects.archlinux.org/svntogit/packages.git/tree/trunk/PKGBUILD?h=packages/tcl
local srcdir
srcdir=$(abspath ..)
local tdbcver=tdbc1.1.2
local itclver=itcl4.2.1
sed \
-e "s#$srcdir/unix#$pkg_prefix/lib#" \
-e "s#$srcdir#$pkg_prefix/include#" \
-i tclConfig.sh
sed \
-e "s#$srcdir/unix/pkgs/$tdbcver#$pkg_prefix/lib/$tdbcver#" \
-e "s#$srcdir/pkgs/$tdbcver/generic#$pkg_prefix/include#" \
-e "s#$srcdir/pkgs/$tdbcver/library#$pkg_prefix/lib/tcl${pkg_version%.?}#" \
-e "s#$srcdir/pkgs/$tdbcver#$pkg_prefix/include#" \
-i pkgs/$tdbcver/tdbcConfig.sh
sed \
-e "s#$srcdir/unix/pkgs/$itclver#$pkg_prefix/lib/$itclver#" \
-e "s#$srcdir/pkgs/$itclver/generic#$pkg_prefix/include#" \
-e "s#$srcdir/pkgs/$itclver#$pkg_prefix/include#" \
-i pkgs/$itclver/itclConfig.sh
popd > /dev/null
}
do_install() {
pushd unix > /dev/null
make install
make install-private-headers
# Many packages expect a file named tclsh, so create a symlink
ln -sfv "tclsh${pkg_version%.??}" "$pkg_prefix/bin/tclsh"
chmod -v 755 "$pkg_prefix/lib/libtcl${pkg_version%.??}.so"
ln -sfv "libtcl${pkg_version%.??}.so" "$pkg_prefix/lib/libtcl.so"
# Install license file
install -Dm644 ../license.terms "${pkg_prefix}/share/licenses/LICENSE"
popd > /dev/null
}
# ----------------------------------------------------------------------------
# **NOTICE:** What follows are implementation details required for building a
# first-pass, "stage1" toolchain and environment. It is only used when running
# in a "stage1" Studio and can be safely ignored by almost everyone. Having
# said that, it performs a vital bootstrapping process and cannot be removed or
# significantly altered. Thank you!
# ----------------------------------------------------------------------------
if [[ "$STUDIO_TYPE" = "stage1" ]]; then
pkg_build_deps=(
core/gcc
core/coreutils
core/sed
core/diffutils
core/make
core/patch
)
fi