2023-01-28 13:29:19 +00:00
|
|
|
{ lib
|
|
|
|
, stdenv
|
|
|
|
, fetchFromGitHub
|
|
|
|
, fetchpatch
|
2023-09-28 16:40:38 +00:00
|
|
|
, python3
|
2023-01-28 13:29:19 +00:00
|
|
|
, leptonica
|
|
|
|
, zlib
|
|
|
|
, libwebp
|
|
|
|
, giflib
|
|
|
|
, libjpeg
|
|
|
|
, libpng
|
|
|
|
, libtiff
|
|
|
|
, autoreconfHook
|
|
|
|
}:
|
2016-02-21 23:56:49 +00:00
|
|
|
|
2021-08-12 18:41:54 +00:00
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "jbig2enc";
|
2023-01-28 13:29:19 +00:00
|
|
|
version = "0.29";
|
2013-01-16 10:43:53 +00:00
|
|
|
|
2021-09-19 17:09:18 +00:00
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "agl";
|
|
|
|
repo = "jbig2enc";
|
2023-01-28 13:29:19 +00:00
|
|
|
rev = version;
|
|
|
|
hash = "sha256-IAL4egXgaGmCilzcryjuvOoHhahyrfGWY68GBfXXgAM=";
|
2013-01-16 10:43:53 +00:00
|
|
|
};
|
|
|
|
|
2023-03-10 22:55:17 +00:00
|
|
|
nativeBuildInputs = [ autoreconfHook ];
|
2023-09-28 16:40:38 +00:00
|
|
|
|
2023-01-28 13:29:19 +00:00
|
|
|
propagatedBuildInputs = [
|
|
|
|
leptonica
|
|
|
|
zlib
|
|
|
|
libwebp
|
|
|
|
giflib
|
|
|
|
libjpeg
|
|
|
|
libpng
|
|
|
|
libtiff
|
|
|
|
];
|
2013-01-16 10:43:53 +00:00
|
|
|
|
2016-03-24 19:21:07 +00:00
|
|
|
patches = [
|
2023-01-28 13:29:19 +00:00
|
|
|
(fetchpatch {
|
|
|
|
name = "fix-build-leptonica-1.83.patch";
|
|
|
|
url = "https://github.com/agl/jbig2enc/commit/ea050190466f5336c69c6a11baa1cb686677fcab.patch";
|
|
|
|
hash = "sha256-+kScjFgDEU9F7VOUNAhm2XBjGm49fzAH8hYhmTm8xv8=";
|
|
|
|
})
|
2016-03-24 19:21:07 +00:00
|
|
|
];
|
|
|
|
|
2023-09-28 16:40:38 +00:00
|
|
|
# We don't want to install this Python 2 script
|
|
|
|
postInstall = ''
|
|
|
|
rm "$out/bin/pdf.py"
|
|
|
|
'';
|
|
|
|
|
2013-01-16 10:43:53 +00:00
|
|
|
# This is necessary, because the resulting library has
|
|
|
|
# /tmp/nix-build-jbig2enc/src/.libs before /nix/store/jbig2enc/lib
|
|
|
|
# in its rpath, which means that patchelf --shrink-rpath removes
|
|
|
|
# the /nix/store one. By cleaning up before fixup, we ensure that
|
|
|
|
# the /tmp/nix-build-jbig2enc/src/.libs directory is gone.
|
|
|
|
preFixup = ''
|
|
|
|
make clean
|
|
|
|
'';
|
2013-08-28 20:07:20 +00:00
|
|
|
|
|
|
|
meta = {
|
|
|
|
description = "Encoder for the JBIG2 image compression format";
|
2021-01-15 09:19:50 +00:00
|
|
|
license = lib.licenses.asl20;
|
|
|
|
platforms = lib.platforms.all;
|
2023-01-28 13:29:19 +00:00
|
|
|
homepage = "https://github.com/agl/jbig2enc";
|
2023-09-28 16:40:38 +00:00
|
|
|
mainProgram = "jbig2";
|
2013-08-28 20:07:20 +00:00
|
|
|
};
|
2013-01-16 10:43:53 +00:00
|
|
|
}
|