pytrainer: unpin python 3.10
[NixPkgs.git] / pkgs / by-name / im / imageworsener / package.nix
blob7c108002c2170142788c887880de62852b104683
2   lib,
3   stdenv,
4   fetchFromGitHub,
5   fetchpatch2,
6   autoreconfHook,
7   zlib,
8   libpng,
9   libjpeg,
10   libwebp,
11   nix-update-script,
14 stdenv.mkDerivation (finalAttrs: {
15   pname = "imageworsener";
16   version = "1.3.5";
18   src = fetchFromGitHub {
19     owner = "jsummers";
20     repo = "imageworsener";
21     rev = finalAttrs.version;
22     hash = "sha256-1f5x8Ph994Kkjo38NudXL+UF0fpR8BmZfaGPxc8RENU=";
23   };
25   patches = [
26     # Fix tests not failing even when they should.
27     # https://github.com/jsummers/imageworsener/pull/46
28     (fetchpatch2 {
29       url = "https://github.com/jsummers/imageworsener/commit/91c7c79d86f55920193d17a7b87631b14ac7779f.patch?full_index=1";
30       hash = "sha256-8vxht0FiQFOdglwaO0ZQpg5BNYXXHROkznZ+Caxm/v0=";
31     })
32   ];
34   postPatch = ''
35     patchShebangs tests/runtest
37     # JPEG tests fail due to libjpeg-turbo differences.
38     sed -i '/\.jpg/d' tests/runtest
39     rm tests/expected/*.jpg
40   '';
42   postInstall = ''
43     mkdir -p $out/share/doc/imageworsener
44     cp readme.txt technical.txt $out/share/doc/imageworsener
45   '';
47   nativeBuildInputs = [ autoreconfHook ];
49   buildInputs = [
50     zlib
51     libpng
52     libjpeg
53     libwebp
54   ];
56   strictDeps = true;
58   doCheck = true;
60   enableParallelBuilding = true;
62   __structuredAttrs = true;
64   passthru.updateScript = nix-update-script { };
66   meta = {
67     description = "Raster image scaling and processing utility";
68     longDescription = ''
69       ImageWorsener is a cross-platform command-line utility and library for
70       image scaling and other image processing. It has full support for PNG,
71       JPEG, BMP formats, experimental support for WebP, read-only support for
72       GIF, and limited support for some other image formats. It’s not as
73       fast or memory-efficient as some utilities, but it’s very accurate.
74     '';
75     homepage = "https://entropymine.com/imageworsener/";
76     changelog = "${finalAttrs.src.meta.homepage}/blob/${finalAttrs.src.rev}/changelog.txt";
77     sourceProvenance = [ lib.sourceTypes.fromSource ];
78     license = lib.licenses.mit;
79     maintainers = [
80       lib.maintainers.emily
81       lib.maintainers.smitop
82     ];
83     mainProgram = "imagew";
84     platforms = lib.platforms.all;
85   };