aboutsummaryrefslogtreecommitdiffstats
path: root/community/directfb
diff options
context:
space:
mode:
authorLeo <thinkabit.ukim@gmail.com>2020-04-05 04:24:02 -0300
committerLeo <thinkabit.ukim@gmail.com>2020-04-05 13:58:11 -0300
commit74680ad6fd59734c71147838c7d2a46047ed3a86 (patch)
treecf873b6bb8db7ca30a2e5b66b0e91319db349fe2 /community/directfb
parent3f0572d684cfc7a208c87605d09a8b3c9db0dfca (diff)
downloadaports-74680ad6fd59734c71147838c7d2a46047ed3a86.tar.bz2
aports-74680ad6fd59734c71147838c7d2a46047ed3a86.tar.xz
community/directfb: move from main
Diffstat (limited to 'community/directfb')
-rw-r--r--community/directfb/0001-directfb-fix-musl-compile.patch11
-rw-r--r--community/directfb/0002-Fix-musl-PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP-comp.patch47
-rw-r--r--community/directfb/0003-remove-set-gamma-ramp.patch23
-rw-r--r--community/directfb/0004-disable-fusion_dispatch.patch13
-rw-r--r--community/directfb/0005-fix-tslib-configure.patch14
-rw-r--r--community/directfb/0006-fix-client-gfx_state-initialisation.patch39
-rw-r--r--community/directfb/0007-tslib-Automatically-detect-touchscreens-using-ts_setup.patch31
-rw-r--r--community/directfb/APKBUILD62
8 files changed, 240 insertions, 0 deletions
diff --git a/community/directfb/0001-directfb-fix-musl-compile.patch b/community/directfb/0001-directfb-fix-musl-compile.patch
new file mode 100644
index 0000000000..b5de895e7f
--- /dev/null
+++ b/community/directfb/0001-directfb-fix-musl-compile.patch
@@ -0,0 +1,11 @@
+--- a/lib/direct/os/linux/glibc/system.c
++++ b/lib/direct/os/linux/glibc/system.c
+@@ -111,7 +111,7 @@ direct_tgkill( int tgid, int tid, int sig )
+ void
+ direct_trap( const char *domain, int sig )
+ {
+- sigval_t val;
++ union sigval val;
+
+ if (direct_config->delay_trap_ms) {
+ D_LOG( Direct_Trap, VERBOSE, "NOT RAISING signal %d from %s, waiting for %dms... attach gdb --pid=%d\n", sig, domain, direct_config->delay_trap_ms, getpid() );
diff --git a/community/directfb/0002-Fix-musl-PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP-comp.patch b/community/directfb/0002-Fix-musl-PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP-comp.patch
new file mode 100644
index 0000000000..03b087fc2c
--- /dev/null
+++ b/community/directfb/0002-Fix-musl-PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP-comp.patch
@@ -0,0 +1,47 @@
+--- a/lib/direct/os/linux/glibc/mutex.h
++++ b/lib/direct/os/linux/glibc/mutex.h
+@@ -46,7 +46,6 @@ struct __D_DirectMutex {
+ /**********************************************************************************************************************/
+
+ #define DIRECT_MUTEX_INITIALIZER(name) { PTHREAD_MUTEX_INITIALIZER }
+-#define DIRECT_RECURSIVE_MUTEX_INITIALIZER(name) { PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP }
+
+ #endif
+
+--- a/lib/direct/trace.c
++++ b/lib/direct/trace.c
+@@ -89,7 +89,7 @@ struct __D_DirectTraceBuffer {
+ /**************************************************************************************************/
+
+ static DirectLink *buffers;
+-static DirectMutex buffers_lock = DIRECT_RECURSIVE_MUTEX_INITIALIZER(buffers_lock);
++static DirectMutex buffers_lock = DIRECT_MUTEX_INITIALIZER(buffers_lock);
+
+ /**************************************************************************************************/
+
+--- a/src/directfb.c
++++ b/src/directfb.c
+@@ -163,6 +163,15 @@ DirectFBSetOption( const char *name, const char *value )
+ return DFB_OK;
+ }
+
++
++static pthread_once_t lock_init_once = PTHREAD_ONCE_INIT;
++static DirectMutex lock;
++
++static void lock_init(void)
++{
++ direct_recursive_mutex_init(&lock);
++}
++
+ /*
+ * Programs have to call this to get the super interface
+ * which is needed to access other functions
+@@ -215,7 +224,7 @@ DirectFBCreate( IDirectFB **interface_ptr )
+ if (dfb_config->remote.host)
+ return CreateRemote( dfb_config->remote.host, dfb_config->remote.port, interface_ptr );
+
+- static DirectMutex lock = DIRECT_RECURSIVE_MUTEX_INITIALIZER(lock);
++ pthread_once(&lock_init_once, lock_init);
+
+ direct_mutex_lock( &lock );
diff --git a/community/directfb/0003-remove-set-gamma-ramp.patch b/community/directfb/0003-remove-set-gamma-ramp.patch
new file mode 100644
index 0000000000..652c5a1683
--- /dev/null
+++ b/community/directfb/0003-remove-set-gamma-ramp.patch
@@ -0,0 +1,23 @@
+--- a/systems/fbdev/fbdev.c
++++ b/systems/fbdev/fbdev.c
+@@ -2327,14 +2327,18 @@ dfb_fbdev_set_gamma_ramp( DFBSurfacePixelFormat format )
+ for (i = 0; i < blue_size; i++)
+ cmap->blue[i] |= cmap->blue[i] << 8;
+ }
+-
++ /*
++ * Commenting out section setting gamma ramp
++ * per: http://directfb-users.directfb.narkive.com/fUkXSRmm/hello
++ */
++ /*
+ if (FBDEV_IOCTL( FBIOPUTCMAP, cmap ) < 0) {
+ D_PERROR( "DirectFB/FBDev: "
+ "Could not set gamma ramp" );
+
+ return errno2result(errno);
+ }
+-
++ */
+ return DFB_OK;
+ }
+
diff --git a/community/directfb/0004-disable-fusion_dispatch.patch b/community/directfb/0004-disable-fusion_dispatch.patch
new file mode 100644
index 0000000000..900f9bbb93
--- /dev/null
+++ b/community/directfb/0004-disable-fusion_dispatch.patch
@@ -0,0 +1,13 @@
+diff --git a/src/core/core.c b/src/core/core.c
+index 6676bee..933f0fc 100644
+--- a/src/core/core.c
++++ b/src/core/core.c
+@@ -1737,7 +1737,7 @@ dfb_core_shutdown( CoreDFB *core, bool emergency )
+ dfb_gfx_cleanup();
+
+ while (loops--) {
+- fusion_dispatch( core->world, 16384 );
++ //fusion_dispatch( core->world, 16384 );
+
+ ret = dfb_core_wait_all( core, 10000 );
+ if (ret == DFB_OK)
diff --git a/community/directfb/0005-fix-tslib-configure.patch b/community/directfb/0005-fix-tslib-configure.patch
new file mode 100644
index 0000000000..d612ee93c8
--- /dev/null
+++ b/community/directfb/0005-fix-tslib-configure.patch
@@ -0,0 +1,14 @@
+--- a/configure.in
++++ b/configure.in
+@@ -2459,9 +2459,9 @@
+
+ enable_tslib=no
+ if test "$checkfor_tslib" = "yes"; then
+- PKG_CHECK_MODULES([TSLIB], [tslib-1.0 >= 1.0.0], [enable_tslib=yes], [enable_tslib=no])
++ PKG_CHECK_MODULES([TSLIB], [tslib >= 1.0.0], [enable_tslib=yes], [enable_tslib=no])
+ if test "$enable_tslib" = "no"; then
+- PKG_CHECK_MODULES([TSLIB], [tslib-0.0], [enable_tslib=yes], [enable_tslib=no
++ PKG_CHECK_MODULES([TSLIB], [tslib], [enable_tslib=yes], [enable_tslib=no
+ AC_MSG_WARN([*** no tslib -- tslib driver will not be built.])])
+ fi
+ fi
diff --git a/community/directfb/0006-fix-client-gfx_state-initialisation.patch b/community/directfb/0006-fix-client-gfx_state-initialisation.patch
new file mode 100644
index 0000000000..5b7a202ca3
--- /dev/null
+++ b/community/directfb/0006-fix-client-gfx_state-initialisation.patch
@@ -0,0 +1,39 @@
+From 8e53c0b9cedb62b82e2b7680d793d433b647ae20 Mon Sep 17 00:00:00 2001
+From: Andre McCurdy <armccurdy@gmail.com>
+Date: Mon, 13 Jun 2016 13:32:44 -0700
+Subject: [PATCH] fix client->gfx_state initialisation
+
+Shortly before the DirectFB 1.7.7 release, an optimisation was added
+to CoreGraphicsStateClient_Init() to avoid creating an extended
+Graphics State object if it will not later be required:
+
+ 4d422fb Client: Create extended Graphics State object when needed for later usage
+
+Unfortunately the client->gfx_state variable used to track the
+extended Graphics State object is not initialised, which can lead to
+crashes etc due to creation of the Graphics State object erroneously
+being skipped.
+
+Upstream-Status: Pending
+
+Signed-off-by: Andre McCurdy <armccurdy@gmail.com>
+Signed-off-by: Philippe Reynes <philippe.reynes@sagemcom.com>
+---
+ src/core/CoreGraphicsStateClient.cpp | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/src/core/CoreGraphicsStateClient.cpp b/src/core/CoreGraphicsStateClient.cpp
+index 5d46f0e..5007755 100644
+--- a/src/core/CoreGraphicsStateClient.cpp
++++ b/src/core/CoreGraphicsStateClient.cpp
+@@ -364,6 +364,7 @@ CoreGraphicsStateClient_Init( CoreGraphicsStateClient *client,
+ client->renderer = NULL;
+ client->requestor = NULL;
+ client->throttle = NULL;
++ client->gfx_state = NULL;
+
+ if (dfb_config->task_manager) {
+ if (dfb_config->call_nodirect) {
+--
+1.9.1
+
diff --git a/community/directfb/0007-tslib-Automatically-detect-touchscreens-using-ts_setup.patch b/community/directfb/0007-tslib-Automatically-detect-touchscreens-using-ts_setup.patch
new file mode 100644
index 0000000000..d84cc93e06
--- /dev/null
+++ b/community/directfb/0007-tslib-Automatically-detect-touchscreens-using-ts_setup.patch
@@ -0,0 +1,31 @@
+diff --git a/inputdrivers/tslib/tslib.c b/inputdrivers/tslib/tslib.c
+index a06cd68c6..8d355a804 100644
+--- a/inputdrivers/tslib/tslib.c
++++ b/inputdrivers/tslib/tslib.c
+@@ -152,6 +152,7 @@ driver_get_available(void)
+ {
+ int i;
+ char *tsdev;
++ struct tsdev *ts;
+
+ /* Use the devices specified in the configuration. */
+ if (fusion_vector_has_elements( &dfb_config->tslib_devices )) {
+@@ -168,10 +169,15 @@ driver_get_available(void)
+ return num_devices;
+ }
+
+- /* Check for environment variable. */
+- tsdev = getenv( "TSLIB_TSDEVICE" );
+- if (tsdev && check_device( tsdev ))
++ /* Ask tslib for a device (TSLIB_TSDEVICE is checked in ts_setup) */
++ ts = ts_setup( NULL, 0 );
++ if (ts) {
++ /* No need to check_device() - already done by tslib */
++ tsdev = ts_get_eventpath( ts );
++ D_INFO( "DirectFB/tslib: Found touchscreen: '%s'\n", tsdev );
+ device_names[num_devices++] = D_STRDUP( tsdev );
++ ts_close( ts );
++ }
+
+ /* Try to guess some (more) devices. */
+ for (i = 0; i < MAX_TSLIB_DEVICES; i++) {
diff --git a/community/directfb/APKBUILD b/community/directfb/APKBUILD
new file mode 100644
index 0000000000..3b069d25d7
--- /dev/null
+++ b/community/directfb/APKBUILD
@@ -0,0 +1,62 @@
+# Contributor: Clayton Craft <clayton@craftyguy.net>
+# Maintainer: Clayton Craft <clayton@craftyguy.net>
+pkgname=directfb
+pkgver=1.7.7
+pkgrel=2
+pkgdesc="Library for hw graphics acceleration, input dev, windowing system on top of the Linux fb device"
+arch="all"
+url="https://github.com/DirectFB/directfb"
+license="LGPL-2.0-or-later"
+makedepends="zlib-dev freetype-dev libdrm-dev libpng-dev perl tslib tslib-dev autoconf automake libtool"
+subpackages="$pkgname-doc $pkgname-static $pkgname-dev"
+builddir="$srcdir/DirectFB-$pkgver"
+source="
+ http://sources.webos-ports.org/DirectFB-$pkgver.tar.gz
+ 0001-directfb-fix-musl-compile.patch
+ 0002-Fix-musl-PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP-comp.patch
+ 0003-remove-set-gamma-ramp.patch
+ 0004-disable-fusion_dispatch.patch
+ 0005-fix-tslib-configure.patch
+ 0006-fix-client-gfx_state-initialisation.patch
+ 0007-tslib-Automatically-detect-touchscreens-using-ts_setup.patch
+ "
+
+prepare() {
+ default_prepare
+ autoconf
+}
+
+build() {
+ ./configure \
+ --prefix=/usr \
+ --sysconfdir=/etc \
+ --enable-static \
+ --disable-zlib \
+ --disable-x11 \
+ --enable-fbdev \
+ --disable-vnc \
+ --disable-osx \
+ --disable-mesa \
+ --enable-drmkms \
+ --enable-freetype \
+ --with-inputdrivers=input_hub,keyboard,linuxinput,ps2mouse,serialmouse,tslib \
+ --with-gfxdrivers=omap
+ make
+}
+
+check() {
+ make check
+}
+
+package() {
+ make DESTDIR="$pkgdir" install
+}
+
+sha512sums="c9ce8ffe7d7d17b0351da6a031db7345f31fb7112545f9352834ad33225a93e6284ef0e576ef5fc595bc9060c1756051322fa20f7b5b3444b68d7f05bd1ba494 DirectFB-1.7.7.tar.gz
+d9325c228a534d2d2b93b4dacf896fc12c703b9e08adf1ae8f5baea2a0ed5c4d07d56b8bc63dc605362f093624eab40686b43028ef15a78a01bc10e5f41c16bc 0001-directfb-fix-musl-compile.patch
+ed3bf9bf76616174aca6ae92fd9873c9452951b8a2acb60e1ccbbea0c4a7c9766e510899bc8f58c24dd5888c1e7e1f0a0d4a823f0bd9e03a4c9d2a54fb714221 0002-Fix-musl-PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP-comp.patch
+bd1d0738c48411e8e065b8a250c1b31334ac65b26a8f6c91d5ad167a4d8fdac1de862c05940567e48fc740dd45fbecf906ebdfbff63420d4f86bee7a3a0746ee 0003-remove-set-gamma-ramp.patch
+d68002702f3521a71405bb403b874dced5b123a2de037c9eb05667123a578c0e9a9f13a822fd8d77e31a83f1e1cc8df1d8511f7d2f427688d5ef6ae0fff448c5 0004-disable-fusion_dispatch.patch
+c768ca7a4dae7fc0cd7d4fa559ab74adb6b5f21245e0f9b5d56af15b20effc04e6739e86d52d65c902c5e76ad72e966cd9db68f57a9bad11a004525825d443a4 0005-fix-tslib-configure.patch
+6b118928c2ebe58654e1bf32433b084f4dc150526eec1b53f9eb4b856aee25733bd8d6114fde973fcb64416e4146f458cdb75e5836d7507cf802b84e44544462 0006-fix-client-gfx_state-initialisation.patch
+43000c629eb24bd6b88d284dc010ea5a2a3facbf9498ab752127c25a890fd52b9a29a09d46264befea9fef19dcfe6f24d6cefa103a68d4c2ab185b6142a5c1b9 0007-tslib-Automatically-detect-touchscreens-using-ts_setup.patch"