From 0c87bf36c27cc48815d16c923316582051cddda0 Mon Sep 17 00:00:00 2001 From: q66 Date: Thu, 11 Jun 2020 16:09:05 +0200 Subject: [PATCH] efl: fixes from git, use gles by default, backtraces on musl This unbreaks accelerated E with Wayland for one. Also, gles2 is now a suboption of opengl, as that makes more sense. --- ...csd-fix-alpha-zeroing-to-avoid-frame.patch | 39 +++++++ ...ate-regions-smart-merge-merge-v-adja.patch | 104 ++++++++++++++++++ ...ntime-relocation-right-with-default-.patch | 94 ++++++++++++++++ ...rvice-files-install-fix-if-systemd-n.patch | 43 ++++++++ ...-EINA_LOG_BACKTRACE-when-backtrace-A.patch | 30 +++++ ...rd-LC_ALL-instead-of-__LC_ALL-in-sys.patch | 30 +++++ ...ld-gl_drm-evas-engine-when-using-es-.patch | 42 +++++++ srcpkgs/efl/template | 60 +++++----- 8 files changed, 409 insertions(+), 33 deletions(-) create mode 100644 srcpkgs/efl/patches/0001-evas-csd-and-wl-csd-fix-alpha-zeroing-to-avoid-frame.patch create mode 100644 srcpkgs/efl/patches/0002-evas-genetic-update-regions-smart-merge-merge-v-adja.patch create mode 100644 srcpkgs/efl/patches/0003-efreet-handle-runtime-relocation-right-with-default-.patch create mode 100644 srcpkgs/efl/patches/0004-build-systemd-service-files-install-fix-if-systemd-n.patch create mode 100644 srcpkgs/efl/patches/0005-eina-only-enable-EINA_LOG_BACKTRACE-when-backtrace-A.patch create mode 100644 srcpkgs/efl/patches/0006-ecore-use-standard-LC_ALL-instead-of-__LC_ALL-in-sys.patch create mode 100644 srcpkgs/efl/patches/0007-modules-only-build-gl_drm-evas-engine-when-using-es-.patch diff --git a/srcpkgs/efl/patches/0001-evas-csd-and-wl-csd-fix-alpha-zeroing-to-avoid-frame.patch b/srcpkgs/efl/patches/0001-evas-csd-and-wl-csd-fix-alpha-zeroing-to-avoid-frame.patch new file mode 100644 index 0000000000..6dab5984a1 --- /dev/null +++ b/srcpkgs/efl/patches/0001-evas-csd-and-wl-csd-fix-alpha-zeroing-to-avoid-frame.patch @@ -0,0 +1,39 @@ +From e917e3111b2d2b27db21b47c9586d231c5785be5 Mon Sep 17 00:00:00 2001 +From: "Carsten Haitzler (Rasterman)" +Date: Tue, 26 May 2020 12:16:09 +0100 +Subject: [PATCH 1/7] evas - csd and wl csd - fix alpha zeroing to avoid + framespace junk + +i noticed some junk in framespace... this happesn when solid objects +are outside the normal window content area and their solid areas are +not clipped to this inner frame area thus those areas are not "zeroed +out" next render. + +@fix +--- + src/lib/evas/canvas/evas_render.c | 9 +++++++++ + 1 file changed, 9 insertions(+) + +diff --git src/lib/evas/canvas/evas_render.c src/lib/evas/canvas/evas_render.c +index 1d47ba06af..567461d1dd 100644 +--- src/lib/evas/canvas/evas_render.c ++++ src/lib/evas/canvas/evas_render.c +@@ -2722,6 +2722,15 @@ _evas_render_cutout_add(Evas_Public_Data *evas, void *context, + obj->cur->cache.clip.w, obj->cur->cache.clip.h); + } + else return; ++ if (!_is_obj_in_framespace(obj, evas)) ++ { ++ int fw, fh; ++ ++ fw = evas->viewport.w - evas->framespace.w; ++ fh = evas->viewport.h - evas->framespace.h; ++ RECTS_CLIP_TO_RECT(cox, coy, cow, coh, ++ 0, 0, fw, fh); ++ } + if (cutout_margin) + { + cox += cutout_margin->l; +-- +2.27.0 + diff --git a/srcpkgs/efl/patches/0002-evas-genetic-update-regions-smart-merge-merge-v-adja.patch b/srcpkgs/efl/patches/0002-evas-genetic-update-regions-smart-merge-merge-v-adja.patch new file mode 100644 index 0000000000..e65bed0f70 --- /dev/null +++ b/srcpkgs/efl/patches/0002-evas-genetic-update-regions-smart-merge-merge-v-adja.patch @@ -0,0 +1,104 @@ +From af2fd2ead002b10e9b1f56b41f4a9e24b56bfca4 Mon Sep 17 00:00:00 2001 +From: "Carsten Haitzler (Rasterman)" +Date: Thu, 4 Jun 2020 20:25:46 +0100 +Subject: [PATCH 2/7] evas - genetic update regions smart merge - merge v + adjacent regions + +regions sometimes produce box sets like: +// +---+ +// | | +// +---+ +-------+ +// | | | | +// +---+ +-------+---------+ +// | | +// | | +// +-----------------+ + +so the upper-left 2 boxes can be merged into 1 and they have the same +x coords and are flush-aligned one above the other. that is what +this does - find these and merge them to have fewer rects + +@fix +--- + .../engines/software_generic/evas_engine.c | 54 ++++++++++++++++--- + 1 file changed, 48 insertions(+), 6 deletions(-) + +diff --git src/modules/evas/engines/software_generic/evas_engine.c src/modules/evas/engines/software_generic/evas_engine.c +index 0309d620e9..19b60f6621 100644 +--- src/modules/evas/engines/software_generic/evas_engine.c ++++ src/modules/evas/engines/software_generic/evas_engine.c +@@ -3958,7 +3958,6 @@ _smart_merge(Tilebuf *tb, Tilebuf_Rect *rects) + } + j++; + } +- n2 = n; + free(box); + box = box2; + if (!did_merge) break; +@@ -3976,15 +3975,58 @@ _smart_merge(Tilebuf *tb, Tilebuf_Rect *rects) + box = region_rects(region); + n = region_rects_num(region); + merged = calloc(1, n * sizeof(Tilebuf_Rect)); ++ j = 0; ++#if 1 ++ // regions sometimes produce box sets like: ++ // +---+ ++ // | | ++ // +---+ +-------+ ++ // | | | | ++ // +---+ +-------+---------+ ++ // | | ++ // | | ++ // +-----------------+ ++ // so the upper-left 2 boxes can be merged into 1 and they have the same ++ // x coords and are flush-aligned one above the other. that is what ++ // this does - find these and merge them to have fewer rects + for (i = 0; i < n; i++) + { +- merged[i].x = box[i].x1; +- merged[i].y = box[i].y1; +- merged[i].w = box[i].x2 - box[i].x1; +- merged[i].h = box[i].y2 - box[i].y1; ++ // skip empty boxes ++ if (box[i].x1 == box[i].x2) continue; ++ // walk all following boxes after this and see if they can be merged ++ // into box i ++ for (k = i + 1; k < n; k++) ++ { ++ // skip empty boxes after i ++ if (box[k].x1 == box[k].x2) continue; ++ // match x coords ++ if ((box[i].x1 == box[k].x1) && // if aligned vertically ++ (box[i].x2 == box[k].x2)) // exactly above/below ++ { ++ // right below, or right above ++ if (box[i].y2 == box[k].y1) // this box flush below ++ { ++ box[i].y2 = box[k].y2; // merge below i ++ box[k].x2 = box[k].x1; // empty this box - merged ++ } ++ else if (box[i].y1 == box[k].y2) // this box flush above ++ { ++ box[i].y2 = box[k].y2; // merge above i ++ box[k].x2 = box[k].x1; // empty this box - merged ++ } ++ } ++ } ++ // i may have expanded but will not be empty. future boxes after ++ // this may be empty though but handled at top of loop ++ merged[j].x = box[i].x1; ++ merged[j].y = box[i].y1; ++ merged[j].w = box[i].x2 - box[i].x1; ++ merged[j].h = box[i].y2 - box[i].y1; + mergelist = (Tilebuf_Rect *)eina_inlist_append +- (EINA_INLIST_GET(mergelist), EINA_INLIST_GET(&(merged[i]))); ++ (EINA_INLIST_GET(mergelist), EINA_INLIST_GET(&(merged[j]))); ++ j++; + } ++#endif + region_free(region); + rects = mergelist; + +-- +2.27.0 + diff --git a/srcpkgs/efl/patches/0003-efreet-handle-runtime-relocation-right-with-default-.patch b/srcpkgs/efl/patches/0003-efreet-handle-runtime-relocation-right-with-default-.patch new file mode 100644 index 0000000000..bf05df99b5 --- /dev/null +++ b/srcpkgs/efl/patches/0003-efreet-handle-runtime-relocation-right-with-default-.patch @@ -0,0 +1,94 @@ +From 7ef58c47d3184c04bd9b0d477b8c7bd342384189 Mon Sep 17 00:00:00 2001 +From: "Carsten Haitzler (Rasterman)" +Date: Tue, 9 Jun 2020 10:13:04 +0100 +Subject: [PATCH 3/7] efreet - handle runtime relocation right with default + XDG_DATA_DIRS + +XDG_DATA_DIRS was only set up to a default including where efl was +installed prefix-wise as the compiled-=in prefix, not runtime +determined prefix. it shouldn't actually affect most people except +those making use of this. + +@fix +--- + src/lib/efreet/efreet_base.c | 33 +++++++++++++++++++++++++++++---- + 1 file changed, 29 insertions(+), 4 deletions(-) + +diff --git src/lib/efreet/efreet_base.c src/lib/efreet/efreet_base.c +index 6497e8d955..736a3a05fc 100644 +--- src/lib/efreet/efreet_base.c ++++ src/lib/efreet/efreet_base.c +@@ -51,6 +51,8 @@ static const char *xdg_pictures_dir = NULL; + static const char *xdg_videos_dir = NULL; + static const char *hostname = NULL; + ++static Eina_Prefix *pfx= NULL; ++ + static void efreet_dirs_init(void); + static const char *efreet_dir_get(const char *key, const char *fallback); + static Eina_List *efreet_dirs_get(const char *key, +@@ -72,6 +74,9 @@ efreet_base_init(void) + EINA_LOG_ERR("Efreet: Could not create a log domain for efreet_base.\n"); + return 0; + } ++ if (!pfx) pfx = eina_prefix_new ++ (NULL, efreet_init, "EFREET", "efreet", "checkme", ++ PACKAGE_BIN_DIR, PACKAGE_LIB_DIR, PACKAGE_DATA_DIR, PACKAGE_DATA_DIR); + efreet_dirs_init(); + return 1; + } +@@ -105,6 +110,11 @@ efreet_base_shutdown(void) + + IF_RELEASE(hostname); + ++ if (pfx) ++ { ++ eina_prefix_free(pfx); ++ pfx = NULL; ++ } + eina_log_domain_unregister(_efreet_base_log_dom); + _efreet_base_log_dom = -1; + } +@@ -280,6 +290,7 @@ efreet_dirs_reset(void) + static void + efreet_dirs_init(void) + { ++ char *data_dir = DATA_DIR; + char buf[PATH_MAX]; + + /* efreet_home_dir */ +@@ -294,13 +305,27 @@ efreet_dirs_init(void) + xdg_cache_home = efreet_dir_get("XDG_CACHE_HOME", "/.cache"); + + /* xdg_data_dirs */ ++ if (pfx) ++ { ++ const char *dir = eina_prefix_get(pfx); ++ if (dir) ++ { ++ size_t len = strlen(dir); ++ ++ data_dir = alloca(len + 1 + 5 /*"share" */ + 1); + #ifdef _WIN32 +- snprintf(buf, sizeof(buf), "%s\\Efl;" DATA_DIR ";", getenv("APPDATA")); +- xdg_data_dirs = efreet_dirs_get("XDG_DATA_DIRS", buf); ++ snprintf(data_dir, len + 1 + 5 + 1, "%s\\share", dir); + #else +- xdg_data_dirs = efreet_dirs_get("XDG_DATA_DIRS", +- DATA_DIR ":/usr/share:/usr/local/share"); ++ snprintf(data_dir, len + 1 + 5 + 1, "%s/share", dir); + #endif ++ } ++ } ++#ifdef _WIN32 ++ snprintf(buf, sizeof(buf), "%s\\Efl;%s;", data_dir, getenv("APPDATA")); ++#else ++ snprintf(buf, sizeof(buf), "%s:/usr/share:/usr/local/share", data_dir); ++#endif ++ xdg_data_dirs = efreet_dirs_get("XDG_DATA_DIRS", buf); + /* xdg_config_dirs */ + #ifdef _WIN32 + xdg_config_dirs = efreet_dirs_get("XDG_CONFIG_DIRS", getenv("APPDATA")); +-- +2.27.0 + diff --git a/srcpkgs/efl/patches/0004-build-systemd-service-files-install-fix-if-systemd-n.patch b/srcpkgs/efl/patches/0004-build-systemd-service-files-install-fix-if-systemd-n.patch new file mode 100644 index 0000000000..5019db549e --- /dev/null +++ b/srcpkgs/efl/patches/0004-build-systemd-service-files-install-fix-if-systemd-n.patch @@ -0,0 +1,43 @@ +From b03baef4b52483ac6ca7d9371224273b60455432 Mon Sep 17 00:00:00 2001 +From: "Carsten Haitzler (Rasterman)" +Date: Wed, 27 May 2020 14:10:33 +0100 +Subject: [PATCH 4/7] build - systemd service files - install fix if systemd + not found + +so if systemd is not found - installe in PREFIX/lib/systemd/user which +allows build to work without disabling systemd. +--- + systemd-services/meson.build | 17 ++++++++++------- + 1 file changed, 10 insertions(+), 7 deletions(-) + +diff --git systemd-services/meson.build systemd-services/meson.build +index 18be63c5ef..a17790e857 100644 +--- systemd-services/meson.build ++++ systemd-services/meson.build +@@ -1,13 +1,16 @@ + if get_option('systemd') == true +- dep = dependency('systemd') ++ sys_dep = dependency('systemd', required: false) ++ if sys_dep.found() ++ sys_dir = sys_dep.get_pkgconfig_variable('systemduserunitdir') ++ else ++ sys_dir = join_paths(dir_lib, 'systemd', 'user') ++ endif + + ethumb_service_config = configuration_data() +- + ethumb_service_config.set('prefix', dir_prefix) + +- configure_file( +- input: 'ethumb.service.in', +- output: 'ethumb.service', +- configuration: ethumb_service_config, +- install_dir: dep.get_pkgconfig_variable('systemduserunitdir')) ++ configure_file(input : 'ethumb.service.in', ++ output : 'ethumb.service', ++ configuration : ethumb_service_config, ++ install_dir : sys_dir) + endif +-- +2.27.0 + diff --git a/srcpkgs/efl/patches/0005-eina-only-enable-EINA_LOG_BACKTRACE-when-backtrace-A.patch b/srcpkgs/efl/patches/0005-eina-only-enable-EINA_LOG_BACKTRACE-when-backtrace-A.patch new file mode 100644 index 0000000000..80ab00f599 --- /dev/null +++ b/srcpkgs/efl/patches/0005-eina-only-enable-EINA_LOG_BACKTRACE-when-backtrace-A.patch @@ -0,0 +1,30 @@ +From 8f59fb469fc47b2ee64453407b7d4ce4d8f29f63 Mon Sep 17 00:00:00 2001 +From: Daniel Kolesa +Date: Thu, 11 Jun 2020 02:18:50 +0200 +Subject: [PATCH 5/7] eina: only enable EINA_LOG_BACKTRACE when backtrace API + is present + +This prevents build breakage on platforms that either don't have +backtrace() or don't have the appropriate library for it installed. +--- + src/lib/eina/eina_log.c | 3 +++ + 1 file changed, 3 insertions(+) + +diff --git src/lib/eina/eina_log.c src/lib/eina/eina_log.c +index 7c66ee0b53..531faba093 100644 +--- src/lib/eina/eina_log.c ++++ src/lib/eina/eina_log.c +@@ -42,7 +42,10 @@ + #endif + + #include "eina_debug_private.h" ++ ++#ifdef HAVE_BACKTRACE + #define EINA_LOG_BACKTRACE ++#endif + + #include "eina_config.h" + #include "eina_private.h" +-- +2.27.0 + diff --git a/srcpkgs/efl/patches/0006-ecore-use-standard-LC_ALL-instead-of-__LC_ALL-in-sys.patch b/srcpkgs/efl/patches/0006-ecore-use-standard-LC_ALL-instead-of-__LC_ALL-in-sys.patch new file mode 100644 index 0000000000..409fc5cbf8 --- /dev/null +++ b/srcpkgs/efl/patches/0006-ecore-use-standard-LC_ALL-instead-of-__LC_ALL-in-sys.patch @@ -0,0 +1,30 @@ +From f5d371d6ecdbb84acf0de34cd80ddaee2493ca72 Mon Sep 17 00:00:00 2001 +From: Daniel Kolesa +Date: Thu, 11 Jun 2020 02:32:07 +0200 +Subject: [PATCH 6/7] ecore: use standard LC_ALL instead of __LC_ALL in systemd + module + +The former is a POSIX name, the latter is non-standard. I don't +know why the latter was used, considering glibc literally has +just #define LC_ALL __LC_ALL, but change it and unbreak build +on musl and other systems. +--- + src/modules/ecore/system/systemd/ecore_system_systemd.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git src/modules/ecore/system/systemd/ecore_system_systemd.c src/modules/ecore/system/systemd/ecore_system_systemd.c +index 78e3185287..ab19ff36cd 100644 +--- src/modules/ecore/system/systemd/ecore_system_systemd.c ++++ src/modules/ecore/system/systemd/ecore_system_systemd.c +@@ -163,7 +163,7 @@ static void _locale_get(void *data EINA_UNUSED, const Eldbus_Message *msg, + + setenv(type, value, 1); + } +- setlocale(__LC_ALL, ""); ++ setlocale(LC_ALL, ""); + + end: + ecore_event_add(ECORE_EVENT_LOCALE_CHANGED, NULL, NULL, NULL); +-- +2.27.0 + diff --git a/srcpkgs/efl/patches/0007-modules-only-build-gl_drm-evas-engine-when-using-es-.patch b/srcpkgs/efl/patches/0007-modules-only-build-gl_drm-evas-engine-when-using-es-.patch new file mode 100644 index 0000000000..1b03cdfd57 --- /dev/null +++ b/srcpkgs/efl/patches/0007-modules-only-build-gl_drm-evas-engine-when-using-es-.patch @@ -0,0 +1,42 @@ +From 2620295542d1b3867875056c8d0ca9fbcd0546a0 Mon Sep 17 00:00:00 2001 +From: Daniel Kolesa +Date: Thu, 11 Jun 2020 15:14:03 +0200 +Subject: [PATCH 7/7] modules: only build gl_drm evas engine when using es-egl + +This module does not work with desktop opengl contexts, +and needs EGL to work. +--- + src/modules/evas/engines/meson.build | 10 +++++----- + 1 file changed, 5 insertions(+), 5 deletions(-) + +diff --git src/modules/evas/engines/meson.build src/modules/evas/engines/meson.build +index 2504a761a9..7bb4211cf2 100644 +--- src/modules/evas/engines/meson.build ++++ src/modules/evas/engines/meson.build +@@ -16,10 +16,7 @@ endif + have_gl_engine = false + + if get_option('opengl') != 'none' +- engines += [ +- ['gl_x11', ['x11']], +- ['gl_drm', ['drm']] +- ] ++ engines += [['gl_x11', ['x11']]] + have_gl_engine = true + endif + +@@ -29,7 +26,10 @@ if get_option('opengl') == 'full' + endif + + if get_option('opengl') == 'es-egl' +- engines += [['wayland_egl', ['wl']]] ++ engines += [ ++ ['wayland_egl', ['wl']], ++ ['gl_drm', ['drm']] ++ ] + have_gl_engine = true + endif + +-- +2.27.0 + diff --git a/srcpkgs/efl/template b/srcpkgs/efl/template index cab22ad053..2f513dd9b9 100644 --- a/srcpkgs/efl/template +++ b/srcpkgs/efl/template @@ -1,10 +1,9 @@ # Template file for 'efl' pkgname=efl version=1.24.2 -revision=1 +revision=2 build_style=meson configure_args=" - -Dopengl=$(vopt_if opengl full $(vopt_if gles2 es-egl none)) -Dembedded-lz4=false -Dcrypto=openssl -Dnetwork-backend=none @@ -12,6 +11,7 @@ configure_args=" -Devas-loaders-disabler=$(vopt_if lottie '[]' json) -Demotion-loaders-disabler=$(vopt_if gstreamer '' gstreamer1,)$(vopt_if vlc '' libvlc,)gstreamer,xine -Demotion-generic-loaders-disabler=vlc + -Dopengl=$(vopt_if opengl $(vopt_if gles2 es-egl full) none) $(vopt_bool elogind systemd) $(vopt_bool x11 x11) $(vopt_bool x11 xpresent) @@ -36,7 +36,6 @@ makedepends=" $(vopt_if elogind elogind-devel) $(vopt_if gstreamer gst-plugins-base1-devel) $(vopt_if opengl MesaLib-devel) - $(vopt_if gles2 MesaLib-devel) $(vopt_if vlc vlc-devel) $(vopt_if wayland 'wayland-protocols wayland-devel') $(vopt_if x11 'libXcomposite-devel libXcursor-devel libXp-devel @@ -62,6 +61,11 @@ else configure_args+=" -Dbuild-tests=false" fi +# for backtrace support +if [ "$XBPS_TARGET_LIBC" = "musl" ]; then + makedepends+=" libexecinfo-devel" +fi + if [ "$CROSS_BUILD" ]; then hostmakedepends+=" gettext-devel efl-devel" fi @@ -70,6 +74,18 @@ case "$XBPS_TARGET_MACHINE" in mips*) CFLAGS="-Os";; esac +# TODO: add option for scim (don't have it packaged) +build_options="elogind harfbuzz pulseaudio gstreamer vlc x11 wayland + opengl gles2 drm framebuffer simd lottie glib ibus" +# wayland_egl and gl_drm need gles, so use that by default +build_options_default="elogind harfbuzz pulseaudio gstreamer x11 wayland + opengl gles2 drm glib ibus" +desc_option_simd="Enable support for SSE3/NEON/AltiVec" +desc_option_vlc="Enable support for VLC multimedia backend" +desc_option_lottie="Enable support for Lottie JSON" +desc_option_glib="Enable GLib integration" +desc_option_ibus="Enable IBus input method support (needs glib)" + # sanitize options if [ -n "$build_option_wayland" -a -z "$build_option_drm" ]; then broken="wayland requires drm" @@ -77,29 +93,9 @@ fi if [ -n "$build_option_ibus" -a -z "$build_option_glib" ]; then broken="ibus requires glib integration" fi - -# TODO: add option for scim (don't have it packaged) -build_options="elogind harfbuzz pulseaudio gstreamer vlc x11 wayland - opengl gles2 drm framebuffer simd lottie glib ibus" -build_options_default="elogind harfbuzz pulseaudio gstreamer x11 wayland drm - glib ibus" -desc_option_simd="Enable support for SSE3/NEON/AltiVec" -desc_option_vlc="Enable support for VLC multimedia backend" -desc_option_lottie="Enable support for Lottie JSON" -desc_option_glib="Enable GLib integration" -desc_option_ibus="Enable IBus input method support (needs glib)" - -# OpenGL acceleration support -case "$XBPS_TARGET_MACHINE" in - i686*|x86_64*|ppc*) - # Enable desktop OpenGL on x86/ppc systems - build_options_default+=" opengl" - ;; - aarch64*|armv7l*) - # Enable OpenGL ES on modern ARM systems - build_options_default+=" gles2" - ;; -esac +if [ -n "$build_option_gles2" -a -z "$build_option_opengl" ]; then + broken="gles2 needs opengl" +fi # Architecture optimizations case "$XBPS_TARGET_MACHINE" in @@ -113,13 +109,11 @@ case "$XBPS_TARGET_MACHINE" in ;; esac -post_extract() { - # systemd option applies to elogind but we don't want to install services - vsed -i '/systemd-services/d' meson.build - # disable journald code, not used and breaks musl - vsed -i 's/ifdef HAVE_SYSTEMD/if 0/g' src/lib/eina/eina_log.c - # disable systemd ecore module, not used and breaks musl - vsed -i "/'systemd',/d" src/modules/ecore/meson.build +post_install() { + # don't want service file junk + rm -rf ${DESTDIR}/usr/lib/systemd + # don't want systemd system module + rm -rf ${DESTDIR}/usr/lib/ecore/system/systemd } efl-devel_package() {