[From nobody Sat Oct 31 16:55:08 2026
Received: (at submit) by bugs.debian.org; 28 Oct 2026 15:49:22 +0000
X-Spam-Checker-Version: SpamAssassin 4.0.1-bugs.debian.org_2005_01_02
 (2024-03-25) on buxtehude.debian.org
X-Spam-Level: 
X-Spam-Status: No, score=-1.6 required=4.0 tests=BAYES_00, DATE_IN_PAST_06_12, 
 DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FOURLA,
 SPF_HELO_NONE,SPF_NONE,WORD_WITHOUT_VOWELS autolearn=no
 autolearn_force=no version=4.0.1-bugs.debian.org_2005_01_02
X-Spam-Bayes: score:0.0000 Tokens: new, 129; hammy, 150; neutral, 169; spammy,
 0. spammytokens: hammytokens:0.000-+--H*Ad:N*Bug,
 0.000-+--HTo:N*Debian, 0.000-+--HTo:N*Bug, 0.000-+--HTo:N*System,
 0.000-+--HTo:N*Tracking
Return-path: &lt;helmut@subdivi.de&gt;
Received: from isilmar-4.linta.de ([136.243.71.142]:54842)
 by buxtehude.debian.org with esmtps
 (TLS1.3:ECDHE_X25519__RSA_PSS_RSAE_SHA256__AES_256_GCM:256)
 (Exim 4.96) (envelope-from &lt;helmut@subdivi.de&gt;) id 1xM5tz-00FIVj-06
 for submit@bugs.debian.org; Wed, 28 Oct 2026 15:49:22 +0000
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=subdivi.de;
 s=k33.isilmar-4; t=1793202559;
 bh=SlATKU72nyGqBWG6cUZDlo1XXThnS3Z3fInFqegqRTo=;
 h=Date:From:To:Subject:From;
 b=m8stEC0iS6RcqPzjdlBvbVAvm1wSbc++UNsk5SVvNvGzpMfrU4gYy9Da4J/E2LcM5
 ekgwugsdoNcChx89iGex30od1Llr/WI25zF7b/r9zA5DRRFSMEOhGHOyLahanRIzbp
 IJXGexhv44NjYPhFfzUjoVcdGgkMtd4zehebu3xybnAai1aGS6z98Jn49bdZIFv2f8
 gMJeyleS6wQbYOmGDPXbIIrUGHn+A5dRc4Dyay5qilgjqbWcEFj8jXGWn+0iSe6GTY
 O8zFrTiCTbAUIt2loZj5A3BGI2pagM6wLYbCsNFSLsrvRevlzXNdiYSrrT1BiwzVL3
 9MAnVYbEEnjKg==
Received: from isilmar-4.linta.de (isilmar.linta [10.0.0.1])
 by isilmar-4.linta.de (Postfix) with ESMTP id AFB37200AA2
 for &lt;submit@bugs.debian.org&gt;; Wed, 28 Oct 2026 15:49:19 +0000 (UTC)
Date: Wed, 28 Oct 2026 07:16:38 +0100
From: Helmut Grohne &lt;helmut@subdivi.de&gt;
To: Debian Bug Tracking System &lt;submit@bugs.debian.org&gt;
Subject: tk9.1 FTCBFS: hard codes the build architecture pkg-config
Message-ID: &lt;20261028061638.GA1074641@subdivi.de&gt;
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary=&quot;4OPKQKiFUi8D2L7u&quot;
Content-Disposition: inline
Content-Transfer-Encoding: 8bit
X-Reportbug-Version: 13.2.0
Delivered-To: submit@bugs.debian.org


--4OPKQKiFUi8D2L7u
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline

Source: tk9.1
Version: 9.1.0-2
Severity: important
Justification: it is expected that tk9.1 enters the bootstrap set
Tags: patch upstream
User: debian-cross@lists.debian.org
Usertags: ftcbfs

tk9.1 fails to cross build from source. On the surface, it fails to find
harfbuzz. Underneath, unix/configure.ac hard codes the build
architecture pkg-config in a lot of places. I suggest rewriting it to
use PKG_CHECK_MODULES. As that macro uses AC_REQUIRE it should not be
used inside an if condition, so I am also replacing a pile of those by
AS_IF. The macro also carries out the version check on harfbuzz, so this
ends up deleting a pile of code. I hope you find this refactoring
acceptable. Please forward it upstream. Also please apply it to the
Debian package before making tk9.1 the default version in Debian.

Helmut

--4OPKQKiFUi8D2L7u
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment; filename=&quot;cross.patch&quot;
Content-Transfer-Encoding: 8bit

--- tk9.1-9.1.0.orig/unix/configure.ac
+++ tk9.1-9.1.0/unix/configure.ac
@@ -343,7 +343,7 @@
 #	Check for freetype / fontconfig / Xft support and Bidirectional text
 #--------------------------------------------------------------------
 
-if test $tk_aqua = no; then
+AS_IF([test $tk_aqua = no],[
 
     #--------------------------------------------------------------------
     # --enable-xft (default: yes) — independent switch
@@ -369,7 +369,7 @@
 	[enable_bidi=$enableval], [enable_bidi=&quot;yes&quot;])
     AC_MSG_RESULT([$enable_bidi])
 
-    if test &quot;$enable_bidi&quot; = &quot;yes&quot;; then
+    AS_IF([test &quot;$enable_bidi&quot; = &quot;yes&quot;],[
 	AC_MSG_NOTICE([Bidi enabled: forcing Xft on as well])
 	if test &quot;$enable_xft&quot; = &quot;no&quot;; then
 	   enable_xft=yes
@@ -385,48 +385,8 @@
 	#--------------------------------------------------------------------
 	# HarfBuzz - version check (minimum 2.8.2)
 	#--------------------------------------------------------------------
-	AC_MSG_CHECKING([for HarfBuzz (required for --enable-bidi)])
-	if pkg-config --exists harfbuzz; then
-	    HB_VERSION=`pkg-config --modversion harfbuzz 2&gt;/dev/null || echo &quot;0.0.0&quot;`
-	    AC_MSG_RESULT([found version $HB_VERSION])
-
-	    # Pure shell version comparison: is HB_VERSION &lt; 2.8.2 ?
-	    if test -n &quot;$HB_VERSION&quot;; then
-		# Normalize version strings (handle cases like 2.8.2, 3.0.0, etc.)
-		HB_MAJOR=`echo $HB_VERSION | cut -d. -f1`
-		HB_MINOR=`echo $HB_VERSION | cut -d. -f2`
-		HB_PATCH=`echo $HB_VERSION | cut -d. -f3 | cut -d- -f1`
-
-		REQ_MAJOR=2
-		REQ_MINOR=8
-		REQ_PATCH=2
-
-		too_old=no
-		if test $HB_MAJOR -lt $REQ_MAJOR; then
-		    too_old=yes
-		elif test $HB_MAJOR -eq $REQ_MAJOR; then
-		    if test $HB_MINOR -lt $REQ_MINOR; then
-			too_old=yes
-		    elif test $HB_MINOR -eq $REQ_MINOR; then
-			if test -n &quot;$HB_PATCH&quot; &amp;&amp; test $HB_PATCH -lt $REQ_PATCH; then
-			    too_old=yes
-			fi
-		    fi
-		fi
-
-		if test &quot;$too_old&quot; = &quot;yes&quot;; then
-		    AC_MSG_WARN([HarfBuzz version $HB_VERSION is too old (need &gt;= 2.8.2).])
-		    AC_MSG_WARN([Disabling bidirectional text support (--disable-bidi).])
-		    enable_bidi=no
-		else
-		    AC_MSG_RESULT([HarfBuzz version $HB_VERSION is sufficient (&gt;= 2.8.2).])
-		fi
-	    fi
-
+	PKG_CHECK_MODULES([HB],[harfbuzz &gt;= 2.8.2],[
 	    if test &quot;$enable_bidi&quot; = &quot;yes&quot;; then
-		HB_CFLAGS=`pkg-config --cflags harfbuzz`
-		HB_LIBS=`pkg-config --libs harfbuzz`
-
 		tk_oldCFlags=$CFLAGS
 		tk_oldLibs=$LIBS
 		CFLAGS=&quot;$CFLAGS $XINCLUDES $XFT_CFLAGS $HB_CFLAGS&quot;
@@ -447,16 +407,15 @@
 		AC_SUBST(HB_CFLAGS)
 		AC_SUBST(HB_LIBS)
 	    fi
-	else
-	    AC_MSG_RESULT([no])
+	],[
 	    AC_MSG_ERROR([--enable-bidi requires HarfBuzz development files.
 Please install the HarfBuzz development package:
   - Debian/Ubuntu:   sudo apt install libharfbuzz-dev
   - Fedora/RHEL:     sudo dnf install harfbuzz-devel
   - Arch:            sudo pacman -S harfbuzz
   - macOS (Homebrew): brew install harfbuzz])
-	fi
-    fi
+	])
+    ])
 
     if test &quot;$enable_bidi&quot; = &quot;no&quot;; then
 	# Bidi disabled
@@ -472,16 +431,14 @@
     fi
 
     # Now actually enable Xft if requested (or forced by bidi)
-    if test &quot;$enable_xft&quot; = &quot;yes&quot; ; then
+    AS_IF([test &quot;$enable_xft&quot; = &quot;yes&quot;],[
 	found_xft=&quot;yes&quot;
 
 	XFT_CFLAGS=`xft-config --cflags 2&gt;/dev/null` || found_xft=&quot;no&quot;
 	XFT_LIBS=`xft-config --libs 2&gt;/dev/null` || found_xft=&quot;no&quot;
-	if test &quot;$found_xft&quot; = &quot;no&quot; ; then
-	    found_xft=yes
-	    XFT_CFLAGS=`pkg-config --cflags xft fontconfig 2&gt;/dev/null` || found_xft=&quot;no&quot;
-	    XFT_LIBS=`pkg-config --libs xft fontconfig 2&gt;/dev/null` || found_xft=&quot;no&quot;
-	fi
+	AS_IF([test &quot;$found_xft&quot; = &quot;no&quot;],[
+	    PKG_CHECK_MODULES([XFT],[xft],[found_xft=yes],[found_xft=no])
+	])
 
 	if test &quot;$found_xft&quot; = &quot;yes&quot; ; then
 	    tk_oldCFlags=$CFLAGS
@@ -519,7 +476,7 @@
 	else
 	    enable_xft=yes
 	fi
-    fi
+    ])
 
     AC_SUBST(XFT_CFLAGS)
     AC_SUBST(XFT_LIBS)
@@ -540,7 +497,7 @@
     fi
     AC_SUBST(FONTSYSTEM)
 
-else
+],[
     # Aqua (macOS) path
     enable_xft=no
     enable_bidi=no
@@ -550,7 +507,7 @@
     HB_LIBS=&quot;&quot;
     FONTSYSTEM=&quot;core&quot;
     AC_SUBST(FONTSYSTEM)
-fi
+])
 
 #--------------------------------------------------------------------
 #	Check for the X RENDER extension client library (Xrender), used
@@ -559,7 +516,7 @@
 
 XRENDER_CFLAGS=&quot;&quot;
 XRENDER_LIBS=&quot;&quot;
-if test $tk_aqua = no; then
+AS_IF([test $tk_aqua = no],[
     AC_MSG_CHECKING([whether to use xrender])
     AC_ARG_ENABLE(xrender,
 	AS_HELP_STRING([--enable-xrender],
@@ -567,10 +524,8 @@
 	[enable_xrender=$enableval], [enable_xrender=&quot;yes&quot;])
     AC_MSG_RESULT([$enable_xrender])
 
-    if test &quot;$enable_xrender&quot; = &quot;yes&quot; ; then
-	found_xrender=&quot;yes&quot;
-	XRENDER_CFLAGS=`pkg-config --cflags xrender 2&gt;/dev/null` || found_xrender=&quot;no&quot;
-	XRENDER_LIBS=`pkg-config --libs xrender 2&gt;/dev/null` || found_xrender=&quot;no&quot;
+    AS_IF([test &quot;$enable_xrender&quot; = &quot;yes&quot;],[
+	PKG_CHECK_MODULES([XRENDER],[xrender],[found_xrender=yes],[found_xrender=no])
 	if test &quot;$found_xrender&quot; = &quot;no&quot; ; then
 	    found_xrender=&quot;yes&quot;
 	    XRENDER_CFLAGS=&quot;&quot;
@@ -599,8 +554,8 @@
 	    XRENDER_CFLAGS=&quot;&quot;
 	    XRENDER_LIBS=&quot;&quot;
 	fi
-    fi
-fi
+    ])
+])
 AC_SUBST(XRENDER_CFLAGS)
 AC_SUBST(XRENDER_LIBS)
 
@@ -650,21 +605,16 @@
 #	Check for Atk support
 #--------------------------------------------------------------------
 
-if test &quot;$tk_aqua&quot; = no; then
-  AC_MSG_CHECKING([for ATK and Atk-bridge])
-  if pkg-config --exists atk &amp;&amp; pkg-config --exists atk-bridge-2.0; then
-    AC_MSG_RESULT([yes])
-    ATK_CFLAGS=&quot;`pkg-config --cflags atk atk-bridge-2.0`&quot;
-    ATK_LIBS=&quot;`pkg-config --libs atk atk-bridge-2.0`&quot;
+AS_IF([test &quot;$tk_aqua&quot; = no],[
+  PKG_CHECK_MODULES([ATK],[atk atk-bridge-2.0],[
     AC_DEFINE([HAVE_ATK], [1], [Define if ATK and Atk-bridge are available])
-  else
-    AC_MSG_RESULT([no])
+  ],[
     ATK_CFLAGS=&quot;&quot;
     ATK_LIBS=&quot;&quot;
-  fi
+  ])
   AC_SUBST([ATK_CFLAGS])
   AC_SUBST([ATK_LIBS])
-fi
+])
 
 #--------------------------------------------------------------------
 # XXX Do this last.

--4OPKQKiFUi8D2L7u--
]