# Contributor: Sören Tempel <soeren+alpine@soeren-tempel.net>
# Contributor: Hinata Yanagi <hinasssan@gmail.com>
# Maintainer: Hinata Yanagi <hinasssan@gmail.com>
pkgname=tcc
pkgver=2017.10.19
_commit=fc0188ffbcf29f856caedee8cef07d88be01e439
pkgrel=0
pkgdesc="Tiny C Compiler"
url="http://repo.or.cz/tinycc.git"
arch="all !ppc64le"
license="LGPL-2.1"
makedepends="texinfo"
options="!check" # test suite currently fails on the server
source="$pkgname-$pkgver.tar.gz::http://repo.or.cz/tinycc.git/snapshot/$_commit.tar.gz"
subpackages="$pkgname-doc"
builddir="$srcdir/tinycc-fc0188f"

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="2a32ec62fce539fb1168a21bd542aa370c7f6a9c7bc490bd9f86bb46b745a3db816c173f739e891631ec0b0ccbd89358226f7d5767ccbc3d7634890f83fbfa68  tcc-2017.10.19.tar.gz"
