diff --git a/tur-on-device/efl/0000-add-android-as-linux.patch b/tur-on-device/efl/0000-add-android-as-linux.patch new file mode 100644 index 0000000000..a18c901259 --- /dev/null +++ b/tur-on-device/efl/0000-add-android-as-linux.patch @@ -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'] + diff --git a/tur-on-device/efl/0001-remove-google-analytics.patch b/tur-on-device/efl/0001-remove-google-analytics.patch new file mode 100644 index 0000000000..e7c0c59923 --- /dev/null +++ b/tur-on-device/efl/0001-remove-google-analytics.patch @@ -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 +Origin: other +Forwarded: not-needed +Last-Update: 2018-10-11 + +--- a/doc/head.html ++++ b/doc/head.html +@@ -4,15 +4,7 @@ + + $title + +- +- +- ++ + + + diff --git a/tur-on-device/efl/0002-disable-doxygen-timestamps.patch b/tur-on-device/efl/0002-disable-doxygen-timestamps.patch new file mode 100644 index 0000000000..a15c004bfd --- /dev/null +++ b/tur-on-device/efl/0002-disable-doxygen-timestamps.patch @@ -0,0 +1,19 @@ +Description: disable doxygen html timestamps + This should improve repducibility of efl-doc. +Author: Ross Vandegrift +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 diff --git a/tur-on-device/efl/0003-exactness-use-system-python3.patch b/tur-on-device/efl/0003-exactness-use-system-python3.patch new file mode 100644 index 0000000000..952dbb8403 --- /dev/null +++ b/tur-on-device/efl/0003-exactness-use-system-python3.patch @@ -0,0 +1,23 @@ +Description: Use system python3 + Debian's python policy requires /usr/bin/python3 for installed scripts. +Author: Ross Vandegrift +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 diff --git a/tur-on-device/efl/0004-disable-chm-docs.patch b/tur-on-device/efl/0004-disable-chm-docs.patch new file mode 100644 index 0000000000..80cd5fd1a7 --- /dev/null +++ b/tur-on-device/efl/0004-disable-chm-docs.patch @@ -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 +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 diff --git a/tur-on-device/efl/0005-disable-doc-pack.patch b/tur-on-device/efl/0005-disable-doc-pack.patch new file mode 100644 index 0000000000..1ce1f35469 --- /dev/null +++ b/tur-on-device/efl/0005-disable-doc-pack.patch @@ -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 +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() diff --git a/tur-on-device/efl/0006-always-regen-shaders.patch b/tur-on-device/efl/0006-always-regen-shaders.patch new file mode 100644 index 0000000000..9a83298e56 --- /dev/null +++ b/tur-on-device/efl/0006-always-regen-shaders.patch @@ -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 +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 <> $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" + diff --git a/tur-on-device/efl/0007-experimental-fix-linker.patch b/tur-on-device/efl/0007-experimental-fix-linker.patch new file mode 100644 index 0000000000..6f7c011855 --- /dev/null +++ b/tur-on-device/efl/0007-experimental-fix-linker.patch @@ -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 ++ diff --git a/tur-on-device/efl/0008-experimental-shm-support.patch b/tur-on-device/efl/0008-experimental-shm-support.patch new file mode 100644 index 0000000000..96e409c82a --- /dev/null +++ b/tur-on-device/efl/0008-experimental-shm-support.patch @@ -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); + } + diff --git a/tur-on-device/efl/0009-experimental-fix-pthread.patch b/tur-on-device/efl/0009-experimental-fix-pthread.patch new file mode 100644 index 0000000000..fbccd8a1b3 --- /dev/null +++ b/tur-on-device/efl/0009-experimental-fix-pthread.patch @@ -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; diff --git a/tur-on-device/efl/0010-experimental-fix-getpwent.patch b/tur-on-device/efl/0010-experimental-fix-getpwent.patch new file mode 100644 index 0000000000..873254e014 --- /dev/null +++ b/tur-on-device/efl/0010-experimental-fix-getpwent.patch @@ -0,0 +1,13 @@ +diff -ur orig/src/lib/ethumb/ethumb.c mod/src/lib/ethumb/ethumb.c +--- orig/src/lib/ethumb/ethumb.c 2025-01-11 21:08:11.000000000 +0100 ++++ mod/src/lib/ethumb/ethumb.c 2025-01-21 20:56:32.975685953 +0100 +@@ -269,7 +269,8 @@ + #if defined(HAVE_GETUID) && defined(HAVE_GETEUID) + else + { +- struct passwd *pw = getpwent(); ++ uid_t uid = getuid(); ++ struct passwd *pw = getpwuid(uid); + + if ((!pw) || (!pw->pw_dir)) goto error_plugins_ext; + snprintf(buf, sizeof(buf), "%s/.thumbnails", pw->pw_dir); diff --git a/tur-on-device/efl/build.sh b/tur-on-device/efl/build.sh new file mode 100644 index 0000000000..d4b72a1827 --- /dev/null +++ b/tur-on-device/efl/build.sh @@ -0,0 +1,38 @@ +TERMUX_PKG_HOMEPAGE=https://www.enlightenment.org +TERMUX_PKG_DESCRIPTION="The Enlightenment Foundation Libraries (EFL) is a stack of libraries providing a wide degree of functionality. Originally written to support development of the Enlightenment window manager, the libraries have increasingly been used in embedded systems." +TERMUX_PKG_LICENSE="GPL-2.0" +TERMUX_PKG_MAINTAINER="@termux-user-repository" +TERMUX_PKG_VERSION=1.28.0 +TERMUX_PKG_SRCURL="https://download.enlightenment.org/rel/libs/efl/efl-$TERMUX_PKG_VERSION.tar.xz" +TERMUX_PKG_SHA256="f09a43d6b4861be06cc0e2849c53296413d4e52c8e31f52fc95e9ea5f1c59a36" +TERMUX_PKG_DEPENDS="libjpeg-turbo, libluajit, dbus, libsndfile, pulseaudio, libxcomposite, libxdamage, libxinerama, libxtst, libxcursor, libtiff, giflib, libwebp, openjpeg, fribidi, harfbuzz, lua52, poppler, libspectre, libraw, librsvg, libxi, libandroid-shmem, gstreamer, bison, gst-plugins-base, libwayland-protocols, libxrandr, libxkbcommon" +TERMUX_PKG_EXTRA_CONFIGURE_ARGS="-Deeze=false -Dsystemd=false -Dinput=false -Dwl=true -Decore-imf-loaders-disabler=['ibus','scim']" +TERMUX_PKG_BUILD_IN_SRC=true +TERMUX_PKG_RM_AFTER_INSTALL=" +lib/python3.12/__pycache__/cProfile.cpython-312.pyc +lib/python3.12/__pycache__/profile.cpython-312.pyc +lib/python3.12/__pycache__/tarfile.cpython-312.pyc +" + +termux_step_pre_configure() { + if [[ "$TERMUX_ARCH" = arm ]] ; then + TERMUX_PKG_EXTRA_CONFIGURE_ARGS+=" -Dnative-arch-optimization=false" + fi + + if [ "${TERMUX_ON_DEVICE_BUILD}" = false ]; then + termux_error_exit "This package doesn't support cross-compiling." + fi +} + +termux_step_configure() { + termux_setup_meson + $TERMUX_MESON build --prefix $TERMUX_PREFIX $TERMUX_PKG_EXTRA_CONFIGURE_ARGS +} + +termux_step_make() { + termux_setup_ninja + cd build + ninja \ + -j ${TERMUX_PKG_MAKE_PROCESSES} \ + install +}