# Maintainer: Timo Teräs <timo.teras@iki.fi>
pkgname=plymouth
pkgver=24.004.60
pkgrel=1
pkgdesc="graphical bootsplash on linux"
url="https://www.freedesktop.org/wiki/Software/Plymouth"
arch="all"
license="GPL-2.0-or-later"
depends_dev="
	eudev-dev
	gtk+3.0-dev
	pango-dev
	"
makedepends="$depends_dev
	libevdev-dev
	meson
	xkeyboard-config-dev
	"
subpackages="
	$pkgname-dev
	$pkgname-doc
	$pkgname-lang
	$pkgname-themes::noarch
	$pkgname-x11:_render
	$pkgname-drm:_render
	"
source="https://www.freedesktop.org/software/plymouth/releases/plymouth-$pkgver.tar.xz
	libintl.patch
	plymouth-rpmatch.patch
	0001-plymouth-disable-execinfo.patch
	"
options="!check" # No tests

build() {
	abuild-meson \
		-Dsystemd-integration=false \
		. output
	meson compile -C output
}

package() {
	DESTDIR="$pkgdir" meson install --no-rebuild -C output

	rm -f "$pkgdir"/usr/lib/plymouth/*.la
}

themes() {
	mkdir -p "$subpkgdir"/usr/share/plymouth/
	mv "$pkgdir"/usr/share/plymouth/themes/ "$subpkgdir"/usr/share/plymouth/
}

_render() {
	local _name=${subpkgname#"$pkgname"-}
	mkdir -p "$subpkgdir"/usr/lib/plymouth/renderers
	mv "$pkgdir"/usr/lib/plymouth/renderers/$_name.so \
		"$subpkgdir"/usr/lib/plymouth/renderers
}

sha512sums="
6c66ae81498afea75a9cc1c19ec82b26210a3bd463f14b8ea7c1cd1e327069ef32f752f4ee5236070825ee42599cf05f14271000523bdbae656a200d2e60d341  plymouth-24.004.60.tar.xz
c500bf429d08a43d32e64a442956425309ef485324ce1912a6ceeb2a41ff0a40f4633dd9a887a98d7a1f927fa0abd3dfafd8f1002614e6c810744c3f5b0630e0  libintl.patch
ec1c32ddf7ee418ef1b5d173040db464193d9bca3fd85d5c3a8d2ee13ba1218947f7c9f39c403d3ccced70be28b2c7328e82dc8f967e9bdeea1651dee4be2dc7  plymouth-rpmatch.patch
9b8856c593a9859a63019d0745334a5497917c10f68b539374be859289c945614e345ee8eba96edf807c8c61a0e8dba838caffd15aef92fa10ac3043c359179a  0001-plymouth-disable-execinfo.patch
"
