# POWER Maintainer: Alexander Baldeck <alex.bldck@gmail.com>
# Maintainer: Lukas Fleischer <lfleischer@archlinux.org>
# Maintainer: Robin Candau <antiz@archlinux.org>
# Contributor: Geoffrey Teale <tealeg@stop-squark>
# Contributor: Mark, Huo Mian <markhuomian[at]gmail[dot]com>
# Contributor: Biginoz <biginoz a free dot fr>
# Contributor: Mattias Andrée <`base64 -d`(bWFhbmRyZWUK)@member.fsf.org>

pkgname=redshift
pkgver=1.12
pkgrel=12
pkgdesc='Adjusts the color temperature of your screen according to your surroundings.'
arch=(x86_64 powerpc64le powerpc64 powerpc riscv64)
url='http://jonls.dk/redshift/'
license=('GPL-3.0-only')
depends=('glib2' 'glibc' 'hicolor-icon-theme' 'libdrm' 'libx11' 'libxcb' 'libxxf86vm')
optdepends=('geoclue: for automatic location based on GeoClue2'
            'gtk3: for redshift-gtk'
            'libappindicator-gtk3: for AppIndicator support in redshift-gtk'
            'python-gobject: for redshift-gtk'
            'python-xdg: for redshift-gtk')
makedepends=('intltool' 'python')
source=("${pkgname}-${pkgver}.tar.gz::https://github.com/jonls/redshift/archive/refs/tags/v${pkgver}.tar.gz")
sha256sums=('dd816df79765f87a0838b1568fbc40c3e8bdb4aef0e77712c85623afe34a29ad')

prepare() {
	cd "${pkgname}-${pkgver}"
	sed -i 's|appdatadir = @datadir@/appdata|appdatadir = @datadir@/metainfo|' Makefile.am
	./bootstrap
}

build() {
	cd "${pkgname}-${pkgver}"
	./configure --prefix=/usr --enable-drm --enable-randr --enable-vidmode --enable-geoclue2 \
	--with-systemduserunitdir=/usr/lib/systemd/user
	make
}

package() {
	cd "${pkgname}-${pkgver}"
	make DESTDIR="${pkgdir}" install
}
