summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristoph Reiter <reiter.christoph@gmail.com>2018-07-20 11:52:03 +0200
committerChristoph Reiter <reiter.christoph@gmail.com>2018-07-24 11:42:54 +0200
commit9383fcbf1c580c95ba32710df56c3fcb00ebedb3 (patch)
tree0ed49a7dac2b3f7385bd539123da5df2f97b3023
parent3e0f765b73ec22d82bf6d02cfaea02f5890bb04f (diff)
downloadglib-require-python34.tar.gz
build: Drop Python 2 support and require Python 3.4+require-python34
See https://mail.gnome.org/archives/desktop-devel-list/2018-July/msg00004.html for a discussion on if/when we can start relying on Python 3 only. Use Python 3.4 as a new requirement because that's the version used in SLES 12 and Debian 8 and there is no good reason to require something newer right now.
-rw-r--r--configure.ac4
-rw-r--r--meson.build7
2 files changed, 9 insertions, 2 deletions
diff --git a/configure.ac b/configure.ac
index bc6000381..4b1f6d67f 100644
--- a/configure.ac
+++ b/configure.ac
@@ -338,12 +338,12 @@ AC_PROG_AWK
# python.m4 will get the expected input
AC_ARG_WITH(python,
AS_HELP_STRING([--with-python=PATH],
- [Path to Python interpreter; searches $PATH if only a program name is given; if not given, searches for a few standard names such as "python3" or "python2"]),
+ [Path to Python interpreter; searches $PATH if only a program name is given; if not given, searches for a few standard names such as "python3"]),
[PYTHON="$withval"], [])
if test x"$PYTHON" = xyes; then
AC_MSG_ERROR([--with-python option requires a path or program argument])
fi
-AM_PATH_PYTHON(2.7,,PYTHON="python2.7")
+AM_PATH_PYTHON(3.4,,[AC_MSG_ERROR([Requires Python >=3.4])])
dnl ***********************
diff --git a/meson.build b/meson.build
index f758365f3..af53f2f04 100644
--- a/meson.build
+++ b/meson.build
@@ -1804,6 +1804,13 @@ python = import('python').find_installation('python3')
# used for '#!/usr/bin/env <name>'
python_name = 'python3'
+python_version = python.language_version()
+python_version_req = '>=3.4'
+if not python_version.version_compare(python_version_req)
+ error('Requires Python @0@, @1@ found.'.format(
+ python_version_req, python_version))
+endif
+
# Determine which user environment-dependent files that we want to install
have_bash = find_program('bash', required : false).found() # For completion scripts
have_m4 = find_program('m4', required : false).found() # For m4 macros