# Contributor: Sören Tempel <soeren+alpine@soeren-tempel.net>
# Contributor: 7heo <7heo@mail.com>
# Contributor: Steven Guikal <void@fluix.one>
# Maintainer: Steven Guikal <void@fluix.one>
pkgname=redshift
pkgver=1.12
pkgrel=5
pkgdesc="Adjusts the color temperature of your screen according to your surroundings"
url="http://jonls.dk/redshift/"
arch="all"
license="GPL-3.0-or-later"
options="!check"  # No testsuite
makedepends="
	automake autoconf libtool gettext-dev
	intltool
	libdrm-dev
	libxcb-dev
	libxxf86vm-dev
	"
subpackages="$pkgname-doc"
source="https://github.com/jonls/redshift/releases/download/v$pkgver/redshift-$pkgver.tar.xz"

prepare() {
	default_prepare
	update_config_sub
	# update py-compile to python 3.12 compatible
	autoreconf -vif
}

build() {
	./configure \
		--build=$CBUILD \
		--host=$CHOST \
		--prefix=/usr \
		--mandir=/usr/share/man \
		--enable-drm \
		--enable-randr \
		--enable-vidmode \
		--disable-silent-rules \
		--disable-nls \
	make
}

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

	install -Dm644 redshift.conf.sample \
		"$pkgdir"/usr/share/doc/$pkgname/examples/redshift.conf
	install -m644 ABOUT-NLS DESIGN NEWS README README-colorramp \
		"$pkgdir"/usr/share/doc/$pkgname/
}

sha512sums="225e222e5f2c55be4571094ccaf02a92e162dfc35fd0fe504084e21e358b888a72f9992f9f9edaf1d496eb673af74a0d825ae5cf6ef7f0f1ab51d32419722c32  redshift-1.12.tar.xz"
