Skip to content

Commit 1c0bc47

Browse files
fervifervi
authored andcommitted
NewPkg: EFL
1 parent 34d328d commit 1c0bc47

12 files changed

+427
-0
lines changed
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
diff -ur orig/meson.build mod/meson.build
2+
--- orig/meson.build 2023-12-23 16:56:36.000000000 +0100
3+
+++ mod/meson.build 2024-12-03 14:28:29.271142623 +0100
4+
@@ -39,7 +39,7 @@
5+
windows = ['windows', 'cygwin']
6+
#bsd for meson 0.46 and 0.47
7+
bsd = ['bsd', 'freebsd', 'dragonfly', 'netbsd', 'openbsd']
8+
-linux = ['linux']
9+
+linux = ['linux', 'android']
10+
osx = ['darwin']
11+
sun = ['sunos']
12+
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
Description: Remove remote js from html docs
2+
The html docs load remote google analytics scripts. Since this can leak local
3+
user actions, remove it.
4+
Author: Ross Vandegrift <[email protected]>
5+
Origin: other
6+
Forwarded: not-needed
7+
Last-Update: 2018-10-11
8+
9+
--- a/doc/head.html
10+
+++ b/doc/head.html
11+
@@ -4,15 +4,7 @@
12+
<head>
13+
<title>$title</title>
14+
15+
- <!-- Global site tag (gtag.js) - Google Analytics -->
16+
- <script async src="https://www.googletagmanager.com/gtag/js?id=UA-110876574-1"></script>
17+
- <script>
18+
- window.dataLayer = window.dataLayer || [];
19+
- function gtag(){dataLayer.push(arguments);}
20+
- gtag('js', new Date());
21+
-
22+
- gtag('config', 'UA-110876574-1');
23+
- </script>
24+
+ <!-- Google Analytics js removed from Debian packages -->
25+
26+
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
27+
<link rel="icon" href="favicon.png" type="image/x-icon">
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
Description: disable doxygen html timestamps
2+
This should improve repducibility of efl-doc.
3+
Author: Ross Vandegrift <[email protected]>
4+
Origin: other
5+
Forwarded: not-needed
6+
Last-Update: 2018-06-16
7+
---
8+
This patch header follows DEP-3: http://dep.debian.net/deps/dep3/
9+
--- a/doc/Doxyfile.in
10+
+++ b/doc/Doxyfile.in
11+
@@ -906,7 +906,7 @@
12+
# page will contain the date and time when the page was generated. Setting
13+
# this to NO can help when comparing the output of multiple runs.
14+
15+
-HTML_TIMESTAMP = YES
16+
+HTML_TIMESTAMP = NO
17+
18+
# If the HTML_DYNAMIC_SECTIONS tag is set to YES then the generated HTML
19+
# documentation will contain sections that can be hidden and shown after the
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
Description: Use system python3
2+
Debian's python policy requires /usr/bin/python3 for installed scripts.
3+
Author: Ross Vandegrift <[email protected]>
4+
Forwarded: not-needed
5+
Last-Update: 2020-04-30
6+
---
7+
This patch header follows DEP-3: http://dep.debian.net/deps/dep3/
8+
--- a/src/bin/exactness/exactness_play.in
9+
+++ b/src/bin/exactness/exactness_play.in
10+
@@ -1,4 +1,4 @@
11+
-#!/usr/bin/env python3
12+
+#!/usr/bin/python3
13+
14+
import argparse
15+
import subprocess
16+
--- a/src/bin/exactness/exactness_record.in
17+
+++ b/src/bin/exactness/exactness_record.in
18+
@@ -1,4 +1,4 @@
19+
-#!/usr/bin/env python3
20+
+#!/usr/bin/python3
21+
22+
import argparse
23+
import subprocess
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
Description: Disable compiled html docs
2+
EFL supports compiled html docs for the MS Windows help system. Since these
3+
aren't distributed, disable the build.
4+
Author: Ross Vandegrift <[email protected]>
5+
Forwarded: not-needed
6+
Last-Update: 2022-08-01
7+
8+
--- a/doc/Doxyfile.in
9+
+++ b/doc/Doxyfile.in
10+
@@ -958,7 +958,7 @@
11+
# Microsoft HTML help workshop to generate a compiled HTML help file (.chm)
12+
# of the generated HTML documentation.
13+
14+
-GENERATE_HTMLHELP = YES
15+
+GENERATE_HTMLHELP = NO
16+
17+
# If the GENERATE_HTMLHELP tag is set to YES, the CHM_FILE tag can
18+
# be used to specify the file name of the resulting .chm file. You
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
Description: Don't build extra binary doc package
2+
make doc builds a binary tar.gz of the docs. It takes a while, and we
3+
don't need it to build efl-doc.
4+
Author: Ross Vandegrift <[email protected]>
5+
Forwarded: not-needed
6+
Last-Update: 2019-10-12
7+
---
8+
This patch header follows DEP-3: http://dep.debian.net/deps/dep3/
9+
--- a/doc/meson.build
10+
+++ b/doc/meson.build
11+
@@ -189,7 +189,7 @@
12+
13+
run_target('doc',
14+
command: ['echo', 'Documentation built successfully'],
15+
- depends: compress_target,
16+
+ depends: doc_target,
17+
)
18+
19+
doxyfile_conf = configuration_data()
Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
Description: make shader code regeneration scripts unconditional
2+
The EFL tarballs ship some generated source code that the Debian
3+
package should re-generate on build. Upstream's script tries to
4+
avoid regenerating the data, this makes it unconditional.
5+
Author: Ross Vandegrift <[email protected]>
6+
Origin: other
7+
Forwarded: not-needed
8+
Last-Update: 2020-10-05
9+
---
10+
This patch header follows DEP-3: http://dep.debian.net/deps/dep3/
11+
--- a/src/lib/ector/gl/shader/gen_shaders.sh
12+
+++ b/src/lib/ector/gl/shader/gen_shaders.sh
13+
@@ -6,19 +6,6 @@
14+
15+
OUTPUT="$DIR/ector_gl_shaders.x"
16+
17+
-# Skip generation if there is no diff (or no git)
18+
-if ! git rev-parse 2>> /dev/null >> /dev/null ; then exit 0 ; fi
19+
-if git diff --quiet --exit-code -- "$DIR"
20+
-then
21+
- for f in gen_shaders.sh fragment.glsl vertex.glsl include.glsl; do
22+
- if [ "$DIR/$f" -nt "$OUTPUT" ]; then
23+
- touch "$OUTPUT"
24+
- break
25+
- fi
26+
- done
27+
- exit 0
28+
-fi
29+
-
30+
# Write header
31+
rm -f "$OUTPUT.tmp"
32+
cat <<EOF >> $OUTPUT.tmp
33+
@@ -31,7 +18,8 @@
34+
m4 "$DIR/include.glsl" "$DIR/$SHD.glsl" > "$SHD.tmp"
35+
36+
OIFS="$IFS"
37+
- IFS=$'\n'
38+
+ IFS=$'
39+
+'
40+
echo -n "static const char ${SHD}_glsl[] =" >> "$OUTPUT.tmp"
41+
for LINE in `cat "$SHD.tmp"` ; do
42+
printf "\n \"$LINE\\\n\"" >> "$OUTPUT.tmp"
43+
--- a/src/modules/evas/engines/gl_common/shader/gen_shaders.sh
44+
+++ b/src/modules/evas/engines/gl_common/shader/gen_shaders.sh
45+
@@ -13,14 +13,6 @@
46+
# Skip generation if file can not be written to
47+
if [ -e ${OUTPUT} ] && [ ! -w ${OUTPUT} ] ; then exit 0; fi
48+
49+
-# Skip generation if there is no diff (or no git)
50+
-if ! git rev-parse 2>> /dev/null >> /dev/null ; then exit 0 ; fi
51+
-if git diff --quiet --exit-code -- "$DIR"
52+
-then
53+
- touch "$OUTPUT"
54+
- exit 0
55+
-fi
56+
-
57+
exec 1<&-
58+
exec 1>"$OUTPUT"
59+
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
diff -ur orig/meson.build mod/meson.build
2+
--- orig/meson.build 2024-12-03 14:28:29.271142623 +0100
3+
+++ mod/meson.build 2025-01-20 19:58:06.225374544 +0100
4+
@@ -4,6 +4,9 @@
5+
meson_version : '>=0.50'
6+
)
7+
8+
+add_project_link_arguments('-L/data/data/com.termux/files/usr/lib', language: 'c')
9+
+add_project_link_arguments('-landroid-shmem', language: 'c')
10+
+
11+
if host_machine.system() == 'darwin'
12+
add_languages('objc')
13+
endif
14+
@@ -677,3 +680,4 @@
15+
requires : libraries,
16+
)
17+
endforeach
18+
+
Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
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
2+
--- orig/src/modules/ecore_evas/engines/extn/ecore_evas_extn_buf.c 2023-12-23 16:56:36.000000000 +0100
3+
+++ mod/src/modules/ecore_evas/engines/extn/ecore_evas_extn_buf.c 2025-01-20 20:13:29.609463916 +0100
4+
@@ -4,6 +4,43 @@
5+
# define O_BINARY 0
6+
#endif
7+
8+
+static int termux_shm_unlink(const char *name) {
9+
+ size_t namelen;
10+
+ char *fname;
11+
+
12+
+ /* Construct the filename. */
13+
+ while (name[0] == '/') ++name;
14+
+
15+
+ if (name[0] == '\0') {
16+
+ /* The name "/" is not supported. */
17+
+ errno = EINVAL;
18+
+ return -1;
19+
+ }
20+
+
21+
+ namelen = strlen(name);
22+
+ fname = (char *) alloca(sizeof("@TERMUX_PREFIX@/tmp/") - 1 + namelen + 1);
23+
+ memcpy(fname, "@TERMUX_PREFIX@/tmp/", sizeof("@TERMUX_PREFIX@/tmp/") - 1);
24+
+ memcpy(fname + sizeof("@TERMUX_PREFIX@/tmp/") - 1, name, namelen + 1);
25+
+
26+
+ return unlink(fname);
27+
+}
28+
+
29+
+static int termux_shm_open(const char *name, int oflag, mode_t mode) {
30+
+ size_t namelen;
31+
+ char *fname;
32+
+ int fd;
33+
+
34+
+ /* Construct the filename. */
35+
+ while (name[0] == '/') ++name;
36+
+
37+
+ if (name[0] == '\0') {
38+
+ /* The name "/" is not supported. */
39+
+ errno = EINVAL;
40+
+ return -1;
41+
+ }
42+
+}
43+
+
44+
+
45+
struct _Extnbuf
46+
{
47+
const char *file, *lock;
48+
@@ -57,13 +94,13 @@
49+
if (b->lockfd < 0) goto err;
50+
b->lock = eina_stringshare_add(tmp);
51+
if (!b->lock) goto err;
52+
- b->fd = shm_open(b->file, O_RDWR | O_CREAT | O_EXCL, mode);
53+
+ b->fd = termux_shm_open(b->file, O_RDWR | O_CREAT | O_EXCL, mode);
54+
if (b->fd < 0) goto err;
55+
if (ftruncate(b->fd, b->size) < 0) goto err;
56+
}
57+
else
58+
{
59+
- b->fd = shm_open(b->file, O_RDONLY, mode);
60+
+ b->fd = termux_shm_open(b->file, O_RDONLY, mode);
61+
if (b->fd < 0) goto err;
62+
}
63+
b->addr = mmap(NULL, b->size, prot, MAP_SHARED, b->fd, 0);
64+
@@ -83,7 +120,7 @@
65+
66+
if (b->am_owner)
67+
{
68+
- if (b->file) shm_unlink(b->file);
69+
+ if (b->file) termux_shm_unlink(b->file);
70+
if (b->lock) unlink(b->lock);
71+
}
72+
Lines changed: 111 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,111 @@
1+
diff -ur orig/src/lib/eina/eina_debug_timer.c mod/src/lib/eina/eina_debug_timer.c
2+
--- orig/src/lib/eina/eina_debug_timer.c 2025-01-11 21:08:11.000000000 +0100
3+
+++ mod/src/lib/eina/eina_debug_timer.c 2025-01-21 21:18:36.155542280 +0100
4+
@@ -105,7 +105,7 @@
5+
while (1)
6+
{
7+
int timeout = -1; //in milliseconds
8+
- pthread_testcancel();
9+
+ //pthread_testcancel();
10+
eina_spinlock_take(&_lock);
11+
if (_timers)
12+
{
13+
@@ -115,7 +115,7 @@
14+
eina_spinlock_release(&_lock);
15+
16+
ret = epoll_wait(epfd, events, MAX_EVENTS, timeout);
17+
- pthread_testcancel();
18+
+ //pthread_testcancel();
19+
20+
/* Some timer has been add/removed or we need to exit */
21+
if (ret)
22+
@@ -228,7 +228,7 @@
23+
close(pipeToThread[0]);
24+
close(pipeToThread[1]);
25+
if (_thread_runs)
26+
- pthread_cancel(_thread);
27+
+ pthread_kill(_thread, SIGUSR2);
28+
_thread_runs = 0;
29+
eina_spinlock_release(&_lock);
30+
eina_spinlock_free(&_lock);
31+
diff -ur orig/src/lib/eina/eina_thread_posix.c mod/src/lib/eina/eina_thread_posix.c
32+
--- orig/src/lib/eina/eina_thread_posix.c 2025-01-11 21:08:11.000000000 +0100
33+
+++ mod/src/lib/eina/eina_thread_posix.c 2025-01-21 21:19:56.666136007 +0100
34+
@@ -56,7 +56,16 @@
35+
36+
#define RTNICENESS 1
37+
#define NICENESS 5
38+
+#define PTHREAD_CANCELED ((void *)-1)
39+
+#define true 1
40+
+#define false 0
41+
42+
+#ifdef __ANDROID__
43+
+static void thread_signal_handler(int signum)
44+
+{
45+
+ pthread_exit(0);
46+
+}
47+
+#endif
48+
49+
static inline void *
50+
_eina_thread_join(Eina_Thread t)
51+
@@ -278,15 +287,16 @@
52+
eina_thread_cancel(Eina_Thread t)
53+
{
54+
if (!t) return EINA_FALSE;
55+
- return pthread_cancel((pthread_t)t) == 0;
56+
+ return pthread_kill((pthread_t)t, SIGTERM) == 0;
57+
}
58+
59+
-EINA_API Eina_Bool
60+
-eina_thread_cancellable_set(Eina_Bool cancellable, Eina_Bool *was_cancellable)
61+
+//EINA_API Eina_Bool
62+
+Eina_Bool eina_thread_cancellable_set(Eina_Bool cancellable, Eina_Bool *was_cancellable)
63+
{
64+
- int state = cancellable ? PTHREAD_CANCEL_ENABLE : PTHREAD_CANCEL_DISABLE;
65+
- int old = 0;
66+
- int r;
67+
+#ifndef __ANDROID__
68+
+ int state = cancellable ? PTHREAD_CANCEL_ENABLE : PTHREAD_CANCEL_DISABLE;
69+
+ int old = 0;
70+
+ int r;
71+
72+
/* enforce deferred in case users changed to asynchronous themselves */
73+
pthread_setcanceltype(PTHREAD_CANCEL_DEFERRED, &old);
74+
@@ -296,12 +306,36 @@
75+
*was_cancellable = (old == PTHREAD_CANCEL_ENABLE);
76+
77+
return r == 0;
78+
+#else
79+
+ static int old_cancellable = 0;
80+
+ struct sigaction actions;
81+
+
82+
+ if (was_cancellable)
83+
+ *was_cancellable = old_cancellable;
84+
+
85+
+ if (cancellable) {
86+
+ memset(&actions, 0, sizeof(actions));
87+
+ sigemptyset(&actions.sa_mask);
88+
+ actions.sa_flags = 0;
89+
+ actions.sa_handler = thread_signal_handler;
90+
+ sigaction(SIGUSR2, &actions, NULL);
91+
+ old_cancellable = 1;
92+
+ } else {
93+
+ memset(&actions, 0, sizeof(actions));
94+
+ sigemptyset(&actions.sa_mask);
95+
+ actions.sa_handler = SIG_IGN;
96+
+ sigaction(SIGUSR2, &actions, NULL);
97+
+ old_cancellable = 0;
98+
+ }
99+
+
100+
+ return true;
101+
+#endif
102+
}
103+
104+
EINA_API void
105+
eina_thread_cancel_checkpoint(void)
106+
{
107+
- pthread_testcancel();
108+
+ //pthread_testcancel();
109+
}
110+
111+
EINA_API const void *EINA_THREAD_JOIN_CANCELED = PTHREAD_CANCELED;

0 commit comments

Comments
 (0)