# Template file for 'hardinfo'
pkgname=hardinfo
version=0.5.1
revision=14
build_style=configure
configure_args="--prefix=/usr"
hostmakedepends="pkg-config which"
makedepends="gtk+-devel desktop-file-utils"
depends="desktop-file-utils"
short_desc="System information and benchmark tool"
maintainer="Orphaned <orphan@voidlinux.org>"
license="GPL-2.0-or-later"
homepage="https://www.berlios.de/software/hardinfo/"
distfiles="${SOURCEFORGE_SITE}/${pkgname}.berlios/${pkgname}-${version}.tar.bz2"
checksum=a0df6c0d7c92a7d20710b8eb551197398a965aaae053782b89a32a160b731b7a
lib32disabled=yes

post_patch() {
	local _arch
	_arch="${XBPS_TARGET_MACHINE%-*}"
	if [ "$_arch" == aarch64 ]; then
		_arch=armv8
	fi
	vsed -i -e "s|^CC =.*|CC = $CC|" \
		-e "s|^CCSLOW =.*|CCSLOW = $CC -O0|" \
		-e "s|-o hardinfo|$LDFLAGS &|" \
		-e '1i GTK_LIBS += -lgmodule-2.0 -lm' \
		Makefile.in
	vsed -i -e "s|^LIBDIR=.*|LIBDIR=/usr/lib${XBPS_TARGET_WORDSIZE}|" \
		-e "s|^PROC=.*|PROC=$_arch|" \
		configure
	vsed -i "s/\"lib\"/\"lib${XBPS_TARGET_WORDSIZE}\"/" binreloc.c
	vsed -i '/distro_db/a { "/etc/hardinfo.distro", "Void" },' \
		computer.h
}

post_install() {
	vmkdir etc
	echo "Void Linux" > ${DESTDIR}/etc/hardinfo.distro
}
