aboutsummaryrefslogtreecommitdiffstats
path: root/community/sdl2/APKBUILD
blob: bed2bea2eb9ad531ff20eb290f6a775662aaeaba (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
# Contributor: August Klein <amatcoder@gmail.com>
# Maintainer: August Klein <amatcoder@gmail.com>
pkgname=sdl2
pkgver=2.0.14
pkgrel=0
pkgdesc="development library designed to provide low level access to audio, keyboard, mouse, joystick and graphics"
url="https://www.libsdl.org"
arch="all"
license="Zlib"
depends_dev="directfb-dev mesa-dev"
makedepends="
	alsa-lib-dev
	cmake
	eudev-dev
	jack-dev
	libx11-dev
	libxcursor-dev
	libxext-dev
	libxi-dev
	libxkbcommon-dev
	libxrandr-dev
	libxrender-dev
	libxscrnsaver-dev
	libusb-dev
	pulseaudio-dev
	wayland-dev
	wayland-protocols
	$depends_dev
	"
subpackages="$pkgname-dev"
source="https://www.libsdl.org/release/SDL2-$pkgver.tar.gz
	directfb-cflags.patch
	khronos.patch
	"
options="!check" # No good way to run the available tests
builddir="$srcdir/SDL2-$pkgver"

# secfixes:
#   2.0.10-r0:
#     - CVE-2019-7572
#     - CVE-2019-7573
#     - CVE-2019-7574
#     - CVE-2019-7575
#     - CVE-2019-7576
#     - CVE-2019-7578
#     - CVE-2019-7635
#     - CVE-2019-7636
#     - CVE-2019-7637
#     - CVE-2019-7638

build() {
	# NOTE: Please do not remove the -DVIDEO_DIRECTFB=ON flag.
	# Some apps, used for booting Alpine derivatives, require this to function!
	if [ "$CBUILD" != "$CHOST" ]; then
		CMAKE_CROSSOPTS="-DCMAKE_SYSTEM_NAME=Linux -DCMAKE_HOST_SYSTEM_NAME=Linux"
	fi
	cmake -B build \
		-DCMAKE_INSTALL_PREFIX=/usr \
		-DCMAKE_INSTALL_LIBDIR=lib \
		-DCMAKE_BUILD_TYPE=None \
		-DBUILD_SHARED_LIBS=True \
		-DSDL_TEST=OFF \
		-DALSA=ON \
		-DJACK=ON \
		-DCLOCK_GETTIME=ON \
		-DARTS=OFF \
		-DESD=OFF \
		-DNAS=OFF \
		-DRPATH=OFF \
		-DVIDEO_X11=ON \
		-DVIDEO_DIRECTFB=ON \
		-DVIDEO_WAYLAND=ON \
		-DCMAKE_C_FLAGS="$CFLAGS" \
		-DSDL_STATIC=ON \
		-DSDL_SHARED=ON \
		-DPULSEAUDIO_SHARED=ON \
		"$CMAKE_CROSSOPTS"
	make -C build
}

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

sha512sums="ebc482585bd565bf3003fbcedd91058b2183e333b9ea566d2f386da0298ff970645d9d25c1aa4459c7c96e9ea839fd1c5f2da0242a56892865b2e456cdd027ee  SDL2-2.0.14.tar.gz
8efdd02e0e71908b913f4c05b1f02aa94315c2bbffff87d1a46db94723dd7f0ea177e1e00de6c212ad31a00a22aa0fd87f63c3865c4dff2dc98f302046084caf  directfb-cflags.patch
76c93659a122def05f341ba30507b546b201c84823236ca731ac801f092e769574e8f051770a76050a77ac846ed851abab604e0a6d578b382f4792ab47aa60ed  khronos.patch"