aboutsummaryrefslogtreecommitdiffstats
path: root/community/weston/APKBUILD
blob: 061cd32ab0f8887023d6769aee41a1ba30f7bd38 (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
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
# Contributor: Sören Tempel <soeren+alpine@soeren-tempel.net>
# Maintainer: Valery Kartel <valery.kartel@gmail.com>
pkgname=weston
pkgver=11.0.0
pkgrel=0
_libname=lib$pkgname
_libdir=$_libname-${pkgver%%.*}
pkgdesc="The reference Wayland server"
url="https://wayland.freedesktop.org/"
arch="all"
license="MIT"
makedepends="
	colord-dev
	dbus-dev
	elogind-dev
	freerdp-dev
	glu-dev
	gst-plugins-base-dev
	gstreamer-dev
	lcms2-dev
	libevdev-dev
	libinput-dev
	libjpeg-turbo-dev
	libunwind-dev
	libva-dev
	libwebp-dev
	libxcursor-dev
	libxkbcommon-dev
	linux-pam-dev
	meson
	mtdev-dev
	pango-dev
	pipewire-dev
	libseat-dev
	wayland-dev
	wayland-protocols
	xkeyboard-config
	"
_shell="shell-desktop shell-fullscreen shell-ivi"
_client="terminal wcap-decode"
_backend="backend-drm backend-headless
	backend-x11 backend-wayland backend-rdp
	"
for _sub in $_shell $_client $_backend; do
	subpackages="$subpackages $pkgname-$_sub:_sub"
done
subpackages="
	$pkgname-dev
	$pkgname-doc
	$subpackages
	$pkgname-clients
	$_libname:libs
	$pkgname-xwayland
	$pkgname-desktop-x11:_x11:noarch
	"
source="https://gitlab.freedesktop.org/wayland/weston/-/releases/$pkgver/downloads/weston-$pkgver.tar.xz"
options="!check"
install="$pkgname.pre-install"

prepare() {
	default_prepare

	# dodge git version
	git init .
}

build() {
	abuild-meson \
		-Db_lto=true \
		-Dlauncher-logind=true \
		-Dsystemd=false \
		build
	meson compile ${JOBS:+-j ${JOBS}} -C build
}

# Does not run through, see also:
# https://github.com/alpinelinux/aports/pull/1689
check() {
	meson test --print-errorlogs --no-rebuild -C build
}

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

	mkdir -p "$pkgdir"/usr/lib
	mv "$pkgdir"/usr/share/pkgconfig/* "$pkgdir"/usr/lib/pkgconfig/
}

libs() {
	depends="xkeyboard-config"
	default_libs
}

clients() {
	pkgdesc="Weston example clients"
	mkdir -p "$subpkgdir"/usr/bin
	mv "$pkgdir"/usr/bin/$pkgname-* "$subpkgdir"/usr/bin
}

xwayland() {
	pkgdesc="Wayland module to run X Clients"
	mkdir -p "$subpkgdir"/usr/lib/$_libdir
	mv "$pkgdir"/usr/lib/$_libdir/xwayland.so \
		"$subpkgdir"/usr/lib/$_libdir
}

_x11() {
	pkgdesc="Weston desktop helper pack (x11 backend)"
	depends="$pkgname $pkgname-shell-desktop $pkgname-xwayland
		$pkgname-backend-x11 $pkgname-terminal"
	mkdir -p "$subpkgdir"
}

_sub() {
	local name path
	case $subpkgname in
	*-shell-*)
		name=${subpkgname#$pkgname-shell-}
		path=/usr/lib/$pkgname
		pkgdesc="Weston shell: $name"
		name=*$name-shell*
		;;
	*-backend-*)
		name=${subpkgname#$pkgname-backend-}
		path=/usr/lib/$_libdir
		pkgdesc="Weston backend: $name"
		name=$name-backend.so
		grep -q cairo "$pkgdir"/$path/$name && depends="mesa-dri-gallium"
		;;
	*)
		name=$subpkgname
		path=/usr/bin
		[ -x "$pkgdir"/$path/$name ] || name=${subpkgname#$pkgname-}
		pkgdesc="Weston client: $name"
		;;
	esac
	mkdir -p "$subpkgdir"/$path
	mv "$pkgdir"/$path/$name "$subpkgdir"/$path
}

sha512sums="
71554dc870e9c6832fdfb8f0e8dbcd7ad01c3827041c2f7fe4b7679df33b242fd00e7f0c8728d1aeecc648f8296a9d3fc502a66c91ec662f03086d9a28aab3ea  weston-11.0.0.tar.xz
"