Source: ck
Version: 0.7.2-12
Tags: patch
User: [email protected]
Usertags: cross-satisfiability ftcbfs
X-Debbugs-Cc: [email protected]

ck uses the home-grown configure script presumably due to missing configure.ac.
This has a few wrong assumptions leading to FTBFS

a) `CC` is never passed to it due to invoking ./configure. Passing it along 
d/rules fixes that.
b) `COMPILER` is set with writing a test program and compiling it which can't 
work during cross build.
c) `PLATFORM` is not passed in d/rules (except unknown for a few archs) and so 
configure makes use of `uname -m` which would return build arch.

The attached patch fixes this. Please consider applying.

Thanks,
Nilesh
   
commit be00cc09d01bf51a870c9d175e5539632bbf95df
Author: Nilesh Patra <[email protected]>
Date:   Tue Nov 3 19:38:00 2026 +0100

    Make ck cross-build

diff --git a/debian/patches/cross.patch b/debian/patches/cross.patch
new file mode 100644
index 0000000..713d7ab
--- /dev/null
+++ b/debian/patches/cross.patch
@@ -0,0 +1,16 @@
+--- a/configure
++++ b/configure
+@@ -699,8 +699,11 @@
+ EOF
+ 
+ $CC -o .1 .1.c
+-COMPILER=`./.1 2> /dev/null`
+-r=$?
++r=0
++if test -z "$COMPILER"; then
++      COMPILER=`./.1 2> /dev/null`
++      r=$?
++fi
+ rm -f .1.c .1
+ 
+ if test "$r" -ne 0; then
diff --git a/debian/patches/series b/debian/patches/series
index 5cb9569..3776f5f 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -1 +1,2 @@
 debian/0001-ftbfs-armhf.patch
+cross.patch
diff --git a/debian/rules b/debian/rules
index bd30f81..b61d639 100755
--- a/debian/rules
+++ b/debian/rules
@@ -1,7 +1,10 @@
 #!/usr/bin/make -f
 
+include /usr/share/dpkg/buildtools.mk
 include /usr/share/dpkg/architecture.mk
 
+PLATFORM = --platform=$(DEB_HOST_ARCH)
+
 ifneq (,$(filter $(DEB_HOST_ARCH), armel x32))
        PLATFORM = --platform=unknown
 endif
@@ -12,7 +15,7 @@ ifeq ($(DEB_HOST_ARCH),armhf)
 endif
 
 ifeq ($(DEB_HOST_ARCH), i386)
-       PLATFORM = --disable-sse
+       PLATFORM += --disable-sse
 endif
 
 ifneq (,$(filter parallel=%,$(DEB_BUILD_OPTIONS)))
@@ -34,7 +37,7 @@ execute_after_dh_auto_clean:
        done
 
 override_dh_auto_configure:
-       dh_auto_configure -- \
+       CC=$(CC) COMPILER=gcc dh_auto_configure -- \
                --prefix=/usr \
                --libdir=/usr/lib/$(DEB_HOST_MULTIARCH) \
                --includedir=/usr/include \

Reply via email to