nixpkgs/pkgs/by-name/gi/gif2apng/package.nix
aleksana 571c71e6f7 treewide: migrate packages to pkgs/by-name, take 1
We are migrating packages that meet below requirements:

1. using `callPackage`
2. called path is a directory
3. overriding set is empty (`{ }`)
4. not containing path expressions other than relative path (to
makenixpkgs-vet happy)
5. not referenced by nix files outside of the directory, other
than`pkgs/top-level/all-packages.nix`
6. not referencing nix files outside of the directory
7. not referencing `default.nix` (since it's changed to `package.nix`)
8. `outPath` doesn't change after migration

The tool is here: https://github.com/Aleksanaa/by-name-migrate.
2024-11-09 20:04:51 +08:00

70 lines
1.8 KiB
Nix

{ lib
, stdenv
, fetchzip
, fetchpatch
, zlib
, zopfli
}:
stdenv.mkDerivation rec {
pname = "gif2apng";
version = "1.9";
src = fetchzip {
url = "mirror://sourceforge/gif2apng/gif2apng-${version}-src.zip";
stripRoot = false;
hash = "sha256-rt1Vp4hjeFAVWJOU04BdU2YvBwECe9Q1c7EpNpIN+uE=";
};
patches = [
(fetchpatch {
url = "https://sources.debian.org/data/main/g/gif2apng/1.9%2Bsrconly-3%2Bdeb11u1/debian/patches/10-7z.patch";
hash = "sha256-zQgSWP/CIGaTUIxP/X92zpAQVSGgVo8gQEoCCMn+XT0=";
})
(fetchpatch {
url = "https://sources.debian.org/data/main/g/gif2apng/1.9%2Bsrconly-3%2Bdeb11u1/debian/patches/CVE-2021-45909.patch";
hash = "sha256-ZDN3xgvktgahDEtrEpyVsL+4u+97Fo9vAB1RSKhu8KA=";
})
(fetchpatch {
url = "https://sources.debian.org/data/main/g/gif2apng/1.9%2Bsrconly-3%2Bdeb11u1/debian/patches/CVE-2021-45910.patch";
hash = "sha256-MzOUOC7kqH22DmTMXoDu+jZAMBJPndnFNJGAQv5FcdI=";
})
(fetchpatch {
url = "https://sources.debian.org/data/main/g/gif2apng/1.9%2Bsrconly-3%2Bdeb11u1/debian/patches/CVE-2021-45911.patch";
hash = "sha256-o2YDHsSaorCx/6bQQfudzkLHo9pakgyvs2Pbafplnek=";
})
];
# Remove bundled libs
postPatch = ''
rm -r 7z zlib zopfli
'';
buildInputs = [
zlib
zopfli
];
preBuild = ''
buildFlagsArray+=("LIBS=-lzopfli -lstdc++ -lz")
'';
makeFlags = [ "CC=${stdenv.cc.targetPrefix}c++" ];
NIX_CFLAGS_COMPILE="-DENABLE_LOCAL_ZOPFLI";
installPhase = ''
runHook preInstall
install -Dm755 gif2apng $out/bin/gif2apng
runHook postInstall
'';
meta = with lib; {
homepage = "https://gif2apng.sourceforge.net/";
description = "Simple program that converts animations from GIF to APNG format";
license = licenses.zlib;
maintainers = with maintainers; [ fgaz ];
platforms = platforms.all;
};
}