Source: openfst
Version: 1.7.9-5
Tags: patch
User: debian-cr...@lists.debian.org
Usertags: ftcbfs

openfst fails to cross build from source for two reasons. One is that it
has an unskippable AC_RUN_IFELSE check. Reading configure.ac reveals
that this is a safety check that is also being done in the test suite.
We have no chance of running this test in a cross build so the only
option is to skip it in cross builds. The other is that debian/rules
passes sse flags whenever building on x86, but it should only pass the
flags when building for x86. I'm attaching a patch to fix both for your
convenience.

Helmut
diff --minimal -Nru openfst-1.7.9/debian/changelog 
openfst-1.7.9/debian/changelog
--- openfst-1.7.9/debian/changelog      2022-08-16 16:58:50.000000000 +0200
+++ openfst-1.7.9/debian/changelog      2024-04-15 13:06:02.000000000 +0200
@@ -1,3 +1,12 @@
+openfst (1.7.9-5.1) UNRELEASED; urgency=medium
+
+  * Non-maintainer upload.
+  * Fix FTCBFS: (Closes: #-1)
+    + cross.patch: Allow skipping equality reflexivity test.
+    + debian/rules: Fix build vs host confusion.
+
+ -- Helmut Grohne <hel...@subdivi.de>  Mon, 15 Apr 2024 13:06:02 +0200
+
 openfst (1.7.9-5) unstable; urgency=low
 
   * debian/rules: Set --max-parallel=2 in override_dh_auto_test to avoid
diff --minimal -Nru openfst-1.7.9/debian/patches/cross.patch 
openfst-1.7.9/debian/patches/cross.patch
--- openfst-1.7.9/debian/patches/cross.patch    1970-01-01 01:00:00.000000000 
+0100
+++ openfst-1.7.9/debian/patches/cross.patch    2024-04-15 13:06:01.000000000 
+0200
@@ -0,0 +1,12 @@
+--- openfst-1.7.9.orig/configure.ac
++++ openfst-1.7.9/configure.ac
+@@ -180,7 +180,8 @@
+               [AC_MSG_FAILURE(m4_normalize([
+                    Test float equality failed!
+                    Compile with -msse -mfpmath=sse if using g++.
+-              ]))])
++              ]))],
++              [echo "Skipping float equality test for cross compilation"])
+ 
+ AC_CHECK_LIB([dl], dlopen, [DL_LIBS=-ldl])
+ AC_SUBST([DL_LIBS])
diff --minimal -Nru openfst-1.7.9/debian/patches/series 
openfst-1.7.9/debian/patches/series
--- openfst-1.7.9/debian/patches/series 2022-08-16 16:58:50.000000000 +0200
+++ openfst-1.7.9/debian/patches/series 2024-04-15 13:05:31.000000000 +0200
@@ -1,3 +1,4 @@
 openfst-atomic.diff
 openfst-cxx17.diff
 #openfst-sse.diff # Only applied on non-x86 archs
+cross.patch
diff --minimal -Nru openfst-1.7.9/debian/rules openfst-1.7.9/debian/rules
--- openfst-1.7.9/debian/rules  2022-08-16 16:58:50.000000000 +0200
+++ openfst-1.7.9/debian/rules  2024-04-15 13:06:02.000000000 +0200
@@ -13,9 +13,9 @@
        dh $@
 
 override_dh_autoreconf:
-ifeq ($(DEB_BUILD_ARCH),i386)
+ifeq ($(DEB_HOST_ARCH),i386)
        patch -p1 < debian/patches/openfst-sse.diff
-else ifeq ($(DEB_BUILD_ARCH),amd64)
+else ifeq ($(DEB_HOST_ARCH),amd64)
        patch -p1 < debian/patches/openfst-sse.diff
 endif
        dh_autoreconf

Reply via email to