Source: perl-tk
Version: 1:804.036+dfsg1-5
Tags: patch
User: [email protected]
Usertags: ftcbfs

perl-tk fails to cross build from source for several reasons.
Ultimately, the build dependency on perl requests a host architecture
interpreter, which cannot be installed. The recent addition of
perl-xs-dev is what is really needed for building a perl extension, so
perl can be dropped now. While at it, I also opted for annotated test
dependencies <!nocheck>. When actually building perl-dk, it fails
configuring the embedded jpeg library. This is due to a check for the
system copy that requires running host code. The failure is understood
as building the vendor copy. In the attached patch, I am demoting the
try_run to a try_compile check. This poses a weaker verification that
may be undesired on other platforms. It should be safe when building on
Debian, but discussing a compromise is likely needed when trying to
forward this upstream. Combining the aforementioned changes makes
perl-tk cross buildable and you may find them in the attached patch.

Helmut
diff -Nru perl-tk-804.036+dfsg1/debian/changelog 
perl-tk-804.036+dfsg1/debian/changelog
--- perl-tk-804.036+dfsg1/debian/changelog      2025-04-13 20:13:01.000000000 
+0200
+++ perl-tk-804.036+dfsg1/debian/changelog      2025-12-23 13:24:46.000000000 
+0100
@@ -1,3 +1,13 @@
+perl-tk (1:804.036+dfsg1-5.1) UNRELEASED; urgency=medium
+
+  * Non-maintainer upload.
+  * Fix FTCBFS: (Closes: #-1)
+    + Drop implied perl Build-Dependency.
+    + Annotate test dependencies <!nocheck>.
+    + Avoid a check running host code.
+
+ -- Helmut Grohne <[email protected]>  Tue, 23 Dec 2025 13:24:46 +0100
+
 perl-tk (1:804.036+dfsg1-5) unstable; urgency=medium
 
   * added perl-xs-dev to build-dependencies. Closes: #1102833
diff -Nru perl-tk-804.036+dfsg1/debian/control 
perl-tk-804.036+dfsg1/debian/control
--- perl-tk-804.036+dfsg1/debian/control        2025-04-13 20:12:15.000000000 
+0200
+++ perl-tk-804.036+dfsg1/debian/control        2025-12-23 13:24:44.000000000 
+0100
@@ -4,7 +4,6 @@
 Maintainer: Georges Khaznadar <[email protected]>
 Uploaders: Michael C. Schultheiss <[email protected]>
 Build-Depends: debhelper-compat (=13),
- perl,
  perl-xs-dev,
  libx11-dev,
  libxft-dev,
@@ -14,8 +13,8 @@
  libjpeg-dev,
  libfreetype-dev,
  libxrender-dev,
- xvfb,
- xauth
+ xvfb <!nocheck>,
+ xauth <!nocheck>,
 Standards-Version: 4.7.2
 Vcs-Browser: https://salsa.debian.org/georgesk/perl-tk
 Vcs-Git: https://salsa.debian.org/georgesk/perl-tk.git
diff -Nru perl-tk-804.036+dfsg1/debian/patches/cross.patch 
perl-tk-804.036+dfsg1/debian/patches/cross.patch
--- perl-tk-804.036+dfsg1/debian/patches/cross.patch    1970-01-01 
01:00:00.000000000 +0100
+++ perl-tk-804.036+dfsg1/debian/patches/cross.patch    2025-12-23 
13:24:46.000000000 +0100
@@ -0,0 +1,11 @@
+--- perl-tk-804.036+dfsg1.orig/JPEG/Makefile.PL
++++ perl-tk-804.036+dfsg1/JPEG/Makefile.PL
+@@ -6,7 +6,7 @@
+ 
+ use Tk::MMtry;
+ 
+-if ($Tk::MMtry::VERSION ge '4.007' && 
try_run("config/has_jpeg.c",['-I/usr/local/include'],['-ljpeg']))
++if ($Tk::MMtry::VERSION ge '4.007' && 
try_compile("config/has_jpeg.c",['-I/usr/local/include'],['-ljpeg']))
+  {
+   push(@args, LIBS => ['-ljpeg'],
+               INC  => '-I/usr/local/include',
diff -Nru perl-tk-804.036+dfsg1/debian/patches/series 
perl-tk-804.036+dfsg1/debian/patches/series
--- perl-tk-804.036+dfsg1/debian/patches/series 2025-03-20 17:37:16.000000000 
+0100
+++ perl-tk-804.036+dfsg1/debian/patches/series 2025-12-23 13:24:46.000000000 
+0100
@@ -4,3 +4,4 @@
 80-Fix-STRLEN-vs-int-pointer-confusion-in-Tcl_GetByteAr.patch
 gcc-14.patch
 gcc-15.patch
+cross.patch

Reply via email to