From 42b13216fc2899c62ac87c80901fd4274c406c2a Mon Sep 17 00:00:00 2001 From: Jehan Date: Sat, 16 Jun 2018 01:54:14 +0200 Subject: [PATCH] m4macros, plug-ins: run more accurately the "python2" interpreter. Our configure test checks the presence of a Python2, but then uses "python" as interpreter, which is a problem nowadays as the default python is set to be Python 3 on some distributions (and this will be more and more the case). So GIMP may end up trying to run our plug-ins through Python 3 (which would fail) even if Python 2 is present. Now AM_PATH_PYTHON2() m4 macro will set $PYTHON to a more accurate Python version as priority. Similarly let's use "python2" in the binfmt string for extension search. (cherry picked from commit 03ea9cac540b197a5b0eb11a40909c30330d90e5) --- m4macros/pythondev.m4 | 5 +++-- plug-ins/pygimp/Makefile.am | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/m4macros/pythondev.m4 b/m4macros/pythondev.m4 index 7bfbb0aaf1..6a01cf6a74 100644 --- a/m4macros/pythondev.m4 +++ b/m4macros/pythondev.m4 @@ -35,8 +35,9 @@ AC_DEFUN([AM_PATH_PYTHON2], dnl Find a Python interpreter. Python versions prior to 2.0 are not dnl supported. (2.0 was released on October 16, 2000). m4_define_default([_AM_PYTHON_INTERPRETER_LIST], -[python python2 python2.7 dnl - python2.6 python2.5 python2.4 python2.3 python2.2 python2.1 python2.0]) +[python2 python2.7 dnl + python2.6 python2.5 python2.4 python2.3 python2.2 python2.1 python2.0 dnl + python]) AC_ARG_VAR([PYTHON], [the Python interpreter]) diff --git a/plug-ins/pygimp/Makefile.am b/plug-ins/pygimp/Makefile.am index f46a0d4dd5..3ce19c0ea8 100644 --- a/plug-ins/pygimp/Makefile.am +++ b/plug-ins/pygimp/Makefile.am @@ -156,7 +156,7 @@ install-interp-file: $(mkinstalldirs) '$(DESTDIR)$(pyinterpdir)' echo 'python=$(PYBIN_PATH)' > '$(DESTDIR)$(pyinterpfile)' echo '/usr/bin/python=$(PYBIN_PATH)' >> '$(DESTDIR)$(pyinterpfile)' - echo ':Python:E::py::python:' >> '$(DESTDIR)$(pyinterpfile)' + echo ':Python:E::py::python2:' >> '$(DESTDIR)$(pyinterpfile)' install-data-local: install-env-file install-interp-file