# Maintainer: Natanael Copa pkgname=tk pkgver=8.6.13 _major=${pkgver%.*} pkgrel=2 pkgdesc="GUI toolkit for the Tcl scripting language" url="https://tcl.sourceforge.net/" arch="all" options="!check" # Requires a running X11 server. license="TCL" depends_dev="tcl-dev libx11-dev libxft-dev fontconfig-dev" makedepends="$depends_dev libpng-dev" subpackages="$pkgname-doc $pkgname-dev" source="https://downloads.sourceforge.net/sourceforge/tcl/tk$pkgver-src.tar.gz " builddir="$srcdir"/tk$pkgver/unix build() { local _64bit="--disable-64bit" case "$CARCH" in x86_64) _64bit="--enable-64bit";; esac ./configure \ --build=$CBUILD \ --host=$CHOST \ --prefix=/usr \ --mandir=/usr/share/man \ $_64bit make } package() { export LD_LIBRARY_PATH="$builddir" make INSTALL_ROOT="$pkgdir" install install-private-headers 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' -print0 | xargs -0 sed -i -e "s#${srcdir}#/usr/src#" # move demos to -doc directory mkdir -p "$pkgdir"/usr/share/doc/$pkgname/examples/ mv "$pkgdir"/usr/lib/tk$_major/demos/ \ "$pkgdir"/usr/share/doc/$pkgname/examples/ } dev() { # libtk8.6.so is the only library made and it remains in the mainpackage # so depending on the main package automatically is never done # https://gitlab.alpinelinux.org/alpine/aports/issues/11232#note_68789 depends_dev="$depends_dev tk=$pkgver-r$pkgrel" 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=" 719aa6776bfdc814f817919a265d3f9d847782c9f0a5fc5c2ab139beeba921e6fde8c66e7e836d78f86f53c98a7df0e587f0b2f4b08cc5ce12eecbb7f1ab71a5 tk8.6.13-src.tar.gz "