Building from source fails due to python2 syntax in configure

Bug #2015023 reported by David Huggins-Daines
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
graphviz (Ubuntu)
Invalid
Undecided
Unassigned

Bug Description

When building packages, dh_install --arch fails because the python3 files have not been installed into debian/tmp.

The reason for this is that Python configuration (at least here on Ubuntu 22.04) partly fails, because the configure script is using Python 2 "print" syntax.

The fix is very simple:

--- a/configure.ac 2023-04-02 20:42:26.198046287 -0400
+++ b/configure.ac 2023-04-02 20:42:47.214182903 -0400
@@ -1182,7 +1182,7 @@
       if test "x$PYTHON" = "x"; then
  use_python="No (python is too old)"
       else
- PYTHON_PREFIX=`$PYTHON -c "import sys; print sys.prefix"`
+ PYTHON_PREFIX=`$PYTHON -c "import sys; print(sys.prefix)"`
         PYTHON_INCLUDES=-I$PYTHON_PREFIX/include/python$PYTHON_VERSION_SHORT
 # PYTHON_LIBS="-lpython$PYTHON_VERSION_SHORT"
  PYTHON_LIBS="-undefined dynamic_lookup"

Related branches

Revision history for this message
David Huggins-Daines (dhuggins) wrote :
Revision history for this message
Dave Jones (waveform) wrote :

The current package for graphviz in the Ubuntu archive appears to be building happily, but the packaging configures with --enable-python3 rather than --enable-python. The former has valid syntax for python3 on line 1331 of configure.ac:

        PYTHON3_PREFIX=`$PYTHON3 -c "import sys; print(sys.prefix)"`
        PYTHON3_INSTALL_DIR="`$PYTHON3 $srcdir/config/config_python.py archsitelib`"

I'd hazard a guess that the --enable-python section (further up) is redundant (I note upstream it's now basically a stub for --enable-python3, and --enable-python2 has been removed entirely). Hence, I'm afraid this is likely invalid.

I'm just having a look at the other bug in your merge request, which at first glance does look valid but I'll comment over on the corresponding bug in a bit.

Changed in graphviz (Ubuntu):
status: New → Invalid
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.