summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJames McCoy <jamessan@debian.org>2020-04-05 08:57:41 -0400
committerJames McCoy <jamessan@debian.org>2020-04-24 23:46:43 -0400
commita8bfaf1f09203175ef29ead16decf56bc4fe5f96 (patch)
treea9e7dd8cfa6cf578a76574ba753c6d20fdc245f6
parentdd90071925269b3034441fb5440b721075eb9542 (diff)
Disable building python-subversion if SWIG 4.0 is installed
The python2 bindings can't be built with SWIG 4.0. The next upstream subversion release is going to have support for Python 3, so the bindings will be re-enabled then. Closes: #954866 Signed-off-by: James McCoy <jamessan@debian.org>
-rw-r--r--debian/control2
-rwxr-xr-xdebian/rules33
2 files changed, 30 insertions, 5 deletions
diff --git a/debian/control b/debian/control
index 3430ef1..5b6a816 100644
--- a/debian/control
+++ b/debian/control
@@ -32,7 +32,7 @@ Build-Depends: autoconf,
rename,
ruby,
ruby-dev,
- swig3.0,
+ swig,
zlib1g-dev
Build-Conflicts: libsvn-dev (<< 1.13~)
Rules-Requires-Root: no
diff --git a/debian/rules b/debian/rules
index b06c90f..3642d1a 100755
--- a/debian/rules
+++ b/debian/rules
@@ -38,6 +38,12 @@ endif
# We may need to disable libapache2-mod-svn and/or libsvn-ruby*.
ENABLE_APACHE = yes
ENABLE_RUBY = yes
+# Disable packaging python2 bindings if swig4 is installed
+ifeq (,$(filter 4%,$(shell dpkg-query -W -f '$${Version}' swig 2>/dev/null)))
+ ENABLE_PYTHON = yes
+else
+ ENABLE_PYTHON = no
+endif
DEB_BUILDDIR = $(CURDIR)/BUILD
MAKE_B = $(MAKE) -C $(DEB_BUILDDIR)
@@ -50,7 +56,7 @@ export HOME = $(DEB_BUILDDIR)/dummy_home
# ENABLE_FOO -> DEB_OPT_WITH_FOO=1
# DEB_BUILD_OPTIONS='foo bar' -> DEB_OPT_FOO=1, DEB_OPT_BAR=1
# DEB_BUILD_OPTIONS='no-foo' -> DEB_OPT_WITH_FOO=""
-$(foreach o, JAVAHL APACHE RUBY, $(if $(filter y yes 1,$(ENABLE_$o)), \
+$(foreach o, JAVAHL APACHE RUBY PYTHON, $(if $(filter y yes 1,$(ENABLE_$o)), \
$(eval DEB_OPT_WITH_$o := 1),$(eval DEB_OPT_WITH_$o :=)))
d_b_o:=$(shell echo "$$DEB_BUILD_OPTIONS" | tr 'a-z-,' 'A-Z_ ')
$(foreach o, $(d_b_o), \
@@ -100,7 +106,7 @@ confflags = \
--with-sasl=/usr \
--with-editor=/usr/bin/editor \
--with-ruby-sitedir=/usr/lib/ruby \
- --with-swig=/usr/bin/swig3.0 \
+ --with-swig=/usr/bin/swig \
--with-lz4 \
--with-utf8proc \
CFLAGS="$(CFLAGS)" \
@@ -145,6 +151,12 @@ else
RUBY = fooby
endif
+ifdef DEB_OPT_WITH_PYTHON
+ PYTHON = python
+else
+ DH_OPTIONS += -Npython-subversion
+ PYTHON = foothon
+endif
# Set autoconf cross-compile mode correctly.
# Also disable testsuite if cross-compiling.
@@ -182,7 +194,8 @@ debian/stamp-configure: debian/stamp-autogen
mkdir -p $(DEB_BUILDDIR) $(HOME)
cd $(DEB_BUILDDIR) && \
- PYTHON=/usr/bin/python RUBY=/usr/bin/$(RUBY) \
+ PYTHON=/usr/bin/$(PYTHON) \
+ RUBY=/usr/bin/$(RUBY) \
$(CURDIR)/configure $(confflags) || (cat $(DEB_BUILDDIR)/config.log; false)
# Subversion upstream ships with Swig 1.3.25 pregenerated
@@ -191,6 +204,7 @@ debian/stamp-configure: debian/stamp-autogen
# Thus we unconditionally delete the pregenerated files.
+$(MAKE_B) mkdir-init
+$(MAKE_B) extraclean-bindings
+ifdef DEB_OPT_WITH_PYTHON
for v in $(PYVERSIONS); do \
cp -la $(PY_DIR) $(PY_DIR)$$v; \
done
@@ -198,13 +212,14 @@ debian/stamp-configure: debian/stamp-autogen
# $(PY_DIR) always needs to exist to avoid the upstream Makefiles from
# trying to re-create it
ln -sfT python$(PYDEFAULT) $(PY_DIR)
+endif
touch $@
build: debian/stamp-build-arch debian/stamp-build-indep
check_defs = CLEANUP=1 LC_ALL=C
-check_swig = check-swig-py check-swig-pl $(if $(DEB_OPT_WITH_RUBY),check-swig-rb)
+check_swig = $(if $(DEB_OPT_WITH_PYTHON),check-swig-py) check-swig-pl $(if $(DEB_OPT_WITH_RUBY),check-swig-rb)
check_all = $(check_swig) $(if $(DEB_OPT_WITH_JAVAHL),check-javahl) check
check-help:
@echo "$(MAKE) $(check_all)"
@@ -226,14 +241,18 @@ debian/stamp-build-arch: debian/stamp-configure
$(DONT_BE_ROOT)
# note: autogen-swig does not support -jN
+ifdef DEB_OPT_WITH_PYTHON
$(call allpy, $(MAKE_B) -j1 autogen-swig)
+endif
+$(MAKE_B) all tools
# Run svn once, to make sure it populates $(HOME)/.subversion/*
env LD_LIBRARY_PATH="$(AUTH_LIB_DIRS):$(LD_LIBRARY_PATH)" $(DEB_BUILDDIR)/subversion/svn/svn --version > /dev/null
+ifdef DEB_OPT_WITH_PYTHON
$(call allpy, \
$(MAKE_B) swig-py PYTHON=python$$v PYVER=$$v \
PYTHON_INCLUDES="$$pyinc" \
swig_pydir=$$pylib/libsvn swig_pydir_extra=$$pylib/svn)
+endif
# note: swig-pl seems to have trouble with -jN
+$(MAKE_B) -j1 swig-pl MAN3EXT=3perl
$(MAKE) -C $(PERL_DIR) all \
@@ -329,12 +348,14 @@ debian/stamp-install-arch: debian/stamp-build-arch
DESTDIR=$(CURDIR)/debian/tmp toolsdir=/usr/bin pkgconfig_dir=$(libdir)/pkgconfig
sed -i 's:/usr/lib/\([^/]*/\)?lib\([^ ]*\).la:-l\1:g' debian/tmp/usr/lib/*/*.la
+ifdef DEB_OPT_WITH_PYTHON
$(call allpy, \
$(MAKE_B) install-swig-py DESTDIR=$(CURDIR)/debian/tmp \
PYTHON=python$$v PYVER=$$v \
swig_pydir=$$pylib/libsvn swig_pydir_extra=$$pylib/svn)
$(RM) debian/tmp/usr/lib/python*/*-packages/libsvn/*.la
$(RM) debian/tmp/usr/lib/python*/*-packages/libsvn/*.a
+endif
ifdef DEB_OPT_WITH_JAVAHL
$(MAKE_B) install-javahl install-javahl-java \
@@ -421,8 +442,10 @@ ifdef DEB_OPT_WITH_APACHE
debian/libapache2-mod-svn/usr/share/doc/libapache2-mod-svn/INSTALL.authz
endif
+ifdef DEB_OPT_WITH_PYTHON
cp tools/examples/svnshell.py debian/python-subversion/usr/bin/svnshell
$(call fix_shebangs_in, debian/python-subversion/usr/bin/svnshell)
+endif
dh_installdocs -a NOTICE
dh_installexamples -a
@@ -430,7 +453,9 @@ endif
dh_installman -a
dh_installchangelogs -a CHANGES
dh_perl -a
+ifdef DEB_OPT_WITH_PYTHON
dh_python2 -a
+endif
dh_link -a
dh_lintian -a
dh_fixperms -a