mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-12-29 00:53:57 +00:00
571c71e6f7
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.
35 lines
980 B
Nix
35 lines
980 B
Nix
{ lib, stdenv, fetchurl, fetchpatch2, libpng }:
|
|
|
|
stdenv.mkDerivation rec {
|
|
pname = "pngcrush";
|
|
version = "1.8.13";
|
|
|
|
src = fetchurl {
|
|
url = "mirror://sourceforge/pmt/pngcrush-${version}-nolib.tar.xz";
|
|
sha256 = "0l43c59d6v9l0g07z3q3ywhb8xb3vz74llv3mna0izk9bj6aqkiv";
|
|
};
|
|
|
|
patches = [
|
|
(fetchpatch2 {
|
|
url = "https://salsa.debian.org/debian/pngcrush/-/raw/b4856b56fbc28252103cc14d156baddd564ca880/debian/patches/ignore_PNG_IGNORE_ADLER32.patch";
|
|
hash = "sha256-pFON/NUJiXMe9GETptgNltWa0izlby6P/fLsG1abz3g=";
|
|
})
|
|
];
|
|
|
|
makeFlags = [ "CC=${stdenv.cc.targetPrefix}cc" "LD=${stdenv.cc.targetPrefix}cc" ]; # gcc and/or clang compat
|
|
|
|
configurePhase = ''
|
|
sed -i s,/usr,$out, Makefile
|
|
'';
|
|
|
|
buildInputs = [ libpng ];
|
|
|
|
meta = {
|
|
homepage = "http://pmt.sourceforge.net/pngcrush";
|
|
description = "PNG optimizer";
|
|
license = lib.licenses.free;
|
|
platforms = with lib.platforms; linux ++ darwin;
|
|
mainProgram = "pngcrush";
|
|
};
|
|
}
|