From abdd98409d98cd5621678bff61eb7cfbc0db8621 Mon Sep 17 00:00:00 2001 From: John Cupitt Date: Thu, 18 Dec 2014 09:15:58 +0000 Subject: [PATCH] add configure option for pyvips8 it tests for pygobject as well --- ChangeLog | 1 + Makefile.am | 5 +++-- TODO | 6 ------ configure.ac | 38 +++++++++++++++++++++++++++++++------- 4 files changed, 35 insertions(+), 15 deletions(-) diff --git a/ChangeLog b/ChangeLog index aec48727..7252137f 100644 --- a/ChangeLog +++ b/ChangeLog @@ -9,6 +9,7 @@ - support python3.4 and python2.7 in new python binding - vips_gaussmat() and vips_logmat() are now int by default, to match vips_conv(), and use @precision, not @integer +- added --disable-pyvips8 switch to turn off new py binding 25/7/14 started 7.41.0 - start working on --disable-deprecated diff --git a/Makefile.am b/Makefile.am index dc25e4e7..469b168f 100644 --- a/Makefile.am +++ b/Makefile.am @@ -13,14 +13,14 @@ endif else C_COMPILE_DIR = -C_DIST_DIR = libvipsCC cplusplus +C_DIST_DIR = libvipsCC cplusplus C_PKGCONFIG = P_COMPILE_DIR = P_DIST_DIR = swig endif # turn on vips8 Python if we can -if HAVE_PYTHON +if ENABLE_PYVIPS8 P8_COMPILE_DIR = python P8_DIST_DIR = else @@ -28,6 +28,7 @@ P8_COMPILE_DIR = P8_DIST_DIR = python endif +# turn docs on or off if ENABLE_DOCS D_DIST_DIR = D_BUILD_DIR = doc diff --git a/TODO b/TODO index 6f9cb587..74af5de1 100644 --- a/TODO +++ b/TODO @@ -1,11 +1,5 @@ - tests have stopped working with python2? -- configure should check for pygobject too - - PKG_CHECK_MODULES(PYTHON, [pygobject-3.0 >= $PYGOBJECT_REQUIRED]) - - have separate conditionals for old py and new py - - use vips_resize() in vipsthumbnail? should the sharpening filter be selectable? diff --git a/configure.ac b/configure.ac index 54bffd86..3b374e5d 100644 --- a/configure.ac +++ b/configure.ac @@ -664,12 +664,35 @@ if test x"$with_pangoft2" != "xno"; then PKG_CHECK_MODULES(PANGOFT2, pangoft2, [AC_DEFINE(HAVE_PANGOFT2,1,[define if you have pangoft2 installed.]) with_pangoft2=yes - PACKAGES_USED="$PACKAGES_USED pangoft2"], + PACKAGES_USED="$PACKAGES_USED pangoft2" + ], [AC_MSG_WARN([pangoft2 not found; disabling pangoft2 support]) with_pangoft2=no ]) fi +# install vips8 python +AC_ARG_ENABLE([pyvips8], + AS_HELP_STRING([--enable-pyvips8], + [install vips8 Python overrides (default: install)])) + +if test x"$enable_pyvips8" != "xno"; then + PKG_CHECK_MODULES(PYGOBJECT, [pygobject-3.0 >= 3.1.0], + [pyoverridesdir="\$(pyexecdir)/gi/overrides" + AC_SUBST(pyoverridesdir) + ], + [AC_MSG_WARN([pgobject-3.0 not found; disabling vips8 python support]) + ]) +fi + +if test x"$enable_pyvips8" != x"no"; then + AM_CONDITIONAL(ENABLE_PYVIPS8, true) + enable_pyvips8=yes +else + AM_CONDITIONAL(ENABLE_PYVIPS8, false) + enable_pyvips8=no +fi + # hmm, these don't have .pc files on ubuntu 5.10, how odd FIND_ZIP( [with_zip=yes], @@ -755,9 +778,7 @@ if test x"$with_python" != "xno"; then with_python=no AC_MSG_WARN([C++ is off, disabling Python binding]) else - AM_PATH_PYTHON(2.7, - [pyoverridesdir="\$(pyexecdir)/gi/overrides" - AC_SUBST(pyoverridesdir)], + AM_PATH_PYTHON(2.7,, [with_python=no AC_MSG_WARN([Python not found; disabling Python binding])]) fi @@ -854,7 +875,7 @@ AC_OUTPUT([ ]) AC_MSG_RESULT([ -* general build options +* build options native win32: $vips_os_win32 native OS X: $vips_os_darwin open files in binary mode: $vips_binary_open @@ -864,8 +885,11 @@ build C++ components: $enable_cxx build docs with gtkdoc: $enable_gtk_doc install docs: $enable_docs gobject introspection: $found_introspection +build vips7 Python binding: $with_python +install vips8 Python overrides: $enable_pyvips8 + (requires pygobject-3.1.0 or later) -* optional packages and modules +* optional dependencies use fftw3 for FFT: $with_fftw Magick package: $with_magickpackage file import with libMagick: $with_magick @@ -886,4 +910,4 @@ file import/export with libjpeg: $with_jpeg image pyramid export: $with_gsf (requires libgsf-1 1.14.27 or later) use libexif to load/save JPEG metadata: $with_libexif -build Python binding: $with_python]) +])