blob: ff3e162c49c54581fe57e5572933e43394e9b741 [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 Geisslerd5838332022-05-27 11:33:10 -050025 file://0001-video-restore-ability-to-disable-fb-accel-via-hint.patch \
Andrew Geissler595f6302022-01-24 19:11:47 +000026 "
Patrick Williamsde0582f2022-04-08 10:23:27 -050027SRC_URI:append:class-native = " file://0001-Disable-libunwind-in-native-OE-builds-by-not-looking.patch"
Andrew Geissler595f6302022-01-24 19:11:47 +000028
29S = "${WORKDIR}/SDL2-${PV}"
30
Andrew Geisslerd5838332022-05-27 11:33:10 -050031SRC_URI[sha256sum] = "fe7cbf3127882e3fc7259a75a0cb585620272c51745d3852ab9dd87960697f2e"
Andrew Geissler595f6302022-01-24 19:11:47 +000032
Patrick Williams92b42cb2022-09-03 06:53:57 -050033inherit cmake lib_package binconfig-disabled pkgconfig upstream-version-is-even
Andrew Geissler595f6302022-01-24 19:11:47 +000034
35BINCONFIG = "${bindir}/sdl2-config"
36
37CVE_PRODUCT = "simple_directmedia_layer sdl"
38
39EXTRA_OECMAKE = "-DSDL_OSS=OFF -DSDL_ESD=OFF -DSDL_ARTS=OFF \
40 -DSDL_DISKAUDIO=OFF -DSDL_NAS=OFF -DSDL_ESD_SHARED=OFF \
41 -DSDL_DUMMYVIDEO=OFF \
42 -DSDL_RPI=OFF \
43 -DSDL_PTHREADS=ON \
44 -DSDL_RPATH=OFF \
45 -DSDL_SNDIO=OFF \
Andrew Geissler78b72792022-06-14 06:47:25 -050046 -DSDL_X11_XVM=OFF \
Andrew Geissler595f6302022-01-24 19:11:47 +000047 -DSDL_X11_XCURSOR=OFF \
Andrew Geissler78b72792022-06-14 06:47:25 -050048 -DSDL_X11_XINERAMA=OFF \
Andrew Geissler595f6302022-01-24 19:11:47 +000049 -DSDL_X11_XDBE=OFF \
50 -DSDL_X11_XFIXES=OFF \
51 -DSDL_X11_XINPUT=OFF \
52 -DSDL_X11_XRANDR=OFF \
53 -DSDL_X11_XSCRNSAVER=OFF \
54 -DSDL_X11_XSHAPE=OFF \
55"
56
57# opengl packageconfig factored out to make it easy for distros
58# and BSP layers to pick either (desktop) opengl, gles2, or no GL
59PACKAGECONFIG_GL ?= "${@bb.utils.filter('DISTRO_FEATURES', 'opengl', d)}"
60
61PACKAGECONFIG:class-native = "x11 ${PACKAGECONFIG_GL}"
62PACKAGECONFIG:class-nativesdk = "${@bb.utils.filter('DISTRO_FEATURES', 'x11', d)} ${PACKAGECONFIG_GL}"
63PACKAGECONFIG ??= " \
64 ${PACKAGECONFIG_GL} \
65 ${@bb.utils.filter('DISTRO_FEATURES', 'alsa directfb pulseaudio x11', d)} \
66 ${@bb.utils.contains('DISTRO_FEATURES', 'wayland', 'wayland gles2', '', d)} \
67 ${@bb.utils.contains("TUNE_FEATURES", "neon","arm-neon","",d)} \
68"
69PACKAGECONFIG[alsa] = "-DSDL_ALSA=ON,-DSDL_ALSA=OFF,alsa-lib,"
70PACKAGECONFIG[arm-neon] = "-DSDL_ARMNEON=ON,-DSDL_ARMNEON=OFF"
71PACKAGECONFIG[directfb] = "-DSDL_DIRECTFB=ON,-DSDL_DIRECTFB=OFF,directfb,directfb"
72PACKAGECONFIG[gles2] = "-DSDL_OPENGLES=ON,-DSDL_OPENGLES=OFF,virtual/libgles2"
73PACKAGECONFIG[jack] = "-DSDL_JACK=ON,-DSDL_JACK=OFF,jack"
74PACKAGECONFIG[kmsdrm] = "-DSDL_KMSDRM=ON,-DSDL_KMSDRM=OFF,libdrm virtual/libgbm"
Andrew Geisslerd5838332022-05-27 11:33:10 -050075# The hidraw support doesn't catch Xbox, PS4 and Nintendo controllers,
76# so we'll just use libusb when it's available.
77PACKAGECONFIG[libusb] = ",,libusb1"
Andrew Geissler9aee5002022-03-30 16:27:02 +000078PACKAGECONFIG[opengl] = "-DSDL_OPENGL=ON,-DSDL_OPENGL=OFF,virtual/egl"
Andrew Geissler595f6302022-01-24 19:11:47 +000079PACKAGECONFIG[pulseaudio] = "-DSDL_PULSEAUDIO=ON,-DSDL_PULSEAUDIO=OFF,pulseaudio"
80PACKAGECONFIG[wayland] = "-DSDL_WAYLAND=ON,-DSDL_WAYLAND=OFF,wayland-native wayland wayland-protocols libxkbcommon"
81PACKAGECONFIG[x11] = "-DSDL_X11=ON,-DSDL_X11=OFF,virtual/libx11 libxext libxrandr libxrender"
82
83CFLAGS:append:class-native = " -DNO_SHARED_MEMORY"
84
85BBCLASSEXTEND = "native nativesdk"