core/pkgs/by-name/li/libpng/default.nix

63 lines
1.4 KiB
Nix
Raw Normal View History

2024-06-30 08:16:52 +00:00
{
lib,
stdenv,
fetchurl,
zlib,
apngSupport ? true,
testers,
2024-05-02 00:46:19 +00:00
}:
assert zlib != null;
let
patchVersion = "1.6.43";
patch_src = fetchurl {
url = "mirror://sourceforge/libpng-apng/libpng-${patchVersion}-apng.patch.gz";
hash = "sha256-0QdXnpDVU4bQDmCG6nUJQvIqBLmrR2u6DGYHcM76/iI=";
};
whenPatched = lib.optionalString apngSupport;
2024-06-30 08:16:52 +00:00
in
stdenv.mkDerivation (finalAttrs: {
2024-05-02 00:46:19 +00:00
pname = "libpng" + whenPatched "-apng";
version = "1.6.43";
src = fetchurl {
url = "mirror://sourceforge/libpng/libpng-${finalAttrs.version}.tar.xz";
hash = "sha256-alygZSOSotfJ2yrltAIQhDwLvAgcvUEIJasAzFnxSmw=";
};
postPatch = whenPatched "gunzip < ${patch_src} | patch -Np1";
2024-06-30 08:16:52 +00:00
outputs = [
"out"
"dev"
"man"
];
2024-05-02 00:46:19 +00:00
outputBin = "dev";
propagatedBuildInputs = [ zlib ];
doCheck = true;
passthru = {
inherit zlib;
tests.pkg-config = testers.testMetaPkgConfig finalAttrs.finalPackage;
};
meta = with lib; {
2024-06-30 08:16:52 +00:00
description =
"The official reference implementation for the PNG file format"
+ whenPatched " with animation patch";
2024-05-02 00:46:19 +00:00
homepage = "http://www.libpng.org/pub/png/libpng.html";
changelog = "https://github.com/pnggroup/libpng/blob/v${finalAttrs.version}/CHANGES";
license = licenses.libpng2;
2024-06-30 08:16:52 +00:00
pkgConfigModules = [
"libpng"
"libpng16"
];
2024-05-02 00:46:19 +00:00
platforms = platforms.all;
maintainers = with maintainers; [ vcunat ];
};
})