From de1bffb9a3237e311205c02f82b1c2fc7ad23c23 Mon Sep 17 00:00:00 2001 From: Ting-Wei Lan Date: Tue, 2 Jul 2019 20:11:29 +0800 Subject: [PATCH 1/2] systeminstall: Support 'python3' sysdeps Using code similar to 'python2' sysdeps, we add 'python3' sysdeps in order to allow a module to depend on a system-installed Python 3 module. Since JHBuild itself is written in Python 2, we cannot test Python 3 modules directly in the JHBuild process. Therefore, tests for Python 3 modules have to be done in a new process, and it is expected for python3 tests to be slower than python2 tests. --- jhbuild/utils/systeminstall.py | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/jhbuild/utils/systeminstall.py b/jhbuild/utils/systeminstall.py index d8916bfb..868b34ab 100644 --- a/jhbuild/utils/systeminstall.py +++ b/jhbuild/utils/systeminstall.py @@ -24,6 +24,7 @@ import shlex import subprocess import pipes import imp +import textwrap import time from StringIO import StringIO @@ -180,6 +181,20 @@ def systemdependencies_met(module_name, sysdeps, config): except: dep_met = False + elif dep_type == 'python3': + python3_script = textwrap.dedent(''' + import imp + import sys + try: + imp.find_module(sys.argv[1]) + except: + exit(1) + ''').strip('\n') + try: + subprocess.check_call(['python3', '-c', python3_script, value]) + except (subprocess.CalledProcessError, OSError): + dep_met = False + elif dep_type == 'xml': xml_catalog = '/etc/xml/catalog' -- GitLab From a36efb8a5e26e350a8854644733497f43cb07d2a Mon Sep 17 00:00:00 2001 From: Ting-Wei Lan Date: Tue, 2 Jul 2019 20:44:20 +0800 Subject: [PATCH 2/2] core-deps-latest: gtk-doc depends on pygments Fixes: https://gitlab.gnome.org/GNOME/jhbuild/issues/20 --- modulesets/gnome-suites-core-deps-latest.modules | 1 + modulesets/gnome-sysdeps-latest.modules | 7 +++++++ 2 files changed, 8 insertions(+) diff --git a/modulesets/gnome-suites-core-deps-latest.modules b/modulesets/gnome-suites-core-deps-latest.modules index 9c9dbca9..dd9ec667 100644 --- a/modulesets/gnome-suites-core-deps-latest.modules +++ b/modulesets/gnome-suites-core-deps-latest.modules @@ -1003,6 +1003,7 @@ + diff --git a/modulesets/gnome-sysdeps-latest.modules b/modulesets/gnome-sysdeps-latest.modules index d5998b35..ad8513b9 100644 --- a/modulesets/gnome-sysdeps-latest.modules +++ b/modulesets/gnome-sysdeps-latest.modules @@ -1096,6 +1096,13 @@ version="3.2"/> + + + + + + + -- GitLab