blob: ce5a8aa8f260ba7e59942e182206177c254bb75b [file] [log] [blame]
Andrew Geissler595f6302022-01-24 19:11:47 +00001SUMMARY = "Simple DirectMedia Layer"
2DESCRIPTION = "Simple DirectMedia Layer is a cross-platform multimedia \
3library designed to provide low level access to audio, keyboard, mouse, \
4joystick, 3D hardware via OpenGL, and 2D video framebuffer."
5HOMEPAGE = "http://www.libsdl.org"
6BUGTRACKER = "http://bugzilla.libsdl.org/"
7
8SECTION = "libs"
9
Patrick Williams03907ee2022-05-01 06:28:52 -050010LICENSE = "Zlib & BSD-2-Clause"
11LIC_FILES_CHKSUM = "\
12 file://LICENSE.txt;md5=68a088513da90254b2fbe664f42af315 \
13 file://src/hidapi/LICENSE.txt;md5=7c3949a631240cb6c31c50f3eb696077 \
14 file://src/hidapi/LICENSE-bsd.txt;md5=b5fa085ce0926bb50d0621620a82361f \
15 file://src/video/yuv2rgb/LICENSE;md5=79f8f3418d91531e05f0fc94ca67e071 \
16"
Andrew Geissler595f6302022-01-24 19:11:47 +000017
18# arm-neon adds MIT license
19LICENSE:append = " ${@bb.utils.contains('PACKAGECONFIG', 'arm-neon', '& MIT', '', d)}"
20LIC_FILES_CHKSUM:append = " ${@bb.utils.contains('PACKAGECONFIG', 'arm-neon', 'file://src/video/arm/pixman-arm-neon-asm.h;md5=9a9cc1e51abbf1da58f4d9528ec9d49b;beginline=1;endline=24', '', d)}"
21
22PROVIDES = "virtual/libsdl2"
23
24SRC_URI = "http://www.libsdl.org/release/SDL2-${PV}.tar.gz \
Andrew Geissler595f6302022-01-24 19:11:47 +000025 "
Patrick Williamsde0582f2022-04-08 10:23:27 -050026SRC_URI:append:class-native = " file://0001-Disable-libunwind-in-native-OE-builds-by-not-looking.patch"
Andrew Geissler595f6302022-01-24 19:11:47 +000027
28S = "${WORKDIR}/SDL2-${PV}"
29
Patrick Williams7784c422022-11-17 07:29:11 -060030SRC_URI[sha256sum] = "b35ef0a802b09d90ed3add0dcac0e95820804202914f5bb7b0feb710f1a1329f"
Andrew Geissler595f6302022-01-24 19:11:47 +000031
Patrick Williams92b42cb2022-09-03 06:53:57 -050032inherit cmake lib_package binconfig-disabled pkgconfig upstream-version-is-even
Andrew Geissler595f6302022-01-24 19:11:47 +000033
34BINCONFIG = "${bindir}/sdl2-config"
35
36CVE_PRODUCT = "simple_directmedia_layer sdl"
37
38EXTRA_OECMAKE = "-DSDL_OSS=OFF -DSDL_ESD=OFF -DSDL_ARTS=OFF \
39 -DSDL_DISKAUDIO=OFF -DSDL_NAS=OFF -DSDL_ESD_SHARED=OFF \
40 -DSDL_DUMMYVIDEO=OFF \
41 -DSDL_RPI=OFF \
42 -DSDL_PTHREADS=ON \
43 -DSDL_RPATH=OFF \
44 -DSDL_SNDIO=OFF \
Andrew Geissler595f6302022-01-24 19:11:47 +000045 -DSDL_X11_XCURSOR=OFF \
Andrew Geissler595f6302022-01-24 19:11:47 +000046 -DSDL_X11_XDBE=OFF \
47 -DSDL_X11_XFIXES=OFF \
48 -DSDL_X11_XINPUT=OFF \
49 -DSDL_X11_XRANDR=OFF \
50 -DSDL_X11_XSCRNSAVER=OFF \
51 -DSDL_X11_XSHAPE=OFF \
52"
53
54# opengl packageconfig factored out to make it easy for distros
55# and BSP layers to pick either (desktop) opengl, gles2, or no GL
56PACKAGECONFIG_GL ?= "${@bb.utils.filter('DISTRO_FEATURES', 'opengl', d)}"
57
58PACKAGECONFIG:class-native = "x11 ${PACKAGECONFIG_GL}"
59PACKAGECONFIG:class-nativesdk = "${@bb.utils.filter('DISTRO_FEATURES', 'x11', d)} ${PACKAGECONFIG_GL}"
60PACKAGECONFIG ??= " \
61 ${PACKAGECONFIG_GL} \
Andrew Geissler87f5cff2022-09-30 13:13:31 -050062 ${@bb.utils.filter('DISTRO_FEATURES', 'alsa directfb pulseaudio x11 vulkan', d)} \
Andrew Geissler595f6302022-01-24 19:11:47 +000063 ${@bb.utils.contains('DISTRO_FEATURES', 'wayland', 'wayland gles2', '', d)} \
64 ${@bb.utils.contains("TUNE_FEATURES", "neon","arm-neon","",d)} \
65"
66PACKAGECONFIG[alsa] = "-DSDL_ALSA=ON,-DSDL_ALSA=OFF,alsa-lib,"
67PACKAGECONFIG[arm-neon] = "-DSDL_ARMNEON=ON,-DSDL_ARMNEON=OFF"
68PACKAGECONFIG[directfb] = "-DSDL_DIRECTFB=ON,-DSDL_DIRECTFB=OFF,directfb,directfb"
69PACKAGECONFIG[gles2] = "-DSDL_OPENGLES=ON,-DSDL_OPENGLES=OFF,virtual/libgles2"
70PACKAGECONFIG[jack] = "-DSDL_JACK=ON,-DSDL_JACK=OFF,jack"
71PACKAGECONFIG[kmsdrm] = "-DSDL_KMSDRM=ON,-DSDL_KMSDRM=OFF,libdrm virtual/libgbm"
Andrew Geisslerd5838332022-05-27 11:33:10 -050072# The hidraw support doesn't catch Xbox, PS4 and Nintendo controllers,
73# so we'll just use libusb when it's available.
74PACKAGECONFIG[libusb] = ",,libusb1"
Andrew Geissler9aee5002022-03-30 16:27:02 +000075PACKAGECONFIG[opengl] = "-DSDL_OPENGL=ON,-DSDL_OPENGL=OFF,virtual/egl"
Andrew Geissler595f6302022-01-24 19:11:47 +000076PACKAGECONFIG[pulseaudio] = "-DSDL_PULSEAUDIO=ON,-DSDL_PULSEAUDIO=OFF,pulseaudio"
Andrew Geissler87f5cff2022-09-30 13:13:31 -050077PACKAGECONFIG[vulkan] = "-DSDL_VULKAN=ON,-DSDL_VULKAN=OFF"
Andrew Geissler595f6302022-01-24 19:11:47 +000078PACKAGECONFIG[wayland] = "-DSDL_WAYLAND=ON,-DSDL_WAYLAND=OFF,wayland-native wayland wayland-protocols libxkbcommon"
79PACKAGECONFIG[x11] = "-DSDL_X11=ON,-DSDL_X11=OFF,virtual/libx11 libxext libxrandr libxrender"
80
81CFLAGS:append:class-native = " -DNO_SHARED_MEMORY"
82
Andrew Geissler87f5cff2022-09-30 13:13:31 -050083FILES:${PN} += "${datadir}/licenses/SDL2/LICENSE.txt"
84
Andrew Geissler595f6302022-01-24 19:11:47 +000085BBCLASSEXTEND = "native nativesdk"