[X2Go-Commits] [pyhoca-gui] 01/01: pyhoca-gui.spec: backport Python-2/3-selection fix from pyhoca-cli.

git-admin at x2go.org git-admin at x2go.org
Tue Dec 24 03:52:16 CET 2019


This is an automated email from the git hooks/post-receive script.

x2go pushed a commit to branch master
in repository pyhoca-gui.

commit 8dcb9f3357225812433a873672211513409efb90
Author: Mihai Moldovan <ionic at ionic.de>
Date:   Tue Dec 24 03:51:53 2019 +0100

    pyhoca-gui.spec: backport Python-2/3-selection fix from pyhoca-cli.
    
    Use a global variable to store and mangle the Python preferences and
    only use %bcond_with... X once later on.
---
 debian/changelog |  3 +++
 pyhoca-gui.spec  | 39 ++++++++++++++++++++++++++++++---------
 2 files changed, 33 insertions(+), 9 deletions(-)

diff --git a/debian/changelog b/debian/changelog
index f2e375c..427676d 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -43,6 +43,9 @@ pyhoca-gui (0.6.1.0-0x2go1) UNRELEASED; urgency=medium
     + Adapt %files to Python 2/3 logic.
     + Fix syntax: missing %endif.
     + Fix syntax: another missing %endif.
+    + Backport Python-2/3-selection fix from pyhoca-cli. Use a global variable
+      to store and mangle the Python preferences and only use %bcond_with... X
+      once later on.
 
  -- Mike Gabriel <mike.gabriel at das-netzwerkteam.de>  Wed, 11 Dec 2019 12:47:21 +0100
 
diff --git a/pyhoca-gui.spec b/pyhoca-gui.spec
index 0160abd..27cfb83 100644
--- a/pyhoca-gui.spec
+++ b/pyhoca-gui.spec
@@ -1,23 +1,44 @@
 # Add conditional and ...
+# ... disable by default, mostly for older distros.
+%global want_python3 0
 %if 0%{?suse_version} > 1310 || 0%{?fedora} >= 26 || 0%{?rhel} >= 8
 # ... enable by default on newer distros.
-%bcond_without  python3
-%else
-# ... disable by default on older distros.
-%bcond_with     python3
+%global want_python3 1
 %endif
 
 # Fedora 30 deprecated Python 2, 31 disabled support for building these
 # packages.
+%global want_python2 1
 %if 0%{?fedora} >= 31
-%bcond_with    python2
-%else
-%bcond_without python2
+%global want_python2 0
 %endif
 
 # Prefer Python 3 if both variants have been requested.
-%if 0%{?with_python2} && 0%{?with_python3}
-%bcond_with python2
+%if 0%{?want_python2} && 0%{?want_python3}
+%global want_python2 0
+%endif
+
+# Conditional builds are a bit weird.
+# You CAN either enable or disable a feature via %%bcond_with{,out}, BUT you
+# can NOT override this value later on, it seems.
+# Case in point: I tried to use %bcond_without python2 for all older Fedora
+# versions, %bcond_with python3 for all Fedora versions starting with 26.
+# However, as pyhoca-{gui,cli} are just applications, we want to build against
+# one specific python version only, so I later tried to override the Python-2-
+# build via %bcond_with python2, essentially disabling it and preferring the
+# Python-3-based version.
+# This didn't work, since %{?with_python2} was kept enabled.
+# Hence, we'll only enable/disable a feature once now, based upon the global
+# macros.
+%if 0%{?want_python2}
+%bcond_without  python2
+%else
+%bcond_with     python2
+%endif
+%if 0%{?want_python3}
+%bcond_without  python3
+%else
+%bcond_with     python3
 %endif
 
 # Provide a default implementation, essentially for non-*SuSE platforms.

--
Alioth's /home/x2go-admin/maintenancescripts/git/hooks/post-receive-email on /srv/git/code.x2go.org/pyhoca-gui.git


More information about the x2go-commits mailing list