spack/var/spack/repos/builtin/packages/geos/geos_python3_config.patch
Tom Payerle 5a7c339b0c
geos: Fix config issues with python bindings using python3 (#23479) (#23480)
* geos: Fix config issues with python bindings using python3 (#23479)

This should fix some config issues when building geos with python
bindings and using python3 --- the geos configuration scripts had
a few python2-isms.

I only tested (lightly; geos built and I can import geos in python3)
on 3.8.1, but I did check that the patch can at least be applied
in 3.5.

I belatedly discovered that geos dropped all the SWIG bindings
in @3.9, so I also added some conflicts on the +python and +ruby
options to note that they are not supported in 3.9.

* geos: adding omitted patch file
2021-05-07 12:27:29 -05:00

68 lines
3.7 KiB
Diff

diff -Naur spack-src/configure spack-src.patched/configure
--- spack-src/configure 2020-03-10 13:55:53.000000000 -0400
+++ spack-src.patched/configure 2021-05-06 11:33:59.062284048 -0400
@@ -19263,10 +19263,11 @@
# Check for Python library path
+ PYTHON_MAJOR=`echo $PYTHON_VERSION | sed "s,\..*$,,"`
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for Python library path" >&5
$as_echo_n "checking for Python library path... " >&6; }
for i in "$base_python_path/lib/python$PYTHON_VERSION/config/" "$base_python_path/lib/python$PYTHON_VERSION/" "$base_python_path/lib/python/config/" "$base_python_path/lib/python/" "$base_python_path/" "$base_python_path/libs/" ; do
- python_path=`find $i -name libpython$PYTHON_VERSION.* -print 2> /dev/null | sed "1q"`
+ python_path=`find $i -name libpython$PYTHON_MAJOR.* -print 2> /dev/null | sed "1q"`
if test -n "$python_path" ; then
break
fi
@@ -19277,7 +19278,7 @@
if test -z "$python_path" ; then
as_fn_error $? "cannot find Python library path" "$LINENO" 5
fi
- PYTHON_LDFLAGS="-L$python_path -lpython$PYTHON_VERSION"
+ PYTHON_LDFLAGS="-L$python_path -lpython$PYTHON_MAJOR"
#
python_site=`echo $base_python_path | sed "s/config/site-packages/"`
@@ -19290,7 +19291,7 @@
$as_echo_n "checking python extra libraries... " >&6; }
PYTHON_EXTRA_LIBS=`$PYTHON -c "import distutils.sysconfig; \
conf = distutils.sysconfig.get_config_var; \
- print (conf('LOCALMODLIBS') or '')+' '+(conf('LIBS') or '')"
+ print((conf('LOCALMODLIBS') or '')+' '+(conf('LIBS') or ''))"
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $PYTHON_EXTRA_LIBS" >&5
$as_echo "$PYTHON_EXTRA_LIBS" >&6; }`
diff -Naur spack-src/macros/ac_python_devel.m4 spack-src.patched/macros/ac_python_devel.m4
--- spack-src/macros/ac_python_devel.m4 2017-09-06 09:48:30.000000000 -0400
+++ spack-src.patched/macros/ac_python_devel.m4 2021-05-06 11:32:59.545478100 -0400
@@ -43,9 +43,10 @@
AC_SUBST([PYTHON_CPPFLAGS],[-I$python_path])
# Check for Python library path
+ PYTHON_MAJOR=`echo $PYTHON_VERSION | sed "s,\..*$,,"`
AC_MSG_CHECKING([for Python library path])
for i in "$base_python_path/lib/python$PYTHON_VERSION/config/" "$base_python_path/lib/python$PYTHON_VERSION/" "$base_python_path/lib/python/config/" "$base_python_path/lib/python/" "$base_python_path/" "$base_python_path/libs/" ; do
- python_path=`find $i -name libpython$PYTHON_VERSION.* -print 2> /dev/null | sed "1q"`
+ python_path=`find $i -name libpython$PYTHON_MAJOR.* -print 2> /dev/null | sed "1q"`
if test -n "$python_path" ; then
break
fi
@@ -55,7 +56,7 @@
if test -z "$python_path" ; then
AC_MSG_ERROR([cannot find Python library path])
fi
- AC_SUBST([PYTHON_LDFLAGS],["-L$python_path -lpython$PYTHON_VERSION"])
+ AC_SUBST([PYTHON_LDFLAGS],["-L$python_path -lpython$PYTHON_MAJOR"])
#
python_site=`echo $base_python_path | sed "s/config/site-packages/"`
AC_SUBST([PYTHON_SITE_PKG],[$python_site])
@@ -65,7 +66,7 @@
AC_MSG_CHECKING(python extra libraries)
PYTHON_EXTRA_LIBS=`$PYTHON -c "import distutils.sysconfig; \
conf = distutils.sysconfig.get_config_var; \
- print (conf('LOCALMODLIBS') or '')+' '+(conf('LIBS') or '')"
+ print((conf('LOCALMODLIBS') or '')+' '+(conf('LIBS') or ''))"
AC_MSG_RESULT($PYTHON_EXTRA_LIBS)`
AC_SUBST(PYTHON_EXTRA_LIBS)
])