Source: tidy-html5
Version: 1:5.2.0-2
Tags: patch
User: [email protected]
Usertags: rebootstrap

tidy-html5 fails to cross build from source, because it attempts to
generate the manual page from the host architecture tidy program
resulting from the build.

Since cmake cannot distinguish build and host architecture, my attached
patch opts to build tidy-html5 twice (during cross builds). A native
pass is used to generate the manual page and then there is a regular
pass. After doing so, tidy-html5 cross builds successfully. I'm sorry
for the size of the patch, but I failed to find a less invasive
solution. Please consider applying it anyway.

Helmut
diff --minimal -Nru tidy-html5-5.2.0/debian/changelog 
tidy-html5-5.2.0/debian/changelog
--- tidy-html5-5.2.0/debian/changelog   2016-08-04 11:55:19.000000000 +0200
+++ tidy-html5-5.2.0/debian/changelog   2017-09-11 11:38:49.000000000 +0200
@@ -1,3 +1,10 @@
+tidy-html5 (1:5.2.0-2.1) UNRELEASED; urgency=medium
+
+  * Non-maintainer upload.
+  * Fix FTCBFS: Add a native build pass for tidy.1. (Closes: #-1)
+
+ -- Helmut Grohne <[email protected]>  Mon, 11 Sep 2017 11:38:49 +0200
+
 tidy-html5 (1:5.2.0-2) unstable; urgency=low
 
   * Team upload.
diff --minimal -Nru tidy-html5-5.2.0/debian/rules tidy-html5-5.2.0/debian/rules
--- tidy-html5-5.2.0/debian/rules       2016-08-04 11:55:19.000000000 +0200
+++ tidy-html5-5.2.0/debian/rules       2017-09-11 11:38:49.000000000 +0200
@@ -1,13 +1,35 @@
 #! /usr/bin/make -f
 
-export DEB_BUILD_MAINT_OPTIONS=hardening=+all
+include /usr/share/dpkg/architecture.mk
 
-%:
-       dh $@ --parallel
+export DEB_BUILD_MAINT_OPTIONS=hardening=+all
 
-override_dh_auto_configure:
-       dh_auto_configure -- \
+NATIVE=eval $$(dpkg-architecture -f -a$(DEB_BUILD_ARCH) -s);
+CONFIGURE_FLAGS = \
                -DTIDY_CONSOLE_SHARED:BOOL=YES \
                -DTIDY_COMPAT_HEADERS:BOOL=YES \
                -DTIDY_CONFIG_FILE:STRING=/etc/tidy.conf \
                -DTIDY_USER_CONFIG_FILE:STRING=~/.tidyrc \
+
+%:
+       dh $@ --parallel
+
+override_dh_auto_configure:
+ifneq ($(DEB_BUILD_ARCH),$(DEB_HOST_ARCH))
+       $(NATIVE) dh_auto_configure --builddirectory=build-native -- 
$(CONFIGURE_FLAGS)
+       dh_auto_configure -- $(CONFIGURE_FLAGS) -DXSLTPROC_FOUND:BOOL=Off
+else
+       dh_auto_configure -- $(CONFIGURE_FLAGS)
+endif
+
+ifneq ($(DEB_BUILD_ARCH),$(DEB_HOST_ARCH))
+override_dh_auto_build:
+       $(NATIVE) dh_auto_build --builddirectory=build-native
+       dh_auto_build
+endif
+
+ifneq ($(DEB_BUILD_ARCH),$(DEB_HOST_ARCH))
+override_dh_auto_install:
+       install -D -m644 build-native/tidy.1 
debian/tmp/usr/share/man/man1/tidy.1
+       dh_auto_install
+endif

Reply via email to