Source: guile-cairo
Version: 1.12.0~pre1-2
Tags: patch
User: [email protected]
Usertags: ftcbfs

guile-cairo fails to cross build from source for two distinct reasons.
The first reason is that configure fails running guile-3.0 and gives up.
guile-3.0 is M-A:allowed and it occurs twice in the dependency chain.
One of them is annotated :any and the one via guile-library is not. As a
result, apt picks the host one and that happens to not be runnable. It
is guile-library that forces the host one. I believe that its dependency
is correct, because guile-library provides shared objects to be loaded
into guile-3.0. The question really becomes whether guile-cairo needs to
load those libraries. After some digging, I figured that yes it does,
but only for running tests. So annotating the dependency <!nocheck>
makes the dependency go away for cross builds (as apt can then use the
build's guile-3.0) and a nocheck build still exactly reproduces a
regular build.

What fails next is guile-snarf. I've see than for guile-gnutls already
and the cause is that guile-snarf defaults to using the build
architecture cpp. Basically whenever using guile-snarf in a build, we
must export CPP.

I'm attaching a patch addressing both for your convenience. The
cross.patch part should be upstreamable.

Helmut
diff --minimal -Nru guile-cairo-1.12.0~pre1/debian/changelog 
guile-cairo-1.12.0~pre1/debian/changelog
--- guile-cairo-1.12.0~pre1/debian/changelog    2023-10-28 10:12:09.000000000 
+0200
+++ guile-cairo-1.12.0~pre1/debian/changelog    2025-02-20 10:44:00.000000000 
+0100
@@ -1,3 +1,12 @@
+guile-cairo (1.12.0~pre1-2.1) UNRELEASED; urgency=medium
+
+  * Non-maintainer upload.
+  * Fix FTCBFS: (Closes: #-1)
+    + Annotate guile-library dependency <!nocheck>.
+    + cross.patch: Export CPP for guile-snarf.
+
+ -- Helmut Grohne <[email protected]>  Thu, 20 Feb 2025 10:44:00 +0100
+
 guile-cairo (1.12.0~pre1-2) unstable; urgency=medium
 
   * Fixed URL in debian/upstream/metadata.
diff --minimal -Nru guile-cairo-1.12.0~pre1/debian/control 
guile-cairo-1.12.0~pre1/debian/control
--- guile-cairo-1.12.0~pre1/debian/control      2023-10-28 10:12:09.000000000 
+0200
+++ guile-cairo-1.12.0~pre1/debian/control      2025-02-20 10:44:00.000000000 
+0100
@@ -9,7 +9,7 @@
 Build-Depends: cdbs (>= 0.4.49), debhelper (>= 10),
                patchutils (>= 0.2.25), guile-3.0-dev,
               libcairo2-dev (>= 1.4.10),
-               guile-library (>= 0.2.6.1),
+               guile-library (>= 0.2.6.1) <!nocheck>,
               texinfo
 Rules-Requires-Root: no
 
diff --minimal -Nru guile-cairo-1.12.0~pre1/debian/patches/cross.patch 
guile-cairo-1.12.0~pre1/debian/patches/cross.patch
--- guile-cairo-1.12.0~pre1/debian/patches/cross.patch  1970-01-01 
01:00:00.000000000 +0100
+++ guile-cairo-1.12.0~pre1/debian/patches/cross.patch  2025-02-20 
10:44:00.000000000 +0100
@@ -0,0 +1,21 @@
+--- guile-cairo-1.12.0~pre1.orig/configure.ac
++++ guile-cairo-1.12.0~pre1/configure.ac
+@@ -41,6 +41,7 @@
+ 
+ AC_ISC_POSIX
+ AC_PROG_CC
++AC_PROG_CPP
+ AC_STDC_HEADERS
+ LT_INIT([disable-static])
+ 
+--- guile-cairo-1.12.0~pre1.orig/guile-cairo/Makefile.am
++++ guile-cairo-1.12.0~pre1/guile-cairo/Makefile.am
+@@ -48,7 +48,7 @@
+ GUILE_SNARF_CFLAGS = $(libguile_cairo_la_CFLAGS)
+ 
+ .c.x:
+-      guile-snarf $(GUILE_SNARF_CFLAGS) $< > $@ \
++      CPP='$(CPP)' guile-snarf $(GUILE_SNARF_CFLAGS) $< > $@ \
+       || { rm $@; false; }
+ .c.doc:
+       -(guile-func-name-check $<)
diff --minimal -Nru guile-cairo-1.12.0~pre1/debian/patches/series 
guile-cairo-1.12.0~pre1/debian/patches/series
--- guile-cairo-1.12.0~pre1/debian/patches/series       2023-10-28 
10:12:09.000000000 +0200
+++ guile-cairo-1.12.0~pre1/debian/patches/series       2025-02-20 
10:44:00.000000000 +0100
@@ -1,2 +1,3 @@
 0001-get-library-path-from-env.patch
 0002-set-unit-test-lib-path.patch
+cross.patch

Reply via email to