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

62 lines
1.2 KiB
Nix

{
lib,
stdenv,
fetchFromGitHub,
leptonica,
zlib,
libwebp,
giflib,
libjpeg,
libpng,
libtiff,
python3,
autoreconfHook,
}:
stdenv.mkDerivation rec {
pname = "jbig2enc";
version = "0.30";
src = fetchFromGitHub {
owner = "agl";
repo = "jbig2enc";
rev = version;
hash = "sha256-B19l2NdMq+wWKQ5f/y5aoPiBtQnn6sqpaIoyIq+ugTg=";
};
nativeBuildInputs = [ autoreconfHook ];
buildInputs = [
leptonica
zlib
libwebp
giflib
libjpeg
libpng
libtiff
python3
];
# We don't want to install this Python 2 script
#postInstall = ''
# rm "$out/bin/pdf.py"
#'';
# 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
'';
meta = {
description = "Encoder for the JBIG2 image compression format";
license = lib.licenses.asl20;
platforms = lib.platforms.all;
homepage = "https://github.com/agl/jbig2enc";
mainProgram = "jbig2";
};
}