[libgit2-glib/wip/albfan/python3] Use python3
- From: Alberto Fanjul <albfan src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [libgit2-glib/wip/albfan/python3] Use python3
- Date: Fri, 28 Jun 2019 17:24:57 +0000 (UTC)
commit 8a1da431dcbf4eda612b5189201f502fbf122726
Author: Alberto Fanjul <albertofanjul gmail com>
Date: Fri Jun 28 18:22:50 2019 +0200
Use python3
libgit2-glib/meson.build | 5 ++---
meson.build | 11 +++--------
meson_python_compile.py | 8 +++-----
3 files changed, 8 insertions(+), 16 deletions(-)
---
diff --git a/libgit2-glib/meson.build b/libgit2-glib/meson.build
index 9158178..3dad497 100644
--- a/libgit2-glib/meson.build
+++ b/libgit2-glib/meson.build
@@ -239,10 +239,9 @@ libgit2_glib_dep = declare_dependency(
)
if enable_python
- python.install_sources(
+ install_data(
'Ggit.py',
- pure: false,
- subdir: 'gi/overrides',
+ install_dir: join_paths(python.sysconfig_path('purelib'), 'gi', 'overrides'),
)
endif
diff --git a/meson.build b/meson.build
index 354ac6d..8b5efe9 100644
--- a/meson.build
+++ b/meson.build
@@ -38,8 +38,8 @@ libversion = '@0@.@1@.@2@'.format(soversion, current, revision)
darwin_versions = [current + 1, '@0@.@1@'.format(current + 1, revision)]
libgit2_glib_prefix = get_option('prefix')
-libgit2_glib_libdir = get_option('libdir')
-libgit2_glib_datadir = get_option('datadir')
+libgit2_glib_libdir = join_paths(libgit2_glib_prefix, get_option('libdir'))
+libgit2_glib_datadir = join_paths(libgit2_glib_prefix, get_option('datadir'))
libgit2_glib_pkgincludedir = join_paths(get_option('includedir'), libgit2_glib_api_name,
meson.project_name())
@@ -157,12 +157,7 @@ endif
# Check for python
enable_python = get_option('python')
if enable_python
- python = import('python').find_installation('python3')
-
- python_req = '3.2.3'
-
- dependency('pygobject-3.0', version: '>= 3.0.0')
- assert(python.language_version().version_compare('>= ' + python_req), 'python support was requested, but
version >= ' + python_req + ' not found.')
+ python = import('python3')
meson.add_install_script('meson_python_compile.py', libgit2_glib_libdir)
endif
diff --git a/meson_python_compile.py b/meson_python_compile.py
old mode 100644
new mode 100755
index 1fa54ff..1ffe0c0
--- a/meson_python_compile.py
+++ b/meson_python_compile.py
@@ -5,12 +5,10 @@ import subprocess
import sys
if not os.environ.get('DESTDIR'):
- prefix = os.environ['MESON_INSTALL_PREFIX']
-
- libdir = os.path.join(prefix, sys.argv[1])
+ libdir = sys.argv[1]
print('Byte-compiling python modules...')
- subprocess.call(['python', '-m', 'compileall', '-f', '-q', libdir])
+ subprocess.call(['python3', '-m', 'compileall', '-f', '-q', libdir])
print('Byte-compiling python modules (optimized versions) ...')
- subprocess.call(['python', '-O', '-m', 'compileall', '-f', '-q', libdir])
+ subprocess.call(['python3', '-O', '-m', 'compileall', '-f', '-q', libdir])
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]