# Template file for 'xscreensaver'
pkgname=xscreensaver
version=5.44
revision=1
build_style=gnu-configure
configure_args="--with-pam --with-login-manager
 --with-x-app-defaults=/usr/share/X11/app-defaults
 --includedir=${XBPS_CROSS_BASE}/include
 --libdir=${XBPS_CROSS_BASE}/lib"
conf_files="/etc/pam.d/xscreensaver"
hostmakedepends="bc intltool pkg-config"
makedepends="glu-devel libXinerama-devel libXmu-devel libXpm-devel
 libXrandr-devel libglade-devel pam-devel"
short_desc="Screen saver and locker for the X Window System"
maintainer="Leah Neukirchen <leah@vuxu.org>"
license="MIT"
homepage="https://www.jwz.org/xscreensaver/"
changelog="https://www.jwz.org/xscreensaver/changelog.html"
distfiles="https://www.jwz.org/xscreensaver/xscreensaver-${version}.tar.gz"
checksum=73d8089cfc7d7363b5dac99b5b01dffb3429d0a855e6af16ce9a4b7777017b95

# Liberation
post_patch() {
	# Commands below is collected and modified from:
	# https://git.parabola.nu/abslibre.git/tree/libre/xscreensaver/PKGBUILD
	# Deleting dmsc.asm file due which don't have source code supplied
	rm -v hacks/images/m6502/dmsc.asm
	# Remove BSOD for referneces to non-free (Issue #2391)
	rm -v hacks/bsod*
}

do_install() {
	vmkdir etc/pam.d
	make install_prefix=${DESTDIR} install
	echo "NotShowIn=KDE;GNOME;" >> ${DESTDIR}/usr/share/applications/xscreensaver-properties.desktop
	sed '/^$/q' < driver/xscreensaver.c > LICENSE
	vlicense LICENSE
}
