# Maintainer: Steven Guikal <void@fluix.one>
pkgname=powertop
pkgver=2.15
pkgrel=6
pkgdesc="Power consumption monitor"
url="https://github.com/fenrus75/powertop"
arch="all"
license="GPL-2.0-only"
makedepends="
	autoconf
	autoconf-archive
	automake
	gettext-dev
	libnl3-dev
	libtool
	linux-headers
	ncurses-dev
	pciutils-dev
	xz
	zlib-dev
	"
subpackages="
	$pkgname-doc
	$pkgname-bash-completion
	"
source="$pkgname-$pkgver-2.tar.gz::https://github.com/fenrus75/powertop/archive/refs/tags/v$pkgver.tar.gz
	powertop-2.15-gettext.patch
"
options="!check" # no tests

prepare() {
	default_prepare

	autoreconf -fi
	NOCONFIGURE=1 ./autogen.sh
}

build() {
	LIBS="-lintl" \
	./configure \
		--build=$CBUILD \
		--host=$CHOST \
		--prefix=/usr \
		--disable-nls
	make
}

package() {
	make DESTDIR="$pkgdir" install
}

sha512sums="
de4ca3ea25697d2cd5f05c41c82c326ad3e2d21cbf38ddb9b3af40c0d862a70781ca45d9ef7b735ad6def0cb580e4fa153eb4a6e6598e204fc931b30d85ecf41  powertop-2.15-2.tar.gz
4bda5c26692362d30cc7e20ff4c204c18604f9422cda0b3198730272bdc62eb4c6d1e9e15728b7def12df10ed4a1c06be59f07ac80e901e3556f4876dddaffc9  powertop-2.15-gettext.patch
"
