aboutsummaryrefslogtreecommitdiffstats
path: root/testing/weston/APKBUILD
blob: bf09e29eee6743c6411151185c69614383c22887 (plain)
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
# Contributor: Sören Tempel <soeren+alpine@soeren-tempel.net>
# Maintainer: Valery Kartel <valery.kartel@gmail.com>
pkgname=weston
pkgver=3.0.0
pkgrel=0
_libname=lib$pkgname
_libdir=$_libname-${pkgver%%.*}
pkgdesc="The reference Wayland server"
url="http://wayland.freedesktop.org"
arch="all !s390x !x86 !ppc64le"
license="MIT"
depends=""
makedepends="wayland-protocols libxkbcommon-dev xkeyboard-config
	libinput-dev libunwind-dev mtdev-dev libxcursor-dev glu-dev
	pango-dev colord-dev freerdp-dev libwebp-dev libva-dev dbus-dev
	"
_cms="cms-colord cms-static"
_shell="shell-desktop shell-fullscreen shell-ivi"
_client="info terminal wcap-decode"
_backend="backend-drm backend-fbdev backend-headless
	backend-rdp backend-x11 backend-wayland
	"
for _sub in $_cms $_shell $_client $_backend; do
	subpackages="$subpackages $pkgname-$_sub:_sub"
done
subpackages="$pkgname-dev $pkgname-doc $subpackages
	$pkgname-clients $_libname-desktop:_libd $_libname:libs
	$pkgname-xwayland $pkgname-desktop-x11:_x11:noarch
	"
source="http://wayland.freedesktop.org/releases/$pkgname-$pkgver.tar.xz
	timespec.patch"
builddir="$srcdir/$pkgname-$pkgver"
options="!check"

build() {
	cd "$builddir"
	./configure \
		--build=$CBUILD \
		--host=$CHOST \
		--prefix=/usr \
		--sysconfdir=/etc \
		--mandir=/usr/share/man \
		--localstatedir=/var \
		--libexecdir=/usr/lib/$pkgname \
		--enable-rdp-compositor \
		--enable-screen-sharing \
		--enable-vaapi-recorder \
		--enable-clients \
		--enable-demo-clients-install \
		--disable-weston-launch \
		--disable-setuid-install
	make
}

# Does not run through, see also:
# https://github.com/alpinelinux/aports/pull/1689
check() {
	make -C "$builddir" check
	return 0
}

package() {
	make  -C "$builddir" DESTDIR="$pkgdir" install
}

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

_libd() {
	pkgdesc="Desktop shells abstraction library for libweston compositors"
	mkdir -p "$subpkgdir"/usr/lib || return 1
	mv "$pkgdir"/usr/lib/*desktop* "$subpkgdir"/usr/lib
}

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

xwayland() {
	pkgdesc="Wayland module to run X Clients"
	mkdir -p "$subpkgdir"/usr/lib/$_libdir || return 1
	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
	*-cms-*)
		name=${subpkgname#$pkgname-cms-}
		path=/usr/lib/$pkgname
		pkgdesc="Weston CMS module: $name"
		name=cms-$name.so
		;;
	*-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-swrast"
		;;
	*)
		name=$subpkgname
		path=/usr/bin
		[ -x "$pkgdir"/$path/$name ] || name=${subpkgname#$pkgname-}
		pkgdesc="Weston client: $name"
		;;
	esac
	mkdir -p "$subpkgdir"/$path || return 1
	mv "$pkgdir"/$path/$name "$subpkgdir"/$path
}

sha512sums="b824c39f2a884f6d50d607613f447090621f684c96f7d905f25f6e500dabd03ecb2b1cd1030babc193c3417223cb220103abb792437e1a5ead7229a76b5c7a58  weston-3.0.0.tar.xz
3e596af4bf0a6b06a5d28376043db111fe1c161ead04501fa6d2c667b5a21889cca3354d1bdc4ac794841bef68ed5e1a7a84e44e7d510e947e3673195706caed  timespec.patch"