# Contributor: Sören Tempel <soeren+alpine@soeren-tempel.net>
# Contributor: Hinata Yanagi <hinasssan@gmail.com>
# Maintainer: Hinata Yanagi <hinasssan@gmail.com>
pkgname=tcc
pkgver=0.9.27
pkgrel=1
pkgdesc="Tiny C Compiler"
url="http://download.savannah.nongnu.org/releases/tinycc"
arch="all !ppc64le !s390x"
license="LGPL-2.1"
makedepends="texinfo"
options="!check" # test suite currently fails on the server
source="http://download.savannah.nongnu.org/releases/tinycc/${pkgname}-${pkgver}.tar.bz2"
subpackages="$pkgname-doc"
builddir="$srcdir/tcc-${pkgver}"

build() {
	./configure \
		--prefix=/usr \
		--config-musl
	make
}

check() {
	cd "$builddir"
	make test
}

package() {
	cd "$builddir"
	make DESTDIR="$pkgdir" install

	mkdir -p "$pkgdir"/usr/share/doc/$pkgname/
	install -m644 Changelog CodingStyle README TODO \
		"$pkgdir"/usr/share/doc/$pkgname/
}

sha512sums="835184292d97c07f0ff7b36ec550e855e649b04e23c7e2a1c706d223409eb60708dc1ae969f28eba45e56c8b96ae56936b93caf9d8a13ac5adf119014d5367a7  tcc-0.9.27.tar.bz2"
