nixpkgs/pkgs/by-name/pd/pdf2djvu/package.nix
aleksana 571c71e6f7 treewide: migrate packages to pkgs/by-name, take 1
We are migrating packages that meet below requirements:

1. using `callPackage`
2. called path is a directory
3. overriding set is empty (`{ }`)
4. not containing path expressions other than relative path (to
makenixpkgs-vet happy)
5. not referenced by nix files outside of the directory, other
than`pkgs/top-level/all-packages.nix`
6. not referencing nix files outside of the directory
7. not referencing `default.nix` (since it's changed to `package.nix`)
8. `outPath` doesn't change after migration

The tool is here: https://github.com/Aleksanaa/by-name-migrate.
2024-11-09 20:04:51 +08:00

67 lines
1.3 KiB
Nix

{ stdenv
, lib
, fetchFromGitHub
, autoreconfHook
, gettext
, libtool
, pkg-config
, djvulibre
, exiv2
, fontconfig
, graphicsmagick
, libjpeg
, libuuid
, poppler
}:
stdenv.mkDerivation rec {
version = "0.9.19";
pname = "pdf2djvu";
src = fetchFromGitHub {
owner = "jwilk";
repo = "pdf2djvu";
rev = version;
sha256 = "sha256-j4mYdmLZ56qTA1KbWBjBvyTyLaeuIITKYsALRIO7lj0=";
};
nativeBuildInputs = [ autoreconfHook pkg-config ];
buildInputs = [
djvulibre
exiv2
fontconfig
graphicsmagick
libjpeg
libuuid
poppler
];
postPatch = ''
substituteInPlace private/autogen \
--replace /usr/share/gettext ${gettext}/share/gettext \
--replace /usr/share/libtool ${libtool}/share/libtool
substituteInPlace configure.ac \
--replace '$djvulibre_bin_path' ${djvulibre.bin}/bin
'';
preAutoreconf = ''
private/autogen
'';
enableParallelBuilding = true;
# Required by Poppler on darwin
# https://github.com/jwilk/pdf2djvu/commit/373e065faf2f0d868a3700788d20a96e9528bb12
CXXFLAGS = "-std=c++17";
meta = with lib; {
description = "Creates djvu files from PDF files";
homepage = "https://jwilk.net/software/pdf2djvu";
license = licenses.gpl2Only;
maintainers = with maintainers; [ pSub ];
mainProgram = "pdf2djvu";
};
}