aboutsummaryrefslogtreecommitdiffstats
path: root/main/tcl/APKBUILD
blob: 94f989a10fc7828013237c654f0270574f003ed2 (plain)
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
# Maintainer: Carlo Landmeter <clandmeter@gmail.com>
pkgname=tcl
pkgver=8.6.0
pkgrel=1
pkgdesc="The Tcl scripting language"
url="http://tcl.sourceforge.net/"
arch="all"
license="TCL"
depends=
makedepends=""
source="http://downloads.sourceforge.net/sourceforge/$pkgname/$pkgname$pkgver-src.tar.gz
	tcl-stat64.patch
	"
subpackages="$pkgname-doc $pkgname-dev"

_major=${pkgver%.*}
_builddir="$srcdir"/tcl${pkgver}/unix

prepare() {
	cd "$srcdir"/tcl${pkgver}
	for i in $source; do
		case $i in
		*.patch) msg "$i"; patch -p1 -i "$srcdir"/$i || return 1;;
		esac
	done
}

build() {
	local _64bit="--disable-64bit"
	case "$CARCH" in
		x86_64) _64bit="--enable-64bit";;
	esac
	cd "$_builddir"
	./configure \
		--build=$CBUILD \
		--host=$CHOST \
		--prefix=/usr \
		--mandir=/usr/share/man \
		$_64bit \
		|| return 1
		make || return 1
}

package() {
	cd "$_builddir"
	export LD_LIBRARY_PATH="$_builddir"
	make -j1 INSTALL_ROOT="${pkgdir}" install install-private-headers || return 1

	ln -sf tclsh${_major} "${pkgdir}"/usr/bin/tclsh
	install -Dm644 ../license.terms ${pkgdir}/usr/share/licenses/${pkgname}/LICENSE
	# remove buildroot traces
	find "$pkgdir" -name '*Config.sh' | xargs sed -i -e "s#${srcdir}#/usr/src#"
}

dev() {
	default_dev
	cd $pkgdir
	for i in $(find . -name '*.c' -o -name '*Config.sh'); do
		mkdir -p "$subpkgdir"/${i%/*}
		mv $i "$subpkgdir"/${i%/*}/ || return 1
	done
}

md5sums="573aa5fe678e9185ef2b3c56b24658d3  tcl8.6.0-src.tar.gz
5828445dcdebfbc761caecadf624bf1a  tcl-stat64.patch"
sha256sums="354422b9c4791685499123b2dfe01faa98b555c08906c010cb4449ddc75dcade  tcl8.6.0-src.tar.gz
ce1b6f1eab4445337c82d4c56f8d4483e312d7f65769b5e8cd7a72fdc2ac5ff5  tcl-stat64.patch"
sha512sums="ea64d2bb5b37b55bc424c759c67b5624e7d9a13b8bede744fd635cf668ff9e4a8681e41d94849f6c0a3564ee177268cbc3e5f287448b5a93179098d678e321f8  tcl8.6.0-src.tar.gz
cd52cbe80fd2be227c9018dbe38fa0888302293402e7a57f2e231c195b7c1902f1b58bc87d19c9d123915ca757e871abf084c0ef23b1a7f187bc03ba93904cc2  tcl-stat64.patch"