Skip to content

Commit

Permalink
perlPackages.Tk: fix build with clang 16
Browse files Browse the repository at this point in the history
The jpeg `configure` script fails to detect clang as a functioning C
compiler because it uses a test with a `main` that returns an implicit
`int`, which results in an error with clang 16.
  • Loading branch information
reckenrode committed Sep 6, 2023
1 parent dba6d77 commit 42f7491
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
11 changes: 11 additions & 0 deletions pkgs/development/perl-modules/tk-configure-implicit-int-fix.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
--- a/JPEG/jpeg/configure 2013-11-15 18:50:03.000000000 -0500
+++ b/JPEG/jpeg/configure 2023-09-05 23:36:12.675151164 -0400
@@ -623,7 +623,7 @@
cat > conftest.$ac_ext <<EOF
#line 625 "configure"
#include "confdefs.h"
-main(){return(0);}
+int main(){return(0);}
EOF
if { (eval echo configure:629: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
ac_cv_prog_cc_works=yes
5 changes: 5 additions & 0 deletions pkgs/top-level/perl-packages.nix
Original file line number Diff line number Diff line change
Expand Up @@ -26585,6 +26585,11 @@ with self; {
url = "mirror://cpan/authors/id/S/SR/SREZIC/Tk-804.036.tar.gz";
hash = "sha256-Mqpycaa9/twzMBGbOCXa3dCqS1yTb4StdOq7kyogCl4=";
};
patches = [
# Fix failing configure test due to implicit int return value of main, which results
# in an error with clang 16.
../development/perl-modules/tk-configure-implicit-int-fix.patch
];
makeMakerFlags = [ "X11INC=${pkgs.xorg.libX11.dev}/include" "X11LIB=${pkgs.xorg.libX11.out}/lib" ];
buildInputs = [ pkgs.xorg.libX11 pkgs.libpng ];
doCheck = false; # Expects working X11.
Expand Down

0 comments on commit 42f7491

Please sign in to comment.