blob: bd7dea275e145fa180430e781f6af2821fbf6c23 [file] [log] [blame]
Andrew Geissler82c905d2020-04-13 13:39:40 -05001SUMMARY = "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
10LICENSE = "Zlib"
Andrew Geisslerd159c7f2021-09-02 21:05:58 -050011LIC_FILES_CHKSUM = "file://LICENSE.txt;md5=095c2687a3c3908e26984eaa8ec2d770"
Andrew Geissler82c905d2020-04-13 13:39:40 -050012
13# arm-neon adds MIT license
Patrick Williams213cb262021-08-07 19:21:33 -050014LICENSE:append = " ${@bb.utils.contains('PACKAGECONFIG', 'arm-neon', '& MIT', '', d)}"
15LIC_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)}"
Andrew Geissler82c905d2020-04-13 13:39:40 -050016
17PROVIDES = "virtual/libsdl2"
18
19SRC_URI = "http://www.libsdl.org/release/SDL2-${PV}.tar.gz \
20 file://more-gen-depends.patch \
21"
22
23S = "${WORKDIR}/SDL2-${PV}"
24
Andrew Geisslerd159c7f2021-09-02 21:05:58 -050025SRC_URI[sha256sum] = "65be9ff6004034b5b2ce9927b5a4db1814930f169c4b2dae0a1e4697075f287b"
Andrew Geissler82c905d2020-04-13 13:39:40 -050026
27inherit autotools lib_package binconfig-disabled pkgconfig
28
29BINCONFIG = "${bindir}/sdl2-config"
30
31CVE_PRODUCT = "simple_directmedia_layer sdl"
32
33EXTRA_OECONF = "--disable-oss --disable-esd --disable-arts \
34 --disable-diskaudio --disable-nas --disable-esd-shared --disable-esdtest \
35 --disable-video-dummy \
Andrew Geissler6ce62a22020-11-30 19:58:47 -060036 --disable-video-rpi \
Andrew Geissler82c905d2020-04-13 13:39:40 -050037 --enable-pthreads \
38 --enable-sdl-dlopen \
39 --disable-rpath \
40 --disable-sndio \
41 --disable-fcitx --disable-ibus \
42 "
43
44# opengl packageconfig factored out to make it easy for distros
45# and BSP layers to pick either (desktop) opengl, gles2, or no GL
46PACKAGECONFIG_GL ?= "${@bb.utils.filter('DISTRO_FEATURES', 'opengl', d)}"
47
Patrick Williams213cb262021-08-07 19:21:33 -050048PACKAGECONFIG:class-native = "x11 ${PACKAGECONFIG_GL}"
49PACKAGECONFIG:class-nativesdk = "${@bb.utils.filter('DISTRO_FEATURES', 'x11', d)} ${PACKAGECONFIG_GL}"
Andrew Geissler82c905d2020-04-13 13:39:40 -050050PACKAGECONFIG ??= " \
51 ${PACKAGECONFIG_GL} \
52 ${@bb.utils.filter('DISTRO_FEATURES', 'alsa directfb pulseaudio x11', d)} \
53 ${@bb.utils.contains('DISTRO_FEATURES', 'wayland', 'wayland gles2', '', d)} \
54 ${@bb.utils.contains("TUNE_FEATURES", "neon","arm-neon","",d)} \
55"
56PACKAGECONFIG[alsa] = "--enable-alsa --disable-alsatest,--disable-alsa,alsa-lib,"
57PACKAGECONFIG[arm-neon] = "--enable-arm-neon,--disable-arm-neon"
Andrew Geissler6ce62a22020-11-30 19:58:47 -060058PACKAGECONFIG[directfb] = "--enable-video-directfb,--disable-video-directfb,directfb,directfb"
Andrew Geissler82c905d2020-04-13 13:39:40 -050059PACKAGECONFIG[gles2] = "--enable-video-opengles,--disable-video-opengles,virtual/libgles2"
60PACKAGECONFIG[jack] = "--enable-jack,--disable-jack,jack"
61PACKAGECONFIG[kmsdrm] = "--enable-video-kmsdrm,--disable-video-kmsdrm,libdrm virtual/libgbm"
62PACKAGECONFIG[opengl] = "--enable-video-opengl,--disable-video-opengl,virtual/libgl"
63PACKAGECONFIG[pulseaudio] = "--enable-pulseaudio,--disable-pulseaudio,pulseaudio"
Andrew Geissler82c905d2020-04-13 13:39:40 -050064PACKAGECONFIG[wayland] = "--enable-video-wayland,--disable-video-wayland,wayland-native wayland wayland-protocols libxkbcommon"
65PACKAGECONFIG[x11] = "--enable-video-x11,--disable-video-x11,virtual/libx11 libxext libxrandr libxrender"
66
67EXTRA_AUTORECONF += "--include=acinclude --exclude=autoheader"
Patrick Williams213cb262021-08-07 19:21:33 -050068CFLAGS:append:class-native = " -DNO_SHARED_MEMORY"
Andrew Geissler82c905d2020-04-13 13:39:40 -050069
Patrick Williams213cb262021-08-07 19:21:33 -050070do_configure:prepend() {
Andrew Geissler82c905d2020-04-13 13:39:40 -050071 # Remove old libtool macros.
72 MACROS="libtool.m4 lt~obsolete.m4 ltoptions.m4 ltsugar.m4 ltversion.m4"
73 for i in ${MACROS}; do
74 rm -f ${S}/acinclude/$i
75 done
76 export SYSROOT=$PKG_CONFIG_SYSROOT_DIR
77}
78
Andrew Geissler82c905d2020-04-13 13:39:40 -050079BBCLASSEXTEND = "native nativesdk"