2024-07-06 10:28:59 +00:00
|
|
|
|
{
|
|
|
|
|
lib,
|
|
|
|
|
stdenv,
|
2024-07-06 10:31:08 +00:00
|
|
|
|
fetchFromGitHub,
|
2024-07-06 19:10:49 +00:00
|
|
|
|
fetchpatch2,
|
2024-07-06 10:31:08 +00:00
|
|
|
|
autoreconfHook,
|
2024-07-06 10:28:59 +00:00
|
|
|
|
zlib,
|
|
|
|
|
libpng,
|
|
|
|
|
libjpeg,
|
|
|
|
|
libwebp,
|
2024-07-06 10:31:08 +00:00
|
|
|
|
nix-update-script,
|
2020-01-15 00:05:30 +00:00
|
|
|
|
}:
|
|
|
|
|
|
2024-07-06 10:31:08 +00:00
|
|
|
|
stdenv.mkDerivation (finalAttrs: {
|
2020-01-15 00:05:30 +00:00
|
|
|
|
pname = "imageworsener";
|
2022-11-28 15:56:38 +00:00
|
|
|
|
version = "1.3.5";
|
2020-01-15 00:05:30 +00:00
|
|
|
|
|
2024-07-06 10:31:08 +00:00
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
|
owner = "jsummers";
|
2024-07-06 19:10:49 +00:00
|
|
|
|
repo = "imageworsener";
|
2024-07-06 10:31:08 +00:00
|
|
|
|
rev = finalAttrs.version;
|
|
|
|
|
hash = "sha256-1f5x8Ph994Kkjo38NudXL+UF0fpR8BmZfaGPxc8RENU=";
|
2020-01-15 00:05:30 +00:00
|
|
|
|
};
|
|
|
|
|
|
2024-07-06 19:10:49 +00:00
|
|
|
|
patches = [
|
|
|
|
|
# Fix tests not failing even when they should.
|
|
|
|
|
# https://github.com/jsummers/imageworsener/pull/46
|
|
|
|
|
(fetchpatch2 {
|
|
|
|
|
url = "https://github.com/jsummers/imageworsener/commit/91c7c79d86f55920193d17a7b87631b14ac7779f.patch?full_index=1";
|
|
|
|
|
hash = "sha256-8vxht0FiQFOdglwaO0ZQpg5BNYXXHROkznZ+Caxm/v0=";
|
|
|
|
|
})
|
|
|
|
|
];
|
|
|
|
|
|
2020-01-15 00:05:30 +00:00
|
|
|
|
postPatch = ''
|
|
|
|
|
patchShebangs tests/runtest
|
2024-07-06 19:10:49 +00:00
|
|
|
|
|
|
|
|
|
# JPEG tests fail due to libjpeg-turbo differences.
|
|
|
|
|
sed -i '/\.jpg/d' tests/runtest
|
|
|
|
|
rm tests/expected/*.jpg
|
2020-01-15 00:05:30 +00:00
|
|
|
|
'';
|
|
|
|
|
|
|
|
|
|
postInstall = ''
|
|
|
|
|
mkdir -p $out/share/doc/imageworsener
|
|
|
|
|
cp readme.txt technical.txt $out/share/doc/imageworsener
|
|
|
|
|
'';
|
|
|
|
|
|
2024-07-06 10:31:08 +00:00
|
|
|
|
nativeBuildInputs = [ autoreconfHook ];
|
|
|
|
|
|
2024-07-06 10:28:59 +00:00
|
|
|
|
buildInputs = [
|
|
|
|
|
zlib
|
|
|
|
|
libpng
|
|
|
|
|
libjpeg
|
|
|
|
|
libwebp
|
|
|
|
|
];
|
2020-01-15 00:05:30 +00:00
|
|
|
|
|
2024-07-06 10:31:08 +00:00
|
|
|
|
strictDeps = true;
|
|
|
|
|
|
2020-01-15 00:05:30 +00:00
|
|
|
|
doCheck = true;
|
|
|
|
|
|
|
|
|
|
enableParallelBuilding = true;
|
|
|
|
|
|
2024-07-06 10:31:08 +00:00
|
|
|
|
__structuredAttrs = true;
|
|
|
|
|
|
2024-07-06 10:31:08 +00:00
|
|
|
|
passthru.updateScript = nix-update-script { };
|
|
|
|
|
|
2024-07-06 10:31:08 +00:00
|
|
|
|
meta = {
|
2020-01-15 00:05:30 +00:00
|
|
|
|
description = "Raster image scaling and processing utility";
|
2024-07-06 10:31:08 +00:00
|
|
|
|
longDescription = ''
|
|
|
|
|
ImageWorsener is a cross-platform command-line utility and library for
|
|
|
|
|
image scaling and other image processing. It has full support for PNG,
|
|
|
|
|
JPEG, BMP formats, experimental support for WebP, read-only support for
|
|
|
|
|
GIF, and limited support for some other image formats. It’s not as
|
|
|
|
|
fast or memory-efficient as some utilities, but it’s very accurate.
|
|
|
|
|
'';
|
2020-04-01 01:11:51 +00:00
|
|
|
|
homepage = "https://entropymine.com/imageworsener/";
|
2024-07-06 10:31:08 +00:00
|
|
|
|
changelog = "${finalAttrs.src.meta.homepage}/blob/${finalAttrs.src.rev}/changelog.txt";
|
|
|
|
|
sourceProvenance = [ lib.sourceTypes.fromSource ];
|
2024-07-06 10:31:08 +00:00
|
|
|
|
license = lib.licenses.mit;
|
|
|
|
|
maintainers = [
|
|
|
|
|
lib.maintainers.emily
|
|
|
|
|
lib.maintainers.smitop
|
2024-07-06 10:28:59 +00:00
|
|
|
|
];
|
2022-04-01 19:34:55 +00:00
|
|
|
|
mainProgram = "imagew";
|
2024-07-06 10:31:08 +00:00
|
|
|
|
platforms = lib.platforms.all;
|
2020-01-15 00:05:30 +00:00
|
|
|
|
};
|
2024-07-06 10:31:08 +00:00
|
|
|
|
})
|