pkgname=trinity-static-x86_64
pkgver=git
pkgrel=1
arch=('i386' 'x86_64')
url="https://github.com/kernelslacker/trinity"
license=('GPL')
source=("https://github.com/kernelslacker/trinity.git")
md5sums=('SKIP')

build() {
	export CC="gcc -static"
	gcc_major=$($(which gcc) -dumpversion | cut -d. -f1)
	cd "$srcdir/trinity" || return
	./configure || return
	if [[ "$gcc_major" -ge 8 ]]; then
		CFLAGS="-Wno-address-of-packed-member -Werror=format-overflow=0" make
	else
		make
	fi

	make install
}

package() {
	cd "$srcdir/trinity" || return
	benchmark_path="${pkgdir}/lkp/benchmarks/${pkgname}"
	bin_path="${pkgdir}/bin"
	mkdir -p $benchmark_path
	mkdir -p $bin_path
	cp /bin/trinity $bin_path
	INSTALL_PREFIX=$benchmark_path make install
}
