commit:     6d14d9c87b3884c9b0ae0c901cc2f44733a91a3c
Author:     Matt Turner <mattst88 <AT> gentoo <DOT> org>
AuthorDate: Sat May  8 20:21:36 2021 +0000
Commit:     Matt Turner <mattst88 <AT> gentoo <DOT> org>
CommitDate: Sat May  8 20:27:33 2021 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=6d14d9c8

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 <mattst88 <AT> gentoo.org>

 ...-build-improve-with-coroutine-auto-choice.patch | 59 ++++++++++++++++++++++
 ...ython-explicitly-to-honor-downstream-pyt.patch} | 12 +++--
 ...onfiguration-failure-with-Dwith-vala-disa.patch | 36 +++++++++++++
 net-libs/gtk-vnc/gtk-vnc-1.2.0.ebuild              | 12 ++---
 4 files changed, 106 insertions(+), 13 deletions(-)

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 00000000000..eba775dd3a5
--- /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?= <jja...@redhat.com>
+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ů <jja...@redhat.com>
+---
+ 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 <ucontext.h>', 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/1.0.0-honor-python-ver.patch 
b/net-libs/gtk-vnc/files/gtk-vnc-1.2.0-meson-Find-python-explicitly-to-honor-downstream-pyt.patch
similarity index 59%
rename from net-libs/gtk-vnc/files/1.0.0-honor-python-ver.patch
rename to 
net-libs/gtk-vnc/files/gtk-vnc-1.2.0-meson-Find-python-explicitly-to-honor-downstream-pyt.patch
index f26a85719b0..bd72b572792 100644
--- a/net-libs/gtk-vnc/files/1.0.0-honor-python-ver.patch
+++ 
b/net-libs/gtk-vnc/files/gtk-vnc-1.2.0-meson-Find-python-explicitly-to-honor-downstream-pyt.patch
@@ -1,7 +1,9 @@
-From a51acc0c353959e8af06a031724a79cfe6b60963 Mon Sep 17 00:00:00 2001
+https://gitlab.gnome.org/GNOME/gtk-vnc/-/merge_requests/15
+
+From 4609ad35b6dc11f016ac3a50158eeef7f19d9889 Mon Sep 17 00:00:00 2001
 From: Mart Raudsepp <l...@gentoo.org>
 Date: Sun, 5 Apr 2020 00:05:49 +0300
-Subject: [PATCH] meson: Find python explicitly to honor downstream python
+Subject: [PATCH 3/3] meson: Find python explicitly to honor downstream python
  choice
 
 ---
@@ -9,10 +11,10 @@ Subject: [PATCH] meson: Find python explicitly to honor 
downstream python
  1 file changed, 1 insertion(+), 1 deletion(-)
 
 diff --git a/src/meson.build b/src/meson.build
-index 461d8d2..a09aee9 100644
+index 5306fb9..247c597 100644
 --- a/src/meson.build
 +++ b/src/meson.build
-@@ -308,7 +308,7 @@ gtk_vnc_sources = gtk_vnc_gir_sources + gvnc_marshal + [
+@@ -319,7 +319,7 @@ gtk_vnc_sources = gtk_vnc_gir_sources + gvnc_marshal + [
    'vncdisplaykeymap.c',
  ]
  
@@ -22,5 +24,5 @@ index 461d8d2..a09aee9 100644
    'xorgevdev',
    'xorgkbd',
 -- 
-2.20.1
+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 00000000000..fd305f777c5
--- /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 <matts...@gmail.com>
+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 28d6d379834..e879d2277a2 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
 }

Reply via email to