1{ lib, stdenv, fetchurl, python3, autoconf, automake, libtool }:
2
3stdenv.mkDerivation rec {
4 pname = "jbig2dec";
5 version = "0.20";
6
7 src = fetchurl {
8 url = "https://github.com/ArtifexSoftware/jbig2dec/archive/${version}/jbig2dec-${version}.tar.gz";
9 hash = "sha256-qXBTaaZjOrpTJpNFDsgCxWI5fhuCRmLegJ7ekvZ6/yE=";
10 };
11
12 postPatch = ''
13 patchShebangs test_jbig2dec.py
14 '';
15
16 nativeBuildInputs = [ autoconf automake libtool ];
17
18 # `autogen.sh` runs `configure`, and expects that any flags needed
19 # by `configure` (like `--host`) are passed to `autogen.sh`.
20 configureScript = "./autogen.sh";
21
22 nativeCheckInputs = [ python3 ];
23 doCheck = true;
24
25 meta = {
26 homepage = "https://www.jbig2dec.com/";
27 description = "Decoder implementation of the JBIG2 image compression format";
28 mainProgram = "jbig2dec";
29 license = lib.licenses.agpl3Only;
30 platforms = lib.platforms.unix;
31 };
32}