aboutsummaryrefslogtreecommitdiffstats
path: root/community/sdl2/APKBUILD
blob: 35ed57c0b06d5861dc49aaa01384b473e9265151 (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
# Contributor: August Klein <amatcoder@gmail.com>
# Maintainer: August Klein <amatcoder@gmail.com>
pkgname=sdl2
pkgver=2.0.12
pkgrel=5
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
	0001-src-video-directfb-SDL_DirectFB_render.c-fix-build.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="3f1f04af0f3d9dda9c84a2e9274ae8d83ea0da3fc367970a820036cc4dc1dbf990cfc37e4975ae05f0b45a4ffa739c6c19e470c00bf3f2bce9b8b63717b8b317  SDL2-2.0.12.tar.gz
8efdd02e0e71908b913f4c05b1f02aa94315c2bbffff87d1a46db94723dd7f0ea177e1e00de6c212ad31a00a22aa0fd87f63c3865c4dff2dc98f302046084caf  directfb-cflags.patch
76c93659a122def05f341ba30507b546b201c84823236ca731ac801f092e769574e8f051770a76050a77ac846ed851abab604e0a6d578b382f4792ab47aa60ed  khronos.patch
8de7a7ea80eda5797adf29aa8123511f41dd6980e93203dfd2b080d915fa3b548e2712c68ff76ff09ef4b9cdbdc941cb728d01dc90c962b6bf6b96374de4aa8f  0001-src-video-directfb-SDL_DirectFB_render.c-fix-build.patch"