]> granicus.if.org Git - graphviz/commitdiff
Autotools: remove legacy `python` discovery
authorMatthew Fernandez <matthew.fernandez@gmail.com>
Thu, 29 Dec 2022 21:16:01 +0000 (13:16 -0800)
committerMatthew Fernandez <matthew.fernandez@gmail.com>
Fri, 30 Dec 2022 17:36:02 +0000 (09:36 -0800)
When removing Python 2 support, the discovery paths that checked for the Python
interpreter as `python` were retained to support older distros in the Red Hat
ecosystem where Python 3 goes by the name `python`. All currently supported
distros use the name `python3`, so this code is no longer needed.

Gitlab: related to #2332

CHANGELOG.md
configure.ac
tclpkg/Makefile.am
tclpkg/gv/Makefile.am
tclpkg/gv/demo/Makefile.am

index fa7dab95749c039577910b5eb8a26d57c875da1d..7e288817bc1f53169f3a9193cd3aa31cb0227ebd 100644 (file)
@@ -6,6 +6,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
 
 ## [Unreleased (7.0.6)]
 
+### Changed
+
+- The Autotools build system no longer looks for `python` binaries. The Python
+  interpreter is unconditionally assumed to be `python3`. The configure option
+  `--enable-python` is now an alias for `--enable-python3`.
+
 ### Fixed
 
 - The modgraph.php example no longer includes gv.php, which is no longer
index 91919b068ac590cf2cb6933458a4bc7349267d98..ef8a8113fd0a492be85e21438864e0f6bb0c8464 100644 (file)
@@ -1099,58 +1099,10 @@ AM_CONDITIONAL(WITH_PHP, [test "x$use_php" = "xYes"])
 dnl -----------------------------------
 dnl INCLUDES and LIBS for PYTHON
 
+# alias for `--enable-python3`
 AC_ARG_ENABLE(python,
   [AS_HELP_STRING([--enable-python=yes],[python language bindings])],
-  [], [enable_python=yes])
-
-if test "x$enable_python" != "xyes"; then
-  use_python="No (disabled)"
-else
-  if test "x$use_swig" != "xYes"; then
-    use_python="No (swig not available)"
-  else
-    if test `$SWIG -help 2>&1 | $EGREP -c '\-python *- Generate'` = 0; then
-      use_python="No (swig does not support -python option)"
-    else
-      AC_CHECK_PROG(PYTHON,python,python)
-      if test "x$PYTHON" = "x"; then
-        use_python="No (python not available)"
-      else
-        PYTHON_VERSION=`$PYTHON -c "import sys; print('%d.%d' % sys.version_info[[0:2]])"`
-        if test "x$PYTHON_VERSION" = "x"; then
-          PYTHON=
-        else
-          AX_COMPARE_VERSION([$PYTHON_VERSION], [lt], [3], [PYTHON=])
-        fi
-      fi
-      if test "x$PYTHON" = "x"; then
-       use_python="No (python is too old)"
-      else
-        PYTHON_PREFIX=`$PYTHON -c "import sys; print(sys.prefix)"`
-        PYTHON_INCLUDES=-I$PYTHON_PREFIX/include/python$PYTHON_VERSION
-       PYTHON_LIBS="-undefined dynamic_lookup"
-        PYTHON_INSTALL_DIR="`$PYTHON -c 'from distutils import sysconfig; print(sysconfig.get_python_lib(1,0))'`"
-        save_CPPFLAGS=$CPPFLAGS
-        CPPFLAGS="$CPPFLAGS $PYTHON_INCLUDES"
-        AC_CHECK_HEADER(Python.h,,[
-          use_python="No (missing header)"
-          PYTHON=
-        ])
-        CPPFLAGS=$save_CPPFLAGS
-       if test "x$PYTHON" != "x"; then
-         use_python="Yes"
-          AC_SUBST([PYTHON_INSTALL_DIR])
-          AC_SUBST([PYTHON_INCLUDES])
-          AC_SUBST([PYTHON_LIBS])
-        fi
-      fi
-    fi
-  fi
-fi
-AM_CONDITIONAL(WITH_PYTHON, [test "x$use_python" = "xYes"])
-
-dnl -----------------------------------
-dnl INCLUDES and LIBS for PYTHON3
+  [], [enable_python3=yes])
 
 AC_ARG_ENABLE(python3,
   [AS_HELP_STRING([--enable-python3=yes],[python3 language bindings])],
@@ -2648,7 +2600,6 @@ echo "  gv_lua:        $use_lua"
 echo "  gv_ocaml:      $use_ocaml"
 echo "  gv_perl:       $use_perl"
 echo "  gv_php:        $use_php"
-echo "  gv_python:     $use_python"
 echo "  gv_python3:    $use_python3"
 echo "  gv_R:          $use_r"
 echo "  gv_ruby:       $use_ruby"
index 707812dfa68aefca09a0ea329a5a52f218d37dd0..dd851a5fff2b44877b15f666b0ba4687afa2e244 100644 (file)
@@ -9,7 +9,6 @@ pkgluadir = $(pkglibdir)/lua
 pkgocamldir = $(pkglibdir)/ocaml
 pkgperldir = $(pkglibdir)/perl
 pkgphpdir = $(pkglibdir)/php
-pkgpythondir = $(pkglibdir)/python
 pkgpython3dir = $(pkglibdir)/python3
 pkgRdir = $(pkglibdir)/R
 pkgrubydir = $(pkglibdir)/ruby
@@ -74,17 +73,6 @@ if WITH_SWIG_PHP_DATA
        fi
 endif
 endif
-if WITH_PYTHON
-       -mkdir -p $(DESTDIR)$(PYTHON_INSTALL_DIR);
-       if test -w $(DESTDIR)$(PYTHON_INSTALL_DIR); then \
-               (cd $(DESTDIR)$(PYTHON_INSTALL_DIR); \
-                       cp -f $(DESTDIR)$(pkgpythondir)/libgv_python.so _gv.so; \
-                       cp -f $(DESTDIR)$(pkgpythondir)/gv.py gv.py;) \
-       else \
-               echo "Warning: $(PYTHON_INSTALL_DIR) is not writable."; \
-               echo "Skipping system installation of python binding."; \
-       fi
-endif
 if WITH_PYTHON3
        -mkdir -p $(DESTDIR)$(PYTHON3_INSTALL_DIR);
        if test -w $(DESTDIR)$(PYTHON3_INSTALL_DIR); then \
@@ -133,8 +121,6 @@ uninstall-hook:
        -rm -rf $(DESTDIR)$(PERL_INSTALL_DIR)/gv.so $(DESTDIR)$(PERL_INSTALL_DIR)/gv.pm;
        -rm -rf $(DESTDIR)$(pkgphpdir);
        -rm -rf $(DESTDIR)$(PHP_INSTALL_DIR)/gv.so $(DESTDIR)$(PHP_INSTALL_DATADIR)/gv.php;
-       -rm -rf $(DESTDIR)$(pkgpythondir);
-       -rm -rf $(DESTDIR)$(PYTHON_INSTALL_DIR)/_gv.so $(DESTDIR)$(PYTHON_INSTALL_DIR)/gv.py;
        -rm -rf $(DESTDIR)$(pkgpython3dir);
        -rm -rf $(DESTDIR)$(PYTHON3_INSTALL_DIR)/_gv.so $(DESTDIR)$(PYTHON3_INSTALL_DIR)/gv.py;
        -rm -rf $(DESTDIR)$(pkgRdir);
index e94649c83a39050d494b50e4ec2f979353012e33..17207b8605e106e487c964d06e68cee8e40a7916 100644 (file)
@@ -201,17 +201,6 @@ php_gv.h: gv_php.cpp
 gv_php.cpp: gv.i
        $(SWIG) -c++ $(SWIG_PHP_OPT) -o $@ $(srcdir)/gv.i
 
-pkgpythondir = $(pkglibdir)/python
-PYTHON_data = gv.py
-nodist_libgv_python_la_SOURCES = gv_python.cpp $(PYTHON_data)
-libgv_python_la_SOURCES = $(BASESOURCES) gv_dummy_init.c
-libgv_python_la_LIBADD = $(BASELIBS) $(PYTHON_LIBS)
-libgv_python_la_LDFLAGS = -module -avoid-version
-libgv_python_la_CPPFLAGS = $(BASECPPFLAGS) $(PYTHON_INCLUDES)
-$(PYTHON_data): gv_python.cpp
-gv_python.cpp: gv.i
-       $(SWIG) -c++ -python -o $@ $(srcdir)/gv.i
-
 pkgpython3dir = $(pkglibdir)/python3
 PYTHON3_data = gv.py
 nodist_libgv_python3_la_SOURCES = gv_python3.cpp $(PYTHON3_data)
@@ -356,11 +345,6 @@ endif
 pkgphp_LTLIBRARIES = libgv_php.la
 DEVTSTS += test_php
 endif
-if WITH_PYTHON
-pkgpython_DATA = $(PYTHON_data)
-pkgpython_LTLIBRARIES = libgv_python.la
-DEVTSTS += test_python
-endif
 if WITH_PYTHON3
 pkgpython3_DATA = $(PYTHON3_data)
 pkgpython3_LTLIBRARIES = libgv_python3.la
@@ -482,9 +466,6 @@ endif
 if WITH_PHP
        (cd $(DESTDIR)$(pkgphpdir); rm -f gv.so; $(LN_S) libgv_php.so gv.so;)
 endif
-if WITH_PYTHON
-       (cd $(DESTDIR)$(pkgpythondir); rm -f _gv.so; $(LN_S) libgv_python.so _gv.so;)
-endif
 if WITH_PYTHON3
        (cd $(DESTDIR)$(pkgpython3dir); rm -f _gv.so; $(LN_S) libgv_python3.so _gv.so;)
 endif
@@ -568,13 +549,6 @@ test_php: libgv_php.la
                ln -fs ../$(srcdir)/*.gv ../$(srcdir)/*.php .; \
                $(PHP) ./test.php)
 
-.PHONY: test_python
-test_python: libgv_python.la
-       -(mkdir -p test_python; cd test_python; \
-               ln -fs ../.libs/libgv_python.so _gv.so; \
-               ln -fs ../$(srcdir)/*.gv ../$(srcdir)/*.py .; \
-               PYTHONPATH=. $(PYTHON) test.py)
-
 .PHONY: test_python3
 test_python3: libgv_python3.la
        -(mkdir -p test_python3; cd test_python3; \
index a6ab30805a628acd889663d3fb688b066cc5780f..6df2d02581578a0414d6672a72df2ee8081069ad 100644 (file)
@@ -8,7 +8,6 @@ demoluadir = $(demodir)
 demoocamldir = $(demodir)
 demoperldir = $(demodir)
 demophpdir = $(demodir)
-demopythondir = $(demodir)
 demopython3dir = $(demodir)
 demoRdir = $(demodir)
 demorubydir = $(demodir)
@@ -39,9 +38,6 @@ endif
 if WITH_PHP
 demophp_SCRIPTS = modgraph.php
 endif
-if WITH_PYTHON
-demopython_SCRIPTS = modgraph.py
-endif
 if WITH_PYTHON3
 demopython3_SCRIPTS = modgraph.py
 endif