mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-06-09 19:13:26 +03:00
pngnq: fix with gcc 14
Various includes are missing. The zlib include was being patched in before. The string include is now needed with gcc 14.
This commit is contained in:
parent
5c0c4807e4
commit
f433407a68
2 changed files with 25 additions and 4 deletions
17
pkgs/by-name/pn/pngnq/missing-includes.patch
Normal file
17
pkgs/by-name/pn/pngnq/missing-includes.patch
Normal file
|
@ -0,0 +1,17 @@
|
||||||
|
diff --git a/src/rwpng.c b/src/rwpng.c
|
||||||
|
index aaa21fc..11d698f 100644
|
||||||
|
--- a/src/rwpng.c
|
||||||
|
+++ b/src/rwpng.c
|
||||||
|
@@ -30,10 +30,12 @@
|
||||||
|
---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
|
#include <stdio.h>
|
||||||
|
+#include <string.h>
|
||||||
|
#include <stdlib.h>
|
||||||
|
|
||||||
|
#include "png.h" /* libpng header; includes zlib.h */
|
||||||
|
#include "rwpng.h" /* typedefs, common macros, public prototypes */
|
||||||
|
+#include <zlib.h>
|
||||||
|
|
||||||
|
/* future versions of libpng will provide this macro: */
|
||||||
|
/* GRR NOTUSED */
|
|
@ -16,16 +16,20 @@ stdenv.mkDerivation rec {
|
||||||
sha256 = "1qmnnl846agg55i7h4vmrn11lgb8kg6gvs8byqz34bdkjh5gwiy1";
|
sha256 = "1qmnnl846agg55i7h4vmrn11lgb8kg6gvs8byqz34bdkjh5gwiy1";
|
||||||
};
|
};
|
||||||
|
|
||||||
|
patches = [
|
||||||
|
./missing-includes.patch
|
||||||
|
];
|
||||||
|
|
||||||
|
env.NIX_CFLAGS_COMPILE = toString [
|
||||||
|
"-Wno-error=incompatible-pointer-types"
|
||||||
|
];
|
||||||
|
|
||||||
nativeBuildInputs = [ pkg-config ];
|
nativeBuildInputs = [ pkg-config ];
|
||||||
buildInputs = [
|
buildInputs = [
|
||||||
libpng
|
libpng
|
||||||
zlib
|
zlib
|
||||||
];
|
];
|
||||||
|
|
||||||
patchPhase = ''
|
|
||||||
sed -i '/png.h/a \#include <zlib.h>' src/rwpng.c
|
|
||||||
'';
|
|
||||||
|
|
||||||
meta = with lib; {
|
meta = with lib; {
|
||||||
homepage = "https://pngnq.sourceforge.net/";
|
homepage = "https://pngnq.sourceforge.net/";
|
||||||
description = "PNG quantizer";
|
description = "PNG quantizer";
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue