Skip to content

Commit

Permalink
libpng12: fix clang-19 build
Browse files Browse the repository at this point in the history
clang-19 defines TARGET_OS_MACOS which results in libpng erroneously
trying to include `fp.h` rather than `math.h`.
  • Loading branch information
paparodeo committed Dec 7, 2024
1 parent b022cb1 commit 491ecfd
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions pkgs/development/libraries/libpng/12.nix
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,10 @@ stdenv.mkDerivation (finalAttrs: {
sha256 = "1izw9ybm27llk8531w6h4jp4rk2rxy2s9vil16nwik5dp0amyqxl";
};

postPatch = lib.optionalString stdenv.hostPlatform.isDarwin ''
substituteInPlace pngconf.h --replace-fail '<fp.h>' '<math.h>'
'';

outputs = [ "out" "dev" "man" ];

propagatedBuildInputs = [ zlib ];
Expand Down

0 comments on commit 491ecfd

Please sign in to comment.