Skip to content

Commit 8026644

Browse files
pngnq: fix with gcc 14 (#407972)
2 parents 94a74b3 + f433407 commit 8026644

File tree

2 files changed

+25
-4
lines changed

2 files changed

+25
-4
lines changed
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
diff --git a/src/rwpng.c b/src/rwpng.c
2+
index aaa21fc..11d698f 100644
3+
--- a/src/rwpng.c
4+
+++ b/src/rwpng.c
5+
@@ -30,10 +30,12 @@
6+
---------------------------------------------------------------------------*/
7+
8+
#include <stdio.h>
9+
+#include <string.h>
10+
#include <stdlib.h>
11+
12+
#include "png.h" /* libpng header; includes zlib.h */
13+
#include "rwpng.h" /* typedefs, common macros, public prototypes */
14+
+#include <zlib.h>
15+
16+
/* future versions of libpng will provide this macro: */
17+
/* GRR NOTUSED */

pkgs/by-name/pn/pngnq/package.nix

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,16 +16,20 @@ stdenv.mkDerivation rec {
1616
sha256 = "1qmnnl846agg55i7h4vmrn11lgb8kg6gvs8byqz34bdkjh5gwiy1";
1717
};
1818

19+
patches = [
20+
./missing-includes.patch
21+
];
22+
23+
env.NIX_CFLAGS_COMPILE = toString [
24+
"-Wno-error=incompatible-pointer-types"
25+
];
26+
1927
nativeBuildInputs = [ pkg-config ];
2028
buildInputs = [
2129
libpng
2230
zlib
2331
];
2432

25-
patchPhase = ''
26-
sed -i '/png.h/a \#include <zlib.h>' src/rwpng.c
27-
'';
28-
2933
meta = with lib; {
3034
homepage = "https://pngnq.sourceforge.net/";
3135
description = "PNG quantizer";

0 commit comments

Comments
 (0)