From d4b703e4a83e1a356be5e8cef7bec790bf339bb0 Mon Sep 17 00:00:00 2001 From: tiopex Date: Sun, 3 Nov 2024 00:35:14 +0100 Subject: [PATCH] Add SDL2 + DirectFB2 --- configs/miyoo_uclibc_defconfig | 12 ++++++++++ package/Config.in | 2 ++ package/directfb2/Config.in | 23 ++++++++++++++++++ package/directfb2/directfb2.mk | 43 ++++++++++++++++++++++++++++++++++ package/flux/Config.in | 4 ++++ package/flux/flux.mk | 15 ++++++++++++ package/sdl/Config.in | 4 ++++ package/sdl/sdl.mk | 10 ++++---- package/sdl2/Config.in | 7 ++++++ package/sdl2/sdl2.mk | 8 +++++-- 10 files changed, 122 insertions(+), 6 deletions(-) create mode 100644 package/directfb2/Config.in create mode 100644 package/directfb2/directfb2.mk create mode 100644 package/flux/Config.in create mode 100644 package/flux/flux.mk diff --git a/configs/miyoo_uclibc_defconfig b/configs/miyoo_uclibc_defconfig index 24e5695d5..33a3848ca 100644 --- a/configs/miyoo_uclibc_defconfig +++ b/configs/miyoo_uclibc_defconfig @@ -74,11 +74,16 @@ BR2_PACKAGE_FATRESIZE=y BR2_PACKAGE_DEJAVU=y BR2_PACKAGE_LIBERATION=y BR2_PACKAGE_DJVU=y +BR2_PACKAGE_DIRECTFB2=y +BR2_PACKAGE_DIRECTFB2_MULTI_KERNEL=y +BR2_PACKAGE_DIRECTFB2_FBDEV=y BR2_PACKAGE_FBCAT=y BR2_PACKAGE_FBGRAB=y +BR2_PACKAGE_LINUX_FUSION=y BR2_PACKAGE_MESA3D=y BR2_PACKAGE_MESA3D_GALLIUM_DRIVER_SWRAST=y BR2_PACKAGE_MESA3D_OPENGL_GLX=y +BR2_PACKAGE_SDL_DIRECTFB2=y BR2_PACKAGE_SDL_GFX=y BR2_PACKAGE_SDL_IMAGE_GIF=y BR2_PACKAGE_SDL_IMAGE_LBM=y @@ -94,6 +99,13 @@ BR2_PACKAGE_SDL_MIXER_MIDI_TIMIDITY=y BR2_PACKAGE_SDL_NET=y BR2_PACKAGE_SDL_SOUND=y BR2_PACKAGE_SDL_SOUND_PLAYSOUND=y +BR2_PACKAGE_SDL2=y +BR2_PACKAGE_SDL2_DIRECTFB2=y +BR2_PACKAGE_SDL2_GFX=y +BR2_PACKAGE_SDL2_IMAGE=y +BR2_PACKAGE_SDL2_MIXER=y +BR2_PACKAGE_SDL2_NET=y +BR2_PACKAGE_SDL2_TTF=y BR2_PACKAGE_XORG7=y BR2_PACKAGE_MUPDF=y BR2_PACKAGE_DBUS=y diff --git a/package/Config.in b/package/Config.in index 5ab7cf419..27743ee2e 100644 --- a/package/Config.in +++ b/package/Config.in @@ -328,6 +328,7 @@ comment "Graphic libraries" source "package/cegui/Config.in" source "package/directfb/Config.in" source "package/directfb-examples/Config.in" + source "package/directfb2/Config.in" source "package/efl/Config.in" source "package/fb-test-app/Config.in" source "package/fbcat/Config.in" @@ -336,6 +337,7 @@ comment "Graphic libraries" source "package/fbset/Config.in" source "package/fbterm/Config.in" source "package/fbv/Config.in" + source "package/flux/Config.in" source "package/freerdp/Config.in" source "package/graphicsmagick/Config.in" source "package/imagemagick/Config.in" diff --git a/package/directfb2/Config.in b/package/directfb2/Config.in new file mode 100644 index 000000000..5f7d6bd42 --- /dev/null +++ b/package/directfb2/Config.in @@ -0,0 +1,23 @@ +config BR2_PACKAGE_DIRECTFB2 + bool "directfb2" + depends on !BR2_PACKAGE_DIRECTFB + select BR2_PACKAGE_FLUX + help + DirectFB2 is a fork of DirectFB. + +config BR2_PACKAGE_DIRECTFB2_MULTI + bool "enable multiple application support" + depends on BR2_PACKAGE_DIRECTFB2 + +config BR2_PACKAGE_DIRECTFB2_MULTI_KERNEL + bool "Enable Linux fusion device support for multi application" + select BR2_PACKAGE_DIRECTFB2_MULTI + +config BR2_PACKAGE_DIRECTFB2_DRMKMS + bool "DRM/KMS backend" + depends on BR2_PACKAGE_DIRECTFB2 + select BR2_PACKAGE_LIBDRM + +config BR2_PACKAGE_DIRECTFB2_FBDEV + bool "fbdev backend" + depends on BR2_PACKAGE_DIRECTFB2 diff --git a/package/directfb2/directfb2.mk b/package/directfb2/directfb2.mk new file mode 100644 index 000000000..7ca993ec5 --- /dev/null +++ b/package/directfb2/directfb2.mk @@ -0,0 +1,43 @@ +################################################################################ +# +# directfb2 +# +################################################################################ + +DIRECTFB2_VERSION = 4d6b7ddd8477b4b52aa78ec82a3add28ade0c965 +DIRECTFB2_SITE = $(call github,directfb2,DirectFB2,$(DIRECTFB2_VERSION)) +DIRECTFB2_DEPENDENCIES = host-flux +DIRECTFB2_LICENSE = LGPL-2.1 +DIRECTFB2_INSTALL_STAGING = YES + +DIRECTFB2_CFLAGS = $(TARGET_CFLAGS) -O3 +DIRECTFB2_CXXFLAGS = $(TARGET_CFLAGS) -O3 +DIRECTFB2_CONF_OPTS += -Dneon=false + +ifeq ($(BR2_GCC_ENABLE_LTO),y) +DIRECTFB2_CFLAGS += -flto +DIRECTFB2_CXXFLAGS += -flto +endif + +ifeq ($(BR2_PACKAGE_DIRECTFB2_MULTI),y) +DIRECTFB2_CONF_OPTS += -Dmulti=true +endif + +ifeq ($(BR2_PACKAGE_DIRECTFB2_MULTI_KERNEL),y) +DIRECTFB2_CONF_OPTS += -Dmulti-kernel=true +endif + +ifeq ($(BR2_PACKAGE_DIRECTFB2_DRMKMS),y) +DIRECTFB2_CONF_OPTS += -Ddrmkms=true +DIRECTFB2_DEPENDENCIES += libdrm +else +DIRECTFB2_CONF_OPTS += -Ddrmkms=false +endif + +ifeq ($(BR2_PACKAGE_DIRECTFB2_FBDEV),y) +DIRECTFB2_CONF_OPTS += -Dfbdev=true +else +DIRECTFB2_CONF_OPTS += -Dfbdev=false +endif + +$(eval $(meson-package)) diff --git a/package/flux/Config.in b/package/flux/Config.in new file mode 100644 index 000000000..2f7f3029f --- /dev/null +++ b/package/flux/Config.in @@ -0,0 +1,4 @@ +config BR2_PACKAGE_FLUX + bool "flux" + help + flux diff --git a/package/flux/flux.mk b/package/flux/flux.mk new file mode 100644 index 000000000..7953b62a7 --- /dev/null +++ b/package/flux/flux.mk @@ -0,0 +1,15 @@ +################################################################################ +# +# flux +# +################################################################################ + +FLUX_VERSION = e45758aa9384b9740ff021ea952399fd113eb0e9 +FLUX_SITE = https://github.com/deniskropp/flux.git +FLUX_SITE_METHOD = git +FLUX_LICENSE = GPL-3 +FLUX_AUTORECONF = YES +HOST_FLUX_DEPENDENCIES = host-pkgconf + +$(eval $(host-autotools-package)) + diff --git a/package/sdl/Config.in b/package/sdl/Config.in index 9f1e34de5..8176dc44b 100644 --- a/package/sdl/Config.in +++ b/package/sdl/Config.in @@ -17,6 +17,10 @@ config BR2_PACKAGE_SDL_DIRECTFB bool "SDL DirectFB video driver" depends on BR2_PACKAGE_DIRECTFB +config BR2_PACKAGE_SDL_DIRECTFB2 + bool "SDL DirectFB2 video driver" + depends on BR2_PACKAGE_DIRECTFB2 + config BR2_PACKAGE_SDL_X11 bool "SDL X11 video driver" depends on BR2_PACKAGE_XORG7 diff --git a/package/sdl/sdl.mk b/package/sdl/sdl.mk index 462600deb..dfca1173c 100644 --- a/package/sdl/sdl.mk +++ b/package/sdl/sdl.mk @@ -38,10 +38,12 @@ endif ifeq ($(BR2_PACKAGE_SDL_DIRECTFB),y) SDL_DEPENDENCIES += directfb -SDL_CONF_OPTS += --enable-video-directfb=yes -SDL_CONF_ENV = ac_cv_path_DIRECTFBCONFIG=$(STAGING_DIR)/usr/bin/directfb-config -else -SDL_CONF_OPTS += --enable-video-directfb=no +SDL_CONF_OPTS += --enable-video-directfb +endif + +ifeq ($(BR2_PACKAGE_SDL_DIRECTFB2),y) +SDL_DEPENDENCIES += directfb2 +SDL_CONF_OPTS += --enable-video-directfb endif ifeq ($(BR2_PACKAGE_SDL_X11),y) diff --git a/package/sdl2/Config.in b/package/sdl2/Config.in index 2ad45e4d0..0be00f5af 100644 --- a/package/sdl2/Config.in +++ b/package/sdl2/Config.in @@ -18,6 +18,13 @@ config BR2_PACKAGE_SDL2_DIRECTFB comment "DirectFB video driver needs directfb" depends on !BR2_PACKAGE_DIRECTFB +config BR2_PACKAGE_SDL2_DIRECTFB2 + bool "SDL2: DirectFB2 video driver" + depends on BR2_PACKAGE_DIRECTFB2 + +comment "SDL2: DirectFB2 video driver needs directfb2" + depends on !BR2_PACKAGE_DIRECTFB2 + config BR2_PACKAGE_SDL2_X11 bool "X11 video driver" depends on BR2_PACKAGE_XORG7 diff --git a/package/sdl2/sdl2.mk b/package/sdl2/sdl2.mk index 633383b9e..2c7c2268c 100644 --- a/package/sdl2/sdl2.mk +++ b/package/sdl2/sdl2.mk @@ -60,8 +60,12 @@ ifeq ($(BR2_PACKAGE_SDL2_DIRECTFB),y) SDL2_DEPENDENCIES += directfb SDL2_CONF_OPTS += --enable-video-directfb SDL2_CONF_ENV = ac_cv_path_DIRECTFBCONFIG=$(STAGING_DIR)/usr/bin/directfb-config -else -SDL2_CONF_OPTS += --disable-video-directfb +endif + +ifeq ($(BR2_PACKAGE_SDL2_DIRECTFB2),y) +SDL2_DEPENDENCIES += directfb2 +SDL2_CONF_OPTS += --enable-video-directfb --disable-directfb-shared +SDL2_CONF_ENV = ac_cv_path_DIRECTFBCONFIG=$(STAGING_DIR)/usr/bin/directfb-config endif ifeq ($(BR2_PACKAGE_SDL2_OPENGLES)$(BR2_PACKAGE_RPI_USERLAND),yy)