diff --git a/pkgs/by-name/pn/pngnq/missing-includes.patch b/pkgs/by-name/pn/pngnq/missing-includes.patch new file mode 100644 index 000000000000..2b605a50fca7 --- /dev/null +++ b/pkgs/by-name/pn/pngnq/missing-includes.patch @@ -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 ++#include + #include + + #include "png.h" /* libpng header; includes zlib.h */ + #include "rwpng.h" /* typedefs, common macros, public prototypes */ ++#include + + /* future versions of libpng will provide this macro: */ + /* GRR NOTUSED */ diff --git a/pkgs/by-name/pn/pngnq/package.nix b/pkgs/by-name/pn/pngnq/package.nix index c418ecbb9ecd..23f4a6e0a248 100644 --- a/pkgs/by-name/pn/pngnq/package.nix +++ b/pkgs/by-name/pn/pngnq/package.nix @@ -16,16 +16,20 @@ stdenv.mkDerivation rec { sha256 = "1qmnnl846agg55i7h4vmrn11lgb8kg6gvs8byqz34bdkjh5gwiy1"; }; + patches = [ + ./missing-includes.patch + ]; + + env.NIX_CFLAGS_COMPILE = toString [ + "-Wno-error=incompatible-pointer-types" + ]; + nativeBuildInputs = [ pkg-config ]; buildInputs = [ libpng zlib ]; - patchPhase = '' - sed -i '/png.h/a \#include ' src/rwpng.c - ''; - meta = with lib; { homepage = "https://pngnq.sourceforge.net/"; description = "PNG quantizer";