# Contributor: Celeste <cielesti@protonmail.com>
# Maintainer: Celeste <cielesti@protonmail.com>
pkgname=eltclsh
pkgver=1.19
pkgrel=0
pkgdesc="Interactive Tcl shell using libedit"
url="https://homepages.laas.fr/mallet/soft/shell/eltclsh/"
arch="all"
license="BSD-2-Clause"
depends_dev="$pkgname"
makedepends="libedit-dev tcl-dev tk-dev"
subpackages="$pkgname-doc $pkgname-dev $pkgname-tk"
source="https://www.openrobots.org/distfiles/eltclsh/eltclsh-$pkgver.tar.gz"

prepare() {
	default_prepare
	update_config_sub
}

build() {
	./configure \
		--build=$CBUILD \
		--host=$CHOST \
		--prefix=/usr \
		--sysconfdir=/etc \
		--mandir=/usr/share/man \
		--localstatedir=/var
	make
}

check() {
	make check
}

package() {
	make DESTDIR="$pkgdir" install
}

tk() {
	pkgdesc="$pkgdesc (graphical variant)"
	depends="$pkgname=$pkgver-r$pkgrel"

	amove usr/bin/elwish
}

sha512sums="
a83e92dcd9f7c91554264ce0ea1a6c8f98e6d90f6b8a8bf7d98033ddffaea128b52be5ad6943cfb9b48d9d79f8d4b1aea7746544fc68611acb47752b9c9a46bd  eltclsh-1.19.tar.gz
"
