Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Draft] Newpkg: EFL #1455

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions tur-on-device/efl/0000-add-android-as-linux.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
diff -ur orig/meson.build mod/meson.build
--- orig/meson.build 2023-12-23 16:56:36.000000000 +0100
+++ mod/meson.build 2024-12-03 14:28:29.271142623 +0100
@@ -39,7 +39,7 @@
windows = ['windows', 'cygwin']
#bsd for meson 0.46 and 0.47
bsd = ['bsd', 'freebsd', 'dragonfly', 'netbsd', 'openbsd']
-linux = ['linux']
+linux = ['linux', 'android']
osx = ['darwin']
sun = ['sunos']

27 changes: 27 additions & 0 deletions tur-on-device/efl/0001-remove-google-analytics.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
Description: Remove remote js from html docs
The html docs load remote google analytics scripts. Since this can leak local
user actions, remove it.
Author: Ross Vandegrift <[email protected]>
Origin: other
Forwarded: not-needed
Last-Update: 2018-10-11

--- a/doc/head.html
+++ b/doc/head.html
@@ -4,15 +4,7 @@
<head>
<title>$title</title>

- <!-- Global site tag (gtag.js) - Google Analytics -->
- <script async src="https://www.googletagmanager.com/gtag/js?id=UA-110876574-1"></script>
- <script>
- window.dataLayer = window.dataLayer || [];
- function gtag(){dataLayer.push(arguments);}
- gtag('js', new Date());
-
- gtag('config', 'UA-110876574-1');
- </script>
+ <!-- Google Analytics js removed from Debian packages -->

<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<link rel="icon" href="favicon.png" type="image/x-icon">
19 changes: 19 additions & 0 deletions tur-on-device/efl/0002-disable-doxygen-timestamps.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
Description: disable doxygen html timestamps
This should improve repducibility of efl-doc.
Author: Ross Vandegrift <[email protected]>
Origin: other
Forwarded: not-needed
Last-Update: 2018-06-16
---
This patch header follows DEP-3: http://dep.debian.net/deps/dep3/
--- a/doc/Doxyfile.in
+++ b/doc/Doxyfile.in
@@ -906,7 +906,7 @@
# page will contain the date and time when the page was generated. Setting
# this to NO can help when comparing the output of multiple runs.

-HTML_TIMESTAMP = YES
+HTML_TIMESTAMP = NO

# If the HTML_DYNAMIC_SECTIONS tag is set to YES then the generated HTML
# documentation will contain sections that can be hidden and shown after the
23 changes: 23 additions & 0 deletions tur-on-device/efl/0003-exactness-use-system-python3.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
Description: Use system python3
Debian's python policy requires /usr/bin/python3 for installed scripts.
Author: Ross Vandegrift <[email protected]>
Forwarded: not-needed
Last-Update: 2020-04-30
---
This patch header follows DEP-3: http://dep.debian.net/deps/dep3/
--- a/src/bin/exactness/exactness_play.in
+++ b/src/bin/exactness/exactness_play.in
@@ -1,4 +1,4 @@
-#!/usr/bin/env python3
+#!/usr/bin/python3

import argparse
import subprocess
--- a/src/bin/exactness/exactness_record.in
+++ b/src/bin/exactness/exactness_record.in
@@ -1,4 +1,4 @@
-#!/usr/bin/env python3
+#!/usr/bin/python3

import argparse
import subprocess
18 changes: 18 additions & 0 deletions tur-on-device/efl/0004-disable-chm-docs.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
Description: Disable compiled html docs
EFL supports compiled html docs for the MS Windows help system. Since these
aren't distributed, disable the build.
Author: Ross Vandegrift <[email protected]>
Forwarded: not-needed
Last-Update: 2022-08-01

--- a/doc/Doxyfile.in
+++ b/doc/Doxyfile.in
@@ -958,7 +958,7 @@
# Microsoft HTML help workshop to generate a compiled HTML help file (.chm)
# of the generated HTML documentation.

-GENERATE_HTMLHELP = YES
+GENERATE_HTMLHELP = NO

# If the GENERATE_HTMLHELP tag is set to YES, the CHM_FILE tag can
# be used to specify the file name of the resulting .chm file. You
19 changes: 19 additions & 0 deletions tur-on-device/efl/0005-disable-doc-pack.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
Description: Don't build extra binary doc package
make doc builds a binary tar.gz of the docs. It takes a while, and we
don't need it to build efl-doc.
Author: Ross Vandegrift <[email protected]>
Forwarded: not-needed
Last-Update: 2019-10-12
---
This patch header follows DEP-3: http://dep.debian.net/deps/dep3/
--- a/doc/meson.build
+++ b/doc/meson.build
@@ -189,7 +189,7 @@

run_target('doc',
command: ['echo', 'Documentation built successfully'],
- depends: compress_target,
+ depends: doc_target,
)

doxyfile_conf = configuration_data()
59 changes: 59 additions & 0 deletions tur-on-device/efl/0006-always-regen-shaders.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
Description: make shader code regeneration scripts unconditional
The EFL tarballs ship some generated source code that the Debian
package should re-generate on build. Upstream's script tries to
avoid regenerating the data, this makes it unconditional.
Author: Ross Vandegrift <[email protected]>
Origin: other
Forwarded: not-needed
Last-Update: 2020-10-05
---
This patch header follows DEP-3: http://dep.debian.net/deps/dep3/
--- a/src/lib/ector/gl/shader/gen_shaders.sh
+++ b/src/lib/ector/gl/shader/gen_shaders.sh
@@ -6,19 +6,6 @@

OUTPUT="$DIR/ector_gl_shaders.x"

-# Skip generation if there is no diff (or no git)
-if ! git rev-parse 2>> /dev/null >> /dev/null ; then exit 0 ; fi
-if git diff --quiet --exit-code -- "$DIR"
-then
- for f in gen_shaders.sh fragment.glsl vertex.glsl include.glsl; do
- if [ "$DIR/$f" -nt "$OUTPUT" ]; then
- touch "$OUTPUT"
- break
- fi
- done
- exit 0
-fi
-
# Write header
rm -f "$OUTPUT.tmp"
cat <<EOF >> $OUTPUT.tmp
@@ -31,7 +18,8 @@
m4 "$DIR/include.glsl" "$DIR/$SHD.glsl" > "$SHD.tmp"

OIFS="$IFS"
- IFS=$'\n'
+ IFS=$'
+'
echo -n "static const char ${SHD}_glsl[] =" >> "$OUTPUT.tmp"
for LINE in `cat "$SHD.tmp"` ; do
printf "\n \"$LINE\\\n\"" >> "$OUTPUT.tmp"
--- a/src/modules/evas/engines/gl_common/shader/gen_shaders.sh
+++ b/src/modules/evas/engines/gl_common/shader/gen_shaders.sh
@@ -13,14 +13,6 @@
# Skip generation if file can not be written to
if [ -e ${OUTPUT} ] && [ ! -w ${OUTPUT} ] ; then exit 0; fi

-# Skip generation if there is no diff (or no git)
-if ! git rev-parse 2>> /dev/null >> /dev/null ; then exit 0 ; fi
-if git diff --quiet --exit-code -- "$DIR"
-then
- touch "$OUTPUT"
- exit 0
-fi
-
exec 1<&-
exec 1>"$OUTPUT"

18 changes: 18 additions & 0 deletions tur-on-device/efl/0007-experimental-fix-linker.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
diff -ur orig/meson.build mod/meson.build
--- orig/meson.build 2024-12-03 14:28:29.271142623 +0100
+++ mod/meson.build 2025-01-20 19:58:06.225374544 +0100
@@ -4,6 +4,9 @@
meson_version : '>=0.50'
)

+add_project_link_arguments('-L/data/data/com.termux/files/usr/lib', language: 'c')
+add_project_link_arguments('-landroid-shmem', language: 'c')
+
if host_machine.system() == 'darwin'
add_languages('objc')
endif
@@ -677,3 +680,4 @@
requires : libraries,
)
endforeach
+
72 changes: 72 additions & 0 deletions tur-on-device/efl/0008-experimental-shm-support.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
diff -ur orig/src/modules/ecore_evas/engines/extn/ecore_evas_extn_buf.c mod/src/modules/ecore_evas/engines/extn/ecore_evas_extn_buf.c
--- orig/src/modules/ecore_evas/engines/extn/ecore_evas_extn_buf.c 2023-12-23 16:56:36.000000000 +0100
+++ mod/src/modules/ecore_evas/engines/extn/ecore_evas_extn_buf.c 2025-01-20 20:13:29.609463916 +0100
@@ -4,6 +4,43 @@
# define O_BINARY 0
#endif

+static int termux_shm_unlink(const char *name) {
+ size_t namelen;
+ char *fname;
+
+ /* Construct the filename. */
+ while (name[0] == '/') ++name;
+
+ if (name[0] == '\0') {
+ /* The name "/" is not supported. */
+ errno = EINVAL;
+ return -1;
+ }
+
+ namelen = strlen(name);
+ fname = (char *) alloca(sizeof("@TERMUX_PREFIX@/tmp/") - 1 + namelen + 1);
+ memcpy(fname, "@TERMUX_PREFIX@/tmp/", sizeof("@TERMUX_PREFIX@/tmp/") - 1);
+ memcpy(fname + sizeof("@TERMUX_PREFIX@/tmp/") - 1, name, namelen + 1);
+
+ return unlink(fname);
+}
+
+static int termux_shm_open(const char *name, int oflag, mode_t mode) {
+ size_t namelen;
+ char *fname;
+ int fd;
+
+ /* Construct the filename. */
+ while (name[0] == '/') ++name;
+
+ if (name[0] == '\0') {
+ /* The name "/" is not supported. */
+ errno = EINVAL;
+ return -1;
+ }
+}
+
+
struct _Extnbuf
{
const char *file, *lock;
@@ -57,13 +94,13 @@
if (b->lockfd < 0) goto err;
b->lock = eina_stringshare_add(tmp);
if (!b->lock) goto err;
- b->fd = shm_open(b->file, O_RDWR | O_CREAT | O_EXCL, mode);
+ b->fd = termux_shm_open(b->file, O_RDWR | O_CREAT | O_EXCL, mode);
if (b->fd < 0) goto err;
if (ftruncate(b->fd, b->size) < 0) goto err;
}
else
{
- b->fd = shm_open(b->file, O_RDONLY, mode);
+ b->fd = termux_shm_open(b->file, O_RDONLY, mode);
if (b->fd < 0) goto err;
}
b->addr = mmap(NULL, b->size, prot, MAP_SHARED, b->fd, 0);
@@ -83,7 +120,7 @@

if (b->am_owner)
{
- if (b->file) shm_unlink(b->file);
+ if (b->file) termux_shm_unlink(b->file);
if (b->lock) unlink(b->lock);
}

111 changes: 111 additions & 0 deletions tur-on-device/efl/0009-experimental-fix-pthread.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,111 @@
diff -ur orig/src/lib/eina/eina_debug_timer.c mod/src/lib/eina/eina_debug_timer.c
--- orig/src/lib/eina/eina_debug_timer.c 2025-01-11 21:08:11.000000000 +0100
+++ mod/src/lib/eina/eina_debug_timer.c 2025-01-21 21:18:36.155542280 +0100
@@ -105,7 +105,7 @@
while (1)
{
int timeout = -1; //in milliseconds
- pthread_testcancel();
+ //pthread_testcancel();
eina_spinlock_take(&_lock);
if (_timers)
{
@@ -115,7 +115,7 @@
eina_spinlock_release(&_lock);

ret = epoll_wait(epfd, events, MAX_EVENTS, timeout);
- pthread_testcancel();
+ //pthread_testcancel();

/* Some timer has been add/removed or we need to exit */
if (ret)
@@ -228,7 +228,7 @@
close(pipeToThread[0]);
close(pipeToThread[1]);
if (_thread_runs)
- pthread_cancel(_thread);
+ pthread_kill(_thread, SIGUSR2);
_thread_runs = 0;
eina_spinlock_release(&_lock);
eina_spinlock_free(&_lock);
diff -ur orig/src/lib/eina/eina_thread_posix.c mod/src/lib/eina/eina_thread_posix.c
--- orig/src/lib/eina/eina_thread_posix.c 2025-01-11 21:08:11.000000000 +0100
+++ mod/src/lib/eina/eina_thread_posix.c 2025-01-21 21:19:56.666136007 +0100
@@ -56,7 +56,16 @@

#define RTNICENESS 1
#define NICENESS 5
+#define PTHREAD_CANCELED ((void *)-1)
+#define true 1
+#define false 0

+#ifdef __ANDROID__
+static void thread_signal_handler(int signum)
+{
+ pthread_exit(0);
+}
+#endif

static inline void *
_eina_thread_join(Eina_Thread t)
@@ -278,15 +287,16 @@
eina_thread_cancel(Eina_Thread t)
{
if (!t) return EINA_FALSE;
- return pthread_cancel((pthread_t)t) == 0;
+ return pthread_kill((pthread_t)t, SIGTERM) == 0;
}

-EINA_API Eina_Bool
-eina_thread_cancellable_set(Eina_Bool cancellable, Eina_Bool *was_cancellable)
+//EINA_API Eina_Bool
+Eina_Bool eina_thread_cancellable_set(Eina_Bool cancellable, Eina_Bool *was_cancellable)
{
- int state = cancellable ? PTHREAD_CANCEL_ENABLE : PTHREAD_CANCEL_DISABLE;
- int old = 0;
- int r;
+#ifndef __ANDROID__
+ int state = cancellable ? PTHREAD_CANCEL_ENABLE : PTHREAD_CANCEL_DISABLE;
+ int old = 0;
+ int r;

/* enforce deferred in case users changed to asynchronous themselves */
pthread_setcanceltype(PTHREAD_CANCEL_DEFERRED, &old);
@@ -296,12 +306,36 @@
*was_cancellable = (old == PTHREAD_CANCEL_ENABLE);

return r == 0;
+#else
+ static int old_cancellable = 0;
+ struct sigaction actions;
+
+ if (was_cancellable)
+ *was_cancellable = old_cancellable;
+
+ if (cancellable) {
+ memset(&actions, 0, sizeof(actions));
+ sigemptyset(&actions.sa_mask);
+ actions.sa_flags = 0;
+ actions.sa_handler = thread_signal_handler;
+ sigaction(SIGUSR2, &actions, NULL);
+ old_cancellable = 1;
+ } else {
+ memset(&actions, 0, sizeof(actions));
+ sigemptyset(&actions.sa_mask);
+ actions.sa_handler = SIG_IGN;
+ sigaction(SIGUSR2, &actions, NULL);
+ old_cancellable = 0;
+ }
+
+ return true;
+#endif
}

EINA_API void
eina_thread_cancel_checkpoint(void)
{
- pthread_testcancel();
+ //pthread_testcancel();
}

EINA_API const void *EINA_THREAD_JOIN_CANCELED = PTHREAD_CANCELED;
Loading