tags 729875 +patch
Hi,
On Mon, Nov 18, 2013 at 03:04:51PM +0100, Roland Stigge wrote:
> Source: gdal
> Version: 1.9.0-3.1
> Severity: serious
>
> Hi!
>
> gdal FTBFS like this:
>
> ===
> make[3]: Entering directory `/«PKGBUILDDIR»/frmts/dods'
> /bin/bash /«PKGBUILDDIR»/libtool --mode=compile --tag=CXX g++ -g -O2 -Wall
> -I/«PKGBUILDDIR»/port -I/«PKGBUILDDIR»/gcore -I/«PKGBUILDDIR»/alg
> -I/«PKGBUILDDIR»/ogr -I/«PKGBUILDDIR»/ogr/ogrsf_frmts -DOGR_ENABLED
> -I/«PKGBUILDDIR»/port -I/usr/include -I/usr/include -I/usr/include/libdap
> -I/usr/include/dap -DLIBDAP_39 -c -o ../o/dodsdataset2.lo dodsdataset2.cpp
> libtool: compile: g++ -g -O2 -Wall -I/«PKGBUILDDIR»/port
> -I/«PKGBUILDDIR»/gcore -I/«PKGBUILDDIR»/alg -I/«PKGBUILDDIR»/ogr
> -I/«PKGBUILDDIR»/ogr/ogrsf_frmts -DOGR_ENABLED -I/«PKGBUILDDIR»/port
> -I/usr/include -I/usr/include -I/usr/include/libdap -I/usr/include/dap
> -DLIBDAP_39 -c dodsdataset2.cpp -fPIC -DPIC -o ../o/.libs/dodsdataset2.o
> In file included from /usr/include/libdap/AttrTable.h:54:0,
> from /usr/include/libdap/BaseType.h:57,
> from dodsdataset2.cpp:38:
> /usr/include/libdap/XMLWriter.h:33:29: fatal error: libxml/encoding.h: No
> such file or directory
> compilation terminated.
> make[3]: *** [../o/dodsdataset2.lo] Error 1
> make[2]: *** [dods-install-obj] Error 2
> make[3]: Leaving directory `/«PKGBUILDDIR»/frmts/dods'
> make[2]: Leaving directory `/«PKGBUILDDIR»/frmts'
> make[1]: *** [frmts-target] Error 2
> ===
>
> Looks like pkg-config of libdap isn't used correctly. Would include
> -I/usr/include/libxml2 etc.
Attached is a debdiff, taken from upstream changeset r25197.
Michael
diff -Nru gdal-1.9.0/debian/changelog gdal-1.9.0/debian/changelog
--- gdal-1.9.0/debian/changelog 2012-09-18 17:26:01.0 +0200
+++ gdal-1.9.0/debian/changelog 2013-11-22 20:07:56.0 +0100
@@ -1,3 +1,12 @@
+gdal (1.9.0-3.2) unstable; urgency=low
+
+ * Non-maintainer upload.
+ * debian/patches/libdap-xml2-include: New patch, fixes required includes for
+libdap, taken from upstream subversion revison 25197.
+(Closes: #729875)
+
+ -- Michael Banck Fri, 22 Nov 2013 20:02:42 +0100
+
gdal (1.9.0-3.1) unstable; urgency=low
* Non-maintainer upload.
diff -Nru gdal-1.9.0/debian/patches/libdap-xml2-include
gdal-1.9.0/debian/patches/libdap-xml2-include
--- gdal-1.9.0/debian/patches/libdap-xml2-include 1970-01-01
01:00:00.0 +0100
+++ gdal-1.9.0/debian/patches/libdap-xml2-include 2013-11-22
20:07:31.0 +0100
@@ -0,0 +1,153 @@
+Index: gdal-1.9.0/configure.in
+===
+--- gdal-1.9.0.orig/configure.in 2013-11-22 20:01:17.834062894 +0100
gdal-1.9.0/configure.in2013-11-22 20:07:26.743982986 +0100
+@@ -2269,37 +2269,49 @@
+ DODS_INC="-I$with_dods_root/include -I$with_dods_root/include/libdap
-I$with_dods_root/include/dap"
+ DODS_BIN=$with_dods_root/bin
+
+-dnl Test if we have libdap >= 3.10
+-dnl From libdap 3.10, AISConnect.h has been renamed as Connect.h
+-rm -f islibdappost310.*
+-echo '#include "Connect.h"' > islibdappost310.cpp
+-echo 'int main(int argc, char** argv) { return 0; } ' >> islibdappost310.cpp
+-if test -z "`${CXX} islibdappost310.cpp -c ${DODS_INC} 2>&1`" ; then
+-dnl yes, libdap >= 3.10
+-DODS_INC="$DODS_INC -DLIBDAP_310 -DLIBDAP_39"
+-AC_MSG_RESULT([libdap >= 3.10])
+-else
+-AC_MSG_RESULT([libdap < 3.10])
+-
+-dnl Test if we have libdap < 3.9
+-dnl Before libdap < 3.9, DAS derived from AttrTable class
+-dnl I wish they had defines with version numbers instead of this test !
+-rm -f islibdappre39.*
+-echo '#include "DAS.h"' > islibdappre39.cpp
+-echo '#include "AttrTable.h"' >> islibdappre39.cpp
+-echo 'using namespace libdap;' >> islibdappre39.cpp
+-echo 'int main(int argc, char** argv) { DAS oDAS; AttrTable& oAttrTable =
oDAS; } ' >> islibdappre39.cpp
+-if test -z "`${CXX} islibdappre39.cpp -c ${DODS_INC} 2>&1`" ; then
+-dnl yes, libdap < 3.9
+-AC_MSG_RESULT([libdap < 3.9])
++dnl Check libdap version the sane way (if possible through dap-config)
++if test -x $DODS_BIN/dap-config ; then
++LIBDAP_VER=`${DODS_BIN}/dap-config --version |awk '{print \$2}'`
++LIBDAP_CFLAGS=`${DODS_BIN}/dap-config --cflags`
++dnl The dods driver needs LIBDAP_320 and LIBDAP_39 defined to include
the right headers
++DODS_INC="$DODS_INC $LIBDAP_CFLAGS -DLIBDAP_310 -DLIBDAP_39"
++dnl libs from dap-config gets added further down
++AC_MSG_RESULT([libdap $LIBDAP_VER])
+ else
+-DODS_INC="$DODS_INC -DLIBDAP_39"
+-AC_MSG_RESULT([libdap >= 3.9])
+-fi
+-rm -f islibdappre39.*
++dnl Check the version by compiling test programs
++
++dnl Test if we have libdap >=