Winter a19cd4ffb1 Revert "treewide: replace rev with tag"
This reverts commit 65a333600d5c88a98d674f637d092807cfc12253.

This wasn't tested for correctness with something like fodwatch [0],
and should not have been (self-)merged so quickly, especially without
further review.

It also resulted in the breakage of at least one package [1] (and that's
the one we know of and was caught).

A few packages that were updated in between this commit and this revert
were not reverted back to using `rev`, but other than that, this is a
1:1 revert.

[0]: https://codeberg.org/raphaelr/fodwatch
[1]: https://github.com/NixOS/nixpkgs/pull/396904 / 758551e4587d75882aebc21a04bee960418f8ce9
2025-04-08 02:57:25 -04:00

87 lines
2.1 KiB
Nix
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

{
lib,
stdenv,
fetchFromGitHub,
fetchpatch2,
autoreconfHook,
zlib,
libpng,
libjpeg,
libwebp,
nix-update-script,
}:
stdenv.mkDerivation (finalAttrs: {
pname = "imageworsener";
version = "1.3.5";
src = fetchFromGitHub {
owner = "jsummers";
repo = "imageworsener";
rev = finalAttrs.version;
hash = "sha256-1f5x8Ph994Kkjo38NudXL+UF0fpR8BmZfaGPxc8RENU=";
};
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=";
})
];
postPatch = ''
patchShebangs tests/runtest
# JPEG tests fail due to libjpeg-turbo differences.
sed -i '/\.jpg/d' tests/runtest
rm tests/expected/*.jpg
'';
postInstall = ''
mkdir -p $out/share/doc/imageworsener
cp readme.txt technical.txt $out/share/doc/imageworsener
'';
nativeBuildInputs = [ autoreconfHook ];
buildInputs = [
zlib
libpng
libjpeg
libwebp
];
strictDeps = true;
doCheck = true;
enableParallelBuilding = true;
__structuredAttrs = true;
passthru.updateScript = nix-update-script { };
meta = {
description = "Raster image scaling and processing utility";
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. Its not as
fast or memory-efficient as some utilities, but its very accurate.
'';
homepage = "https://entropymine.com/imageworsener/";
changelog = "${finalAttrs.src.meta.homepage}/blob/${finalAttrs.src.rev}/changelog.txt";
sourceProvenance = [ lib.sourceTypes.fromSource ];
license = lib.licenses.mit;
maintainers = [
lib.maintainers.emily
lib.maintainers.smitop
];
mainProgram = "imagew";
platforms = lib.platforms.all;
};
})