aboutsummaryrefslogtreecommitdiffstats
path: root/main/tk/APKBUILD
blob: dd67d15b80a669c25568b19e6c17f7d31c61b665 (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
# Maintainer: Isaac Dunham <ibid.ag@gmail.com>
pkgname=tk
pkgver=8.6.4
pkgrel=0
pkgdesc="GUI toolkit for the Tcl scripting language"
url="http://tcl.sourceforge.net/"
arch="all"
license="TCL"
depends=
depends_dev="tcl-dev libx11-dev libxft-dev fontconfig-dev"
makedepends="$depends_dev libpng-dev"
source="http://downloads.sourceforge.net/sourceforge/tcl/$pkgname$pkgver-src.tar.gz
	"
subpackages="$pkgname-doc $pkgname-dev"

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

prepare() {
	cd "$srcdir"/tk${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 wish${_major} "${pkgdir}"/usr/bin/wish
	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="261754d7dc2a582f00e35547777e1fea  tk8.6.4-src.tar.gz"
sha256sums="08f99df85e5dc9c4271762163c6aabb962c8b297dc5c4c1af8bdd05fc2dd26c1  tk8.6.4-src.tar.gz"
sha512sums="d0a1d1fd0938af4a9e532aa1bd4488647cff05f98e9e09b5fa16b773364a5d61030b7975541c688c7e0afc0bde60d49ce50a24d842549bab1622a0255e267909  tk8.6.4-src.tar.gz"