From 6d14d9c87b3884c9b0ae0c901cc2f44733a91a3c Mon Sep 17 00:00:00 2001 From: Matt Turner Date: Sat, 8 May 2021 13:21:36 -0700 Subject: net-libs/gtk-vnc: Apply patches from upstream * Replace Python patch with git formatted patch from upstream * Apply patch to fix build with USE="intrspection -vala" * Replace musl conditional with patch from upstream Revert "net-libs/gtk-vnc: Fix musl build" This reverts commit 830c859345812704f6366d4749ad12f1184511f8. Bug: https://bugs.gentoo.org/737266 Closes: https://bugs.gentoo.org/787581 Signed-off-by: Matt Turner --- .../gtk-vnc/files/1.0.0-honor-python-ver.patch | 26 ---------- ...-build-improve-with-coroutine-auto-choice.patch | 59 ++++++++++++++++++++++ ...python-explicitly-to-honor-downstream-pyt.patch | 28 ++++++++++ ...onfiguration-failure-with-Dwith-vala-disa.patch | 36 +++++++++++++ net-libs/gtk-vnc/gtk-vnc-1.2.0.ebuild | 12 ++--- 5 files changed, 127 insertions(+), 34 deletions(-) delete mode 100644 net-libs/gtk-vnc/files/1.0.0-honor-python-ver.patch create mode 100644 net-libs/gtk-vnc/files/gtk-vnc-1.2.0-build-improve-with-coroutine-auto-choice.patch create mode 100644 net-libs/gtk-vnc/files/gtk-vnc-1.2.0-meson-Find-python-explicitly-to-honor-downstream-pyt.patch create mode 100644 net-libs/gtk-vnc/files/gtk-vnc-1.2.0-meson-Fix-configuration-failure-with-Dwith-vala-disa.patch diff --git a/net-libs/gtk-vnc/files/1.0.0-honor-python-ver.patch b/net-libs/gtk-vnc/files/1.0.0-honor-python-ver.patch deleted file mode 100644 index f26a85719b08..000000000000 --- a/net-libs/gtk-vnc/files/1.0.0-honor-python-ver.patch +++ /dev/null @@ -1,26 +0,0 @@ -From a51acc0c353959e8af06a031724a79cfe6b60963 Mon Sep 17 00:00:00 2001 -From: Mart Raudsepp -Date: Sun, 5 Apr 2020 00:05:49 +0300 -Subject: [PATCH] meson: Find python explicitly to honor downstream python - choice - ---- - src/meson.build | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/src/meson.build b/src/meson.build -index 461d8d2..a09aee9 100644 ---- a/src/meson.build -+++ b/src/meson.build -@@ -308,7 +308,7 @@ gtk_vnc_sources = gtk_vnc_gir_sources + gvnc_marshal + [ - 'vncdisplaykeymap.c', - ] - --python = import('python').find_installation() -+python = import('python').find_installation('python3') - keymaps = [ - 'xorgevdev', - 'xorgkbd', --- -2.20.1 - diff --git a/net-libs/gtk-vnc/files/gtk-vnc-1.2.0-build-improve-with-coroutine-auto-choice.patch b/net-libs/gtk-vnc/files/gtk-vnc-1.2.0-build-improve-with-coroutine-auto-choice.patch new file mode 100644 index 000000000000..eba775dd3a52 --- /dev/null +++ b/net-libs/gtk-vnc/files/gtk-vnc-1.2.0-build-improve-with-coroutine-auto-choice.patch @@ -0,0 +1,59 @@ +From e540fbc34d6bbfe3e84f1d9c33deaacc2326c7c9 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Jakub=20Jank=C5=AF?= +Date: Mon, 26 Apr 2021 17:38:13 +0200 +Subject: [PATCH 1/3] build: improve --with-coroutine=auto choice +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +When the required ucontext functions aren't found, switch to gthread +coroutines instead of failing during the build. + +These functions are absent from the POSIX.1-2008. + +Fixes: https://gitlab.gnome.org/GNOME/gtk-vnc/-/issues/11 + +Signed-off-by: Jakub Janků +--- + meson.build | 17 ++++++++++++++++- + 1 file changed, 16 insertions(+), 1 deletion(-) + +diff --git a/meson.build b/meson.build +index 8052d43..e9829e6 100644 +--- a/meson.build ++++ b/meson.build +@@ -43,8 +43,20 @@ cc = meson.get_compiler('c') + + coroutine = get_option('with-coroutine') + ++uctx_args = [] ++if host_machine.system() == 'darwin' ++ uctx_args += ['-D_XOPEN_SOURCE=600'] ++endif ++has_ucontext = true ++foreach uctx_func : ['makecontext', 'swapcontext', 'getcontext'] ++ if not cc.has_function(uctx_func, prefix: '#include ', args: uctx_args) ++ has_ucontext = false ++ break ++ endif ++endforeach ++ + if coroutine == 'auto' +- if host_machine.system() == 'windows' ++ if host_machine.system() == 'windows' or not has_ucontext + coroutine = 'gthread' + else + coroutine = 'ucontext' +@@ -52,6 +64,9 @@ if coroutine == 'auto' + endif + + if coroutine == 'ucontext' ++ if not has_ucontext ++ error('ucontext requested, but not available') ++ endif + conf_data.set('WITH_UCONTEXT', true) + elif coroutine != 'gthread' + error('Unknown coroutine backend') +-- +2.26.3 + diff --git a/net-libs/gtk-vnc/files/gtk-vnc-1.2.0-meson-Find-python-explicitly-to-honor-downstream-pyt.patch b/net-libs/gtk-vnc/files/gtk-vnc-1.2.0-meson-Find-python-explicitly-to-honor-downstream-pyt.patch new file mode 100644 index 000000000000..bd72b5727927 --- /dev/null +++ b/net-libs/gtk-vnc/files/gtk-vnc-1.2.0-meson-Find-python-explicitly-to-honor-downstream-pyt.patch @@ -0,0 +1,28 @@ +https://gitlab.gnome.org/GNOME/gtk-vnc/-/merge_requests/15 + +From 4609ad35b6dc11f016ac3a50158eeef7f19d9889 Mon Sep 17 00:00:00 2001 +From: Mart Raudsepp +Date: Sun, 5 Apr 2020 00:05:49 +0300 +Subject: [PATCH 3/3] meson: Find python explicitly to honor downstream python + choice + +--- + src/meson.build | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/src/meson.build b/src/meson.build +index 5306fb9..247c597 100644 +--- a/src/meson.build ++++ b/src/meson.build +@@ -319,7 +319,7 @@ gtk_vnc_sources = gtk_vnc_gir_sources + gvnc_marshal + [ + 'vncdisplaykeymap.c', + ] + +-python = import('python').find_installation() ++python = import('python').find_installation('python3') + keymaps = [ + 'xorgevdev', + 'xorgkbd', +-- +2.26.3 + diff --git a/net-libs/gtk-vnc/files/gtk-vnc-1.2.0-meson-Fix-configuration-failure-with-Dwith-vala-disa.patch b/net-libs/gtk-vnc/files/gtk-vnc-1.2.0-meson-Fix-configuration-failure-with-Dwith-vala-disa.patch new file mode 100644 index 000000000000..fd305f777c5d --- /dev/null +++ b/net-libs/gtk-vnc/files/gtk-vnc-1.2.0-meson-Fix-configuration-failure-with-Dwith-vala-disa.patch @@ -0,0 +1,36 @@ +https://gitlab.gnome.org/GNOME/gtk-vnc/-/merge_requests/14 + +From bdab05584bab5c2ecdd508df49b03e80aedd19fc Mon Sep 17 00:00:00 2001 +From: Matt Turner +Date: Wed, 28 Apr 2021 17:16:54 -0400 +Subject: [PATCH 2/3] meson: Fix configuration failure with + -Dwith-vala=disabled + +Otherwise with_vala is not defined, and meson setup results in + + src/meson.build:169:5: ERROR: Unknown variable "with_vala". +--- + meson.build | 3 +-- + 1 file changed, 1 insertion(+), 2 deletions(-) + +diff --git a/meson.build b/meson.build +index e9829e6..777876c 100644 +--- a/meson.build ++++ b/meson.build +@@ -318,12 +318,11 @@ gir = find_program('g-ir-scanner', required: get_option('introspection')) + with_gir = gir.found() + + vala_opt = get_option('with-vala') ++with_vala = false + if not vala_opt.disabled() + if not with_gir + if vala_opt.enabled() + error('Vala API requires GObject introspection (-Dintrospection=true)') +- else +- with_vala = false + endif + else + with_vala = add_languages('vala', required: vala_opt) +-- +2.26.3 + diff --git a/net-libs/gtk-vnc/gtk-vnc-1.2.0.ebuild b/net-libs/gtk-vnc/gtk-vnc-1.2.0.ebuild index 28d6d3798343..e879d2277a27 100644 --- a/net-libs/gtk-vnc/gtk-vnc-1.2.0.ebuild +++ b/net-libs/gtk-vnc/gtk-vnc-1.2.0.ebuild @@ -41,7 +41,9 @@ BDEPEND=" " PATCHES=( - "${FILESDIR}"/1.0.0-honor-python-ver.patch + "${FILESDIR}"/${P}-build-improve-with-coroutine-auto-choice.patch + "${FILESDIR}"/${P}-meson-Find-python-explicitly-to-honor-downstream-pyt.patch + "${FILESDIR}"/${P}-meson-Fix-configuration-failure-with-Dwith-vala-disa.patch ) src_prepare() { @@ -54,14 +56,8 @@ src_configure() { $(meson_feature introspection) $(meson_feature pulseaudio) $(meson_feature sasl) + -Dwith-coroutine=auto # gthread on windows, libc ucontext elsewhere; neither has extra deps $(meson_feature vala with-vala) ) - - if use elibc_musl; then - emesonargs+=( -Dwith-coroutine=gthread ) - else - emesonargs+=( -Dwith-coroutine=auto ) - fi - meson_src_configure } -- cgit v1.2.3-65-gdbad