2023-03-30 22:05:00 +00:00
|
|
|
{ lib
|
|
|
|
, stdenv
|
|
|
|
, fetchFromGitHub
|
|
|
|
, libiconv
|
|
|
|
}:
|
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "leanify";
|
2024-04-21 15:54:59 +00:00
|
|
|
version = "unstable-2023-12-17";
|
2023-03-30 22:05:00 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "JayXon";
|
|
|
|
repo = "Leanify";
|
2024-04-21 15:54:59 +00:00
|
|
|
rev = "9daa4303cdc03f6b90b72c369e6377c6beb75c39";
|
|
|
|
hash = "sha256-fLazKCQnOT3bN3Kz25Q80RLk54EU5U6HCf6kPLcXn9c=";
|
2023-03-30 22:05:00 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
postPatch = lib.optionalString stdenv.isDarwin ''
|
|
|
|
substituteInPlace Makefile \
|
2024-04-21 15:54:59 +00:00
|
|
|
--replace-fail "-flto" "" \
|
|
|
|
--replace-fail "lib/LZMA/Alloc.o" "lib/LZMA/CpuArch.o lib/LZMA/Alloc.o" \
|
|
|
|
--replace-quiet "-Werror" ""
|
2023-03-30 22:05:00 +00:00
|
|
|
'';
|
|
|
|
|
|
|
|
buildInputs = lib.optionals stdenv.isDarwin [ libiconv ];
|
|
|
|
|
2024-06-05 15:53:02 +00:00
|
|
|
doCheck = true;
|
|
|
|
|
|
|
|
checkPhase = ''
|
|
|
|
runHook preCheck
|
|
|
|
./leanify /dev/null
|
|
|
|
runHook postCheck
|
|
|
|
'';
|
|
|
|
|
2023-03-30 22:05:00 +00:00
|
|
|
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;
|
2024-01-02 11:29:13 +00:00
|
|
|
mainProgram = "leanify";
|
2023-03-30 22:05:00 +00:00
|
|
|
};
|
|
|
|
}
|