aboutsummaryrefslogtreecommitdiffstats
path: root/community/xscreensaver/APKBUILD
blob: d00e38988a1a58c039f5b3cd79a3562f1b56c5c7 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
# Contributor: prspkt <prspkt@protonmail.com>
# Maintainer: prspkt <prspkt@protonmail.com>
pkgname=xscreensaver
pkgver=6.03
pkgrel=1
pkgdesc="Screensavers for X11 environment"
url="https://www.jwz.org/xscreensaver/"
arch="all"
license="GPL-2.0-or-later GPL-3.0-or-later 0BSD MIT"
depends="bc"
options="suid"
makedepends="gtk+2.0-dev libjpeg-turbo-dev mesa-dev gettext-dev libxmu-dev perl
	libxml2-dev libxi-dev libxinerama-dev libxrandr-dev glu-dev gdk-pixbuf-xlib-dev
	"
subpackages="$pkgname-doc $pkgname-gl-extras:gl $pkgname-extras"
source="https://www.jwz.org/xscreensaver/xscreensaver-$pkgver.tar.gz"

_libexecdir=/usr/libexec/xscreensaver
_confdir=/usr/share/xscreensaver/config

# secfixes:
#   6.02-r0:
#     - CVE-2021-34557

build() {
	# https://bugs.gentoo.org/830914
	[ "$CARCH" = "aarch64" ] && export CFLAGS="$CFLAGS -flax-vector-conversions"

	./configure \
		--build=$CBUILD \
		--host=$CHOST \
		--prefix=/usr \
		--sysconfdir=/etc \
		--mandir=/usr/share/man \
		--infodir=/usr/share/info \
		--with-gtk \
		--with-xinerama-ext \
		--with-xf86vmode-ext \
		--with-randr-ext
	make
}

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

gl() {
	local _conf
	pkgdesc="An enhanced set of screensavers that require OpenGL"
	cd "$pkgdir"
	mkdir -p "$subpkgdir"/$_confdir
	scanelf -Rn . | awk '$2 ~ /libE?GL/ { print $3 }' | while read -r f; do
		mkdir -p "$subpkgdir"/${f%/*}
		mv "$f" "$subpkgdir"/${f%/*}

		_conf=usr/share/xscreensaver/config/${f##*/}.xml
		if [ -f "$_conf" ]; then
			mv "$_conf" "$subpkgdir"/$_confdir
		fi
	done
}

extras() {
	pkgdesc="An enhanced set of screensavers"
	mkdir -p "$subpkgdir/$_libexecdir" "$subpkgdir/$_confdir"

	local _path
	for _path in "$pkgdir/$_libexecdir"/*; do
		expr "$_path" : \
			'.*/xscreensaver-\(auth\|gfx\)$' > /dev/null || \
			mv "$_path" "$subpkgdir/$_libexecdir"
	done

	mv "$pkgdir/$_confdir"/* "$subpkgdir/$_confdir"
}

sha512sums="
4aa30824c972a73dc09aeba478cad074f273839a4c7641cddd292da38fc75db10a3f6243cbe8619c5e39cad54c27d33e1e271dfed167458faa7747fb0a090630  xscreensaver-6.03.tar.gz
"