Source: suitesparse
Version: 1:7.10.1+dfsg-1
Tags: patch
User: debian-cr...@lists.debian.org
Usertags: cross-satisfiability

suitesparse fails to cross build from source, because its build
dependency on gfortran is not satisfiable. Generally, bare toolchain
names are not satisfiable in cross builds as they do not indicate what
architecture it is being used for. We need to annotate such dependencies
indicating whether they are needed for the build or host architecture.
In this case, it should be gfortran-for-host.

Note that merely replacing the package name is not enough. It'll work
for cross builds but break native builds. The -for-host variant does not
provide the bare toolchain name. You may not run it as "gfortran" (even
when building natively). Instead, ${DEB_HOST_GNU_TYPE}-gfortran must be
used. We sought for alternative solutions, but every other alternative
degrades some other use case. That said, adding the architecture prefix
is never wrong and hence we now recommend being explicit over being
implicit.

I'm attaching a patch for your convenience. It happens to also reduce
Build-Depends a bit more to get the Python stuff removed from the
arch-only build.

I do not consider the patch appropriate for inclusion in trixie. It is
meant for forky.

Helmut
diff --minimal -Nru suitesparse-7.10.1+dfsg/debian/changelog 
suitesparse-7.10.1+dfsg/debian/changelog
--- suitesparse-7.10.1+dfsg/debian/changelog    2025-03-09 20:48:30.000000000 
+0100
+++ suitesparse-7.10.1+dfsg/debian/changelog    2025-05-31 10:21:42.000000000 
+0200
@@ -1,3 +1,11 @@
+suitesparse (1:7.10.1+dfsg-1.1) UNRELEASED; urgency=medium
+
+  * Non-maintainer upload.
+  * Fix FTCBFS: Use gfortran-for-host (Closes: #-1)
+  + Demote more Build-Depends to B-D-I.
+
+ -- Helmut Grohne <hel...@subdivi.de>  Sat, 31 May 2025 10:21:42 +0200
+
 suitesparse (1:7.10.1+dfsg-1) unstable; urgency=medium
 
   * New upstream version 7.10.1+dfsg
diff --minimal -Nru suitesparse-7.10.1+dfsg/debian/control 
suitesparse-7.10.1+dfsg/debian/control
--- suitesparse-7.10.1+dfsg/debian/control      2025-03-02 10:36:08.000000000 
+0100
+++ suitesparse-7.10.1+dfsg/debian/control      2025-05-31 10:21:42.000000000 
+0200
@@ -5,19 +5,19 @@
 Priority: optional
 Build-Depends: debhelper-compat (= 13),
                cmake,
-               dh-sequence-python3,
-               python3-setuptools
 Build-Depends-Arch: pkgconf,
-                    gfortran,
+                    gfortran-for-host,
                     libblas-dev,
                     liblapack-dev,
                     libgmp-dev,
                     libmpfr-dev
-Build-Depends-Indep: texlive-latex-extra,
+Build-Depends-Indep: dh-sequence-python3,
+                     texlive-latex-extra,
                      texlive-plain-generic,
                      texlive-bibtex-extra,
                      texlive-fonts-extra,
                      ghostscript,
+                     python3-setuptools,
                      texlive-science,
                      texlive-xetex,
                      python3-pygments
diff --minimal -Nru suitesparse-7.10.1+dfsg/debian/rules 
suitesparse-7.10.1+dfsg/debian/rules
--- suitesparse-7.10.1+dfsg/debian/rules        2025-03-02 10:36:08.000000000 
+0100
+++ suitesparse-7.10.1+dfsg/debian/rules        2025-05-31 10:21:42.000000000 
+0200
@@ -4,6 +4,10 @@
 
 include /usr/share/dpkg/default.mk
 
+ifeq ($(origin FC),default)
+export FC := $(DEB_HOST_GNU_TYPE)-gfortran
+endif
+
 PDF_DOCS := AMD/Doc/AMD_UserGuide.pdf CAMD/Doc/CAMD_UserGuide.pdf 
CHOLMOD/Doc/CHOLMOD_UserGuide.pdf KLU/Doc/KLU_UserGuide.pdf 
Mongoose/Doc/Mongoose_UserGuide.pdf UMFPACK/Doc/UMFPACK_QuickStart.pdf 
UMFPACK/Doc/UMFPACK_UserGuide.pdf LDL/Doc/ldl_userguide.pdf 
ParU/Doc/paru_user_guide.pdf SPQR/Doc/spqr_user_guide.pdf 
SPEX/Doc/SPEX_UserGuide.pdf
 
 # Force CMake buildsystem, because otherwise the top-level Makefile is used
@@ -35,7 +39,7 @@
 execute_after_dh_auto_clean:
        make purge
        rm -f $(PDF_DOCS)
-       pybuild --clean
+       if [ -e .pybuild ]; then pybuild --clean; fi
        # For some unknown reason, pybuild --clean does not clean the following
        rm -rf .pybuild
 

Reply via email to