2022-02-05 14:23:32 +00:00
# SPDX-License-Identifier: GPL-2.0-or-later
# Copyright (C) 2018-present 5schatten (https://github.com/5schatten)
# Copyright (C) 2022-present Fewtarius
PKG_NAME = "SDL2"
2022-03-07 03:41:43 +00:00
PKG_VERSION = "2.0.20"
PKG_SHA256 = "c56aba1d7b5b0e7e999e4a7698c70b63a3394ff9704b5f6e1c57e0c16f04dd06"
2022-02-05 14:23:32 +00:00
PKG_LICENSE = "GPL"
PKG_SITE = "https://www.libsdl.org/"
2022-07-11 12:08:11 +00:00
PKG_URL = " https://www.libsdl.org/release/SDL2- ${ PKG_VERSION } .tar.gz "
PKG_DEPENDS_TARGET = "toolchain alsa-lib systemd dbus pulseaudio libdrm"
2022-02-05 14:23:32 +00:00
PKG_LONGDESC = "Simple DirectMedia Layer is a cross-platform development library designed to provide low level access to audio, keyboard, mouse, joystick, and graphics hardware."
PKG_DEPENDS_HOST = "toolchain:host distutilscross:host"
PKG_PATCH_DIRS += " ${ DEVICE } "
2022-07-11 12:08:11 +00:00
i f [ ! "${OPENGL}" = "no" ] ; t h e n
2022-08-30 00:32:44 +00:00
PKG_DEPENDS_TARGET += " ${ OPENGL } glu "
PKG_CMAKE_OPTS_TARGET += " -DVIDEO_OPENGL=ON \
2022-08-28 11:19:32 +00:00
-DVIDEO_X11= OFF"
2022-07-11 12:08:11 +00:00
f i
2022-08-30 00:32:44 +00:00
i f [ "${OPENGLES_SUPPORT}" = "yes" ] ; t h e n
2022-07-11 12:08:11 +00:00
PKG_DEPENDS_TARGET += " ${ OPENGLES } "
2022-07-11 22:30:36 +00:00
PKG_CMAKE_OPTS_TARGET += " -DVIDEO_OPENGLES=ON \
-DVIDEO_VULKAN= OFF \
-DVIDEO_X11= OFF"
f i
2022-08-30 00:32:44 +00:00
i f [ "${VULKAN_SUPPORT}" = "yes" ] ; t h e n
PKG_DEPENDS_TARGET += " vulkan-loader vulkan-headers"
PKG_CMAKE_OPTS_TARGET += " -DVIDEO_VULKAN=ON \
-DVIDEO_X11= OFF"
f i
2022-08-28 11:19:32 +00:00
i f [ "${DISPLAYSERVER}" = "wl" ]
2022-07-11 22:30:36 +00:00
t h e n
2022-09-01 06:27:58 +00:00
PKG_DEPENDS_TARGET += " wayland ${ WINDOWMANAGER } "
2022-08-28 11:19:32 +00:00
PKG_CMAKE_OPTS_TARGET += " -DVIDEO_WAYLAND=ON \
-DVIDEO_WAYLAND_QT_TOUCH= ON \
-DWAYLAND_SHARED= ON"
e l s e
PKG_CMAKE_OPTS_TARGET += " -DVIDEO_WAYLAND=OFF \
-DVIDEO_WAYLAND_QT_TOUCH= ON \
-DWAYLAND_SHARED= OFF"
2022-07-11 12:08:11 +00:00
f i
2022-02-05 14:23:32 +00:00
2022-08-08 21:02:05 +00:00
c a s e $ { P R O J E C T } i n
Rockchip)
2022-07-13 21:59:42 +00:00
PKG_DEPENDS_TARGET += " librga"
pre_make_host( ) {
sed -i "s| -lrga||g" ${ PKG_BUILD } /CMakeLists.txt
}
pre_make_target( ) {
if ! ` grep -rnw " ${ PKG_BUILD } /CMakeLists.txt " -e '-lrga' ` ; then
sed -i "s|--no-undefined|--no-undefined -lrga|" ${ PKG_BUILD } /CMakeLists.txt
fi
}
; ;
e s a c
2022-02-05 14:23:32 +00:00
p r e _ c o n f i g u r e _ t a r g e t ( ) {
PKG_CMAKE_OPTS_TARGET = " -DSDL_STATIC=OFF \
-DLIBC= ON \
-DGCC_ATOMICS= ON \
-DALTIVEC= OFF \
-DOSS= OFF \
-DALSA= ON \
-DALSA_SHARED= ON \
-DJACK= OFF \
-DJACK_SHARED= OFF \
-DESD= OFF \
-DESD_SHARED= OFF \
-DARTS= OFF \
-DARTS_SHARED= OFF \
-DNAS= OFF \
-DNAS_SHARED= OFF \
-DLIBSAMPLERATE= OFF \
-DLIBSAMPLERATE_SHARED= OFF \
-DSNDIO= OFF \
-DDISKAUDIO= OFF \
-DDUMMYAUDIO= OFF \
2022-08-28 11:19:32 +00:00
-DVIDEO_X11= OFF \
2022-02-05 14:23:32 +00:00
-DVIDEO_MIR= OFF \
-DMIR_SHARED= OFF \
-DVIDEO_COCOA= OFF \
-DVIDEO_DIRECTFB= OFF \
-DVIDEO_VIVANTE= OFF \
-DDIRECTFB_SHARED= OFF \
-DFUSIONSOUND= OFF \
-DFUSIONSOUND_SHARED= OFF \
-DVIDEO_DUMMY= OFF \
-DINPUT_TSLIB= OFF \
-DPTHREADS= ON \
-DPTHREADS_SEM= ON \
-DDIRECTX= OFF \
-DSDL_DLOPEN= ON \
-DCLOCK_GETTIME= OFF \
-DRPATH= OFF \
-DRENDER_D3D= OFF \
-DVIDEO_KMSDRM= ON \
-DPULSEAUDIO= ON"
}
p o s t _ m a k e i n s t a l l _ t a r g e t ( ) {
sed -e " s:\(['=LI]\)/usr:\\1 ${ SYSROOT_PREFIX } /usr:g " -i $SYSROOT_PREFIX /usr/bin/sdl2-config
rm -rf $INSTALL /usr/bin
}