1*edff4923SAndrew GeisslerSUMMARY = "Simple DirectMedia Layer"
2*edff4923SAndrew GeisslerDESCRIPTION = "Simple DirectMedia Layer is a cross-platform multimedia \
3*edff4923SAndrew Geisslerlibrary designed to provide low level access to audio, keyboard, mouse, \
4*edff4923SAndrew Geisslerjoystick, 3D hardware via OpenGL, and 2D video framebuffer."
5*edff4923SAndrew GeisslerHOMEPAGE = "http://www.libsdl.org"
6*edff4923SAndrew GeisslerBUGTRACKER = "http://bugzilla.libsdl.org/"
7*edff4923SAndrew Geissler
8*edff4923SAndrew GeisslerSECTION = "libs"
9*edff4923SAndrew Geissler
10*edff4923SAndrew GeisslerLICENSE = "Zlib & BSD-2-Clause"
11*edff4923SAndrew GeisslerLIC_FILES_CHKSUM = "\
12*edff4923SAndrew Geissler    file://LICENSE.txt;md5=25231a5b96ccdd8f39eb53c07717be64 \
13*edff4923SAndrew Geissler    file://src/hidapi/LICENSE.txt;md5=7c3949a631240cb6c31c50f3eb696077 \
14*edff4923SAndrew Geissler    file://src/hidapi/LICENSE-bsd.txt;md5=b5fa085ce0926bb50d0621620a82361f \
15*edff4923SAndrew Geissler    file://src/video/yuv2rgb/LICENSE;md5=79f8f3418d91531e05f0fc94ca67e071 \
16*edff4923SAndrew Geissler"
17*edff4923SAndrew Geissler
18*edff4923SAndrew Geissler# arm-neon adds MIT license
19*edff4923SAndrew GeisslerLICENSE:append = " ${@bb.utils.contains('PACKAGECONFIG', 'arm-neon', '& MIT', '', d)}"
20*edff4923SAndrew GeisslerLIC_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*edff4923SAndrew Geissler
22*edff4923SAndrew GeisslerPROVIDES = "virtual/libsdl2"
23*edff4923SAndrew Geissler
24*edff4923SAndrew GeisslerSRC_URI = "http://www.libsdl.org/release/SDL2-${PV}.tar.gz"
25*edff4923SAndrew Geissler
26*edff4923SAndrew GeisslerS = "${WORKDIR}/SDL2-${PV}"
27*edff4923SAndrew Geissler
28*edff4923SAndrew GeisslerSRC_URI[sha256sum] = "820440072f8f5b50188c1dae104f2ad25984de268785be40c41a099a510f0aec"
29*edff4923SAndrew Geissler
30*edff4923SAndrew Geisslerinherit cmake lib_package binconfig-disabled pkgconfig upstream-version-is-even
31*edff4923SAndrew Geissler
32*edff4923SAndrew GeisslerBINCONFIG = "${bindir}/sdl2-config"
33*edff4923SAndrew Geissler
34*edff4923SAndrew GeisslerCVE_PRODUCT = "simple_directmedia_layer sdl"
35*edff4923SAndrew Geissler
36*edff4923SAndrew GeisslerEXTRA_OECMAKE = "-DSDL_OSS=OFF -DSDL_ESD=OFF -DSDL_ARTS=OFF \
37*edff4923SAndrew Geissler                 -DSDL_DISKAUDIO=OFF -DSDL_NAS=OFF -DSDL_ESD_SHARED=OFF \
38*edff4923SAndrew Geissler                 -DSDL_DUMMYVIDEO=OFF \
39*edff4923SAndrew Geissler                 -DSDL_RPI=OFF \
40*edff4923SAndrew Geissler                 -DSDL_PTHREADS=ON \
41*edff4923SAndrew Geissler                 -DSDL_RPATH=OFF \
42*edff4923SAndrew Geissler                 -DSDL_SNDIO=OFF \
43*edff4923SAndrew Geissler                 -DSDL_X11_XCURSOR=OFF \
44*edff4923SAndrew Geissler                 -DSDL_X11_XDBE=OFF \
45*edff4923SAndrew Geissler                 -DSDL_X11_XFIXES=OFF \
46*edff4923SAndrew Geissler                 -DSDL_X11_XINPUT=OFF \
47*edff4923SAndrew Geissler                 -DSDL_X11_XRANDR=OFF \
48*edff4923SAndrew Geissler                 -DSDL_X11_XSCRNSAVER=OFF \
49*edff4923SAndrew Geissler                 -DSDL_X11_XSHAPE=OFF \
50*edff4923SAndrew Geissler"
51*edff4923SAndrew Geissler
52*edff4923SAndrew Geissler# opengl packageconfig factored out to make it easy for distros
53*edff4923SAndrew Geissler# and BSP layers to pick either (desktop) opengl, gles2, or no GL
54*edff4923SAndrew GeisslerPACKAGECONFIG_GL ?= "${@bb.utils.filter('DISTRO_FEATURES', 'opengl', d)}"
55*edff4923SAndrew Geissler
56*edff4923SAndrew GeisslerPACKAGECONFIG:class-native = "x11 ${PACKAGECONFIG_GL}"
57*edff4923SAndrew GeisslerPACKAGECONFIG:class-nativesdk = "${@bb.utils.filter('DISTRO_FEATURES', 'x11', d)} ${PACKAGECONFIG_GL}"
58*edff4923SAndrew GeisslerPACKAGECONFIG ??= " \
59*edff4923SAndrew Geissler    ${PACKAGECONFIG_GL} \
60*edff4923SAndrew Geissler    ${@bb.utils.filter('DISTRO_FEATURES', 'alsa directfb pulseaudio pipewire x11 vulkan', d)} \
61*edff4923SAndrew Geissler    ${@bb.utils.contains('DISTRO_FEATURES', 'wayland', 'wayland gles2', '', d)} \
62*edff4923SAndrew Geissler    ${@bb.utils.contains("TUNE_FEATURES", "neon","arm-neon","",d)} \
63*edff4923SAndrew Geissler"
64*edff4923SAndrew GeisslerPACKAGECONFIG[alsa]       = "-DSDL_ALSA=ON,-DSDL_ALSA=OFF,alsa-lib,"
65*edff4923SAndrew GeisslerPACKAGECONFIG[arm-neon]   = "-DSDL_ARMNEON=ON,-DSDL_ARMNEON=OFF"
66*edff4923SAndrew GeisslerPACKAGECONFIG[directfb]   = "-DSDL_DIRECTFB=ON,-DSDL_DIRECTFB=OFF,directfb,directfb"
67*edff4923SAndrew GeisslerPACKAGECONFIG[gles2]      = "-DSDL_OPENGLES=ON,-DSDL_OPENGLES=OFF,virtual/libgles2"
68*edff4923SAndrew GeisslerPACKAGECONFIG[jack]       = "-DSDL_JACK=ON,-DSDL_JACK=OFF,jack"
69*edff4923SAndrew GeisslerPACKAGECONFIG[kmsdrm]     = "-DSDL_KMSDRM=ON,-DSDL_KMSDRM=OFF,libdrm virtual/libgbm"
70*edff4923SAndrew Geissler# The hidraw support doesn't catch Xbox, PS4 and Nintendo controllers,
71*edff4923SAndrew Geissler#  so we'll just use libusb when it's available.
72*edff4923SAndrew GeisslerPACKAGECONFIG[libusb] = ",,libusb1"
73*edff4923SAndrew GeisslerPACKAGECONFIG[libdecor] = "-DSDL_WAYLAND_LIBDECOR=ON,-DSDL_WAYLAND_LIBDECOR=OFF,libdecor,libdecor"
74*edff4923SAndrew GeisslerPACKAGECONFIG[opengl]     = "-DSDL_OPENGL=ON,-DSDL_OPENGL=OFF,virtual/egl"
75*edff4923SAndrew GeisslerPACKAGECONFIG[pipewire] = "-DSDL_PIPEWIRE_SHARED=ON,-DSDL_PIPEWIRE_SHARED=OFF,pipewire"
76*edff4923SAndrew GeisslerPACKAGECONFIG[pulseaudio] = "-DSDL_PULSEAUDIO=ON,-DSDL_PULSEAUDIO=OFF,pulseaudio"
77*edff4923SAndrew GeisslerPACKAGECONFIG[vulkan]    = "-DSDL_VULKAN=ON,-DSDL_VULKAN=OFF"
78*edff4923SAndrew GeisslerPACKAGECONFIG[wayland]    = "-DSDL_WAYLAND=ON,-DSDL_WAYLAND=OFF,wayland-native wayland wayland-protocols libxkbcommon"
79*edff4923SAndrew GeisslerPACKAGECONFIG[x11]        = "-DSDL_X11=ON,-DSDL_X11=OFF,virtual/libx11 libxext libxrandr libxrender"
80*edff4923SAndrew Geissler
81*edff4923SAndrew GeisslerCFLAGS:append:class-native = " -DNO_SHARED_MEMORY"
82*edff4923SAndrew Geissler
83*edff4923SAndrew GeisslerFILES:${PN} += "${datadir}/licenses/SDL2/LICENSE.txt"
84*edff4923SAndrew Geissler
85*edff4923SAndrew GeisslerBBCLASSEXTEND = "native nativesdk"
86