# Contributor: Grigory Kirillov <txgk@bk.ru>
# Maintainer: mio <miyopan@e.email>
pkgname=xfig
pkgver=3.2.9
pkgrel=1
pkgdesc="Interactive drawing tool which runs under X Window System"
url="https://mcj.sourceforge.net/"
arch="all"
license="Xfig"
makedepends="
	libpng-dev
	libjpeg-turbo-dev
	tiff-dev
	libxaw-dev
	libxaw3d-dev
	libxft-dev
	ghostscript-dev
	sed
	"
subpackages="$pkgname-doc"
source="
	https://downloads.sourceforge.net/mcj/xfig-$pkgver.tar.xz
	COPYING
	"

build() {
	./configure \
		--target="$CTARGET" \
		--build="$CBUILD" \
		--host="$CHOST" \
		--prefix=/usr
	make
}

check() {
	# Muffle third test because it always fails.
	echo 'int main(void){return 0;}' > tests/test3.c

	make check
}

package() {
	make DESTDIR="$pkgdir" install
	install -Dm644 ../COPYING -t "$pkgdir"/usr/share/licenses/"$pkgname"/
}

sha512sums="
c5e797b394740761a24e6e5e83d025dd78a11ad7d12662728c708218d7131d9077d9ed0c09023134ed9d709c58f52f5c9182e5b50e540b1876be4c359d79a60e  xfig-3.2.9.tar.xz
0289c266555028702e15749e557c7f17eaecc908f61458dbcfc118f547dbfb831351ec7cfce290368d343a7d7e9fa6914e81103312d94939938571f2acdc9424  COPYING
"
