aboutsummaryrefslogtreecommitdiffstats
path: root/main/tcl/APKBUILD
blob: 7418c6c2c1b95e77c21394c769042786db2c34f4 (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
70
71
72
73
74
75
76
77
78
79
# Contributor: Sören Tempel <soeren+alpine@soeren-tempel.net>
# Maintainer: Carlo Landmeter <clandmeter@alpinelinux.org>
pkgname=tcl
pkgver=8.6.12
_major=${pkgver%.*}
pkgrel=1
pkgdesc="The Tcl scripting language"
url="https://www.tcl-lang.org/"
arch="all"
license="TCL"
depends="tzdata"
depends_dev="tcl"
makedepends="zlib-dev sqlite-dev"
subpackages="$pkgname-doc $pkgname-dev"
source="https://downloads.sourceforge.net/sourceforge/tcl/tcl$pkgver-src.tar.gz
	tcl-stat64.patch
	restore-fp-control-word.patch
	"
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 ;;
		esac
	done
	rm -r pkgs/sqlite3*
}

build() {
	local _64bit="--disable-64bit"
	case "$CARCH" in
		x86_64) _64bit="--enable-64bit";;
	esac
	./configure \
		--build=$CBUILD \
		--host=$CHOST \
		--prefix=/usr \
		--sysconfdir=/etc \
		--mandir=/usr/share/man \
		--localstatedir=/var \
		--with-system-sqlite \
		$_64bit
	make
}

package() {
	export LD_LIBRARY_PATH="$_builddir"
	make INSTALL_ROOT="$pkgdir" install install-private-headers

	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#"
}

check() {
	# thread-4.5 and thread-5* is suppressed because it tests UB
	# http* is suppressed because it tries to do network i/o
	# unixInit-3* is suppressed due to hardcoded locale assumptions
	make test TESTFLAGS="-verbose pbtels -skip 'thread-4.5 thread-5* http* unixInit-3*'"
}

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

sha512sums="
15def824484309fff6831b436e33d91ab1c6b095178f427d1f58b9a04e5e676b18dfdf1d225c6ab9ec15dc233358c40789edc7daf91c5908a1837e9f337feb60  tcl8.6.12-src.tar.gz
cd52cbe80fd2be227c9018dbe38fa0888302293402e7a57f2e231c195b7c1902f1b58bc87d19c9d123915ca757e871abf084c0ef23b1a7f187bc03ba93904cc2  tcl-stat64.patch
98b8872431f08036a9a6f00b6f6d158af5b725b149701537612d1dd0818a3189dad678dfba65267da1d512236bff2550e575b11b76503ae83b9607352174e6dd  restore-fp-control-word.patch
"