Bug#692852: dolfin: Avoid hardcoding the swig2.0 version

Stefano Rivera stefanor at debian.org
Fri Nov 9 19:42:30 UTC 2012


Package: dolfin
Version: 1.0.0-7
Severity: minor
Tags: patch

Must the versions of swig2.0 really be hardcoded?

Julien suggested determining it at build time, in bug #675207 #90.
But that appears to have not been implemented. Here's an implementation.
It's ugly, but does the trick.

Thanks for considering the patch.

SR

diff -Nru dolfin-1.0.0/debian/control dolfin-1.0.0/debian/control
--- dolfin-1.0.0/debian/control	2012-06-29 09:46:42.000000000 +0200
+++ dolfin-1.0.0/debian/control	2012-11-09 19:54:13.000000000 +0200
@@ -130,8 +130,8 @@
  python-ufl (>= 1.0.0),
  python-instant (>= 1.0.0),
  python-numpy,
- swig2.0 (>= 2.0.7), swig2.0 (<< 2.0.8~),
  python-netcdf,
+ ${swig:Depends},
  ${python:Depends},
  ${shlibs:Depends},
  ${misc:Depends}
diff -Nru dolfin-1.0.0/debian/rules dolfin-1.0.0/debian/rules
--- dolfin-1.0.0/debian/rules	2012-06-29 09:46:42.000000000 +0200
+++ dolfin-1.0.0/debian/rules	2012-11-09 20:47:58.000000000 +0200
@@ -61,6 +61,13 @@
 
 install/python-dolfin:: $(addprefix install-stamp-, $(PY_VERSIONS))
 
+binary-predeb/python-dolfin::
+	# We have a tight dependency on swig2.0 - #675207
+	set -e; \
+	swig_version=$$(dpkg-query -W swig2.0 | cut -f 2 | cut -d- -f 1); \
+	next_swig_version="$${swig_version%.*}.$$(($${swig_version##*.} + 1))"; \
+	echo "swig:Depends=swig2.0 (>= $$swig_version), swig2.0 (<< $$next_swig_version~)" >> debian/python-dolfin.substvars
+
 binary-install/python-dolfin::
 	dh_python2 -p$(cdbs_curpkg)
 	dh_numpy -p$(cdbs_curpkg)



More information about the debian-science-maintainers mailing list