nixpkgs/pkgs/tools/misc/leanify/default.nix
Mynacol f0152c8c2c leanify: 2023-10-19 -> 2023-12-17
As part of this upgrade, don't abort on compiler warnings, e.g.:
```
> clang -Wall -Werror -O3  -Wno-unused-function -I./lib  -c -o lib/zopfli/squeeze.o lib/zopfli/squeeze.c
> lib/zopfli/squeeze.c:341:10: error: variable 'total_length_test' set but not used [-Werror,-Wunused-but-set-variable]
>   size_t total_length_test = 0;
>          ^
> 1 error generated.
> make: *** [<builtin>: lib/zopfli/squeeze.o] Error 1
```
2024-03-18 16:18:56 +01:00

51 lines
1.3 KiB
Nix

{ lib
, stdenv
, fetchFromGitHub
, libiconv
}:
stdenv.mkDerivation rec {
pname = "leanify";
version = "unstable-2023-12-17";
src = fetchFromGitHub {
owner = "JayXon";
repo = "Leanify";
rev = "9daa4303cdc03f6b90b72c369e6377c6beb75c39";
hash = "sha256-fLazKCQnOT3bN3Kz25Q80RLk54EU5U6HCf6kPLcXn9c=";
};
postPatch = lib.optionalString stdenv.isDarwin ''
substituteInPlace Makefile \
--replace-fail "-flto" "" \
--replace-fail "lib/LZMA/Alloc.o" "lib/LZMA/CpuArch.o lib/LZMA/Alloc.o" \
--replace-quiet "-Werror" ""
'';
buildInputs = lib.optionals stdenv.isDarwin [ libiconv ];
installPhase = ''
runHook preInstall
mkdir -p $out/bin
cp leanify $out/bin/
runHook postInstall
'';
meta = with lib; {
description = "Lightweight lossless file minifier/optimizer";
longDescription = ''
Leanify is a lightweight lossless file minifier/optimizer.
It removes unnecessary data (debug information, comments, metadata, etc.) and recompress the file to reduce file size.
It will not reduce image quality at all.
'';
homepage = "https://github.com/JayXon/Leanify";
changelog = "https://github.com/JayXon/Leanify/blob/master/CHANGELOG.md";
license = licenses.mit;
maintainers = [ maintainers.mynacol ];
platforms = platforms.all;
mainProgram = "leanify";
};
}