From d05f8b3a9556d788ea0b9101cd8df9d7fd4d0769 Mon Sep 17 00:00:00 2001 From: Peter Hoeg Date: Fri, 6 Mar 2020 11:49:52 +0800 Subject: [PATCH] pdf2djvu: 0.9.14 -> 0.9.17 --- pkgs/tools/typesetting/pdf2djvu/default.nix | 64 +++++++++++++-------- 1 file changed, 41 insertions(+), 23 deletions(-) diff --git a/pkgs/tools/typesetting/pdf2djvu/default.nix b/pkgs/tools/typesetting/pdf2djvu/default.nix index 1090ad300f73..cbd4fa569d19 100644 --- a/pkgs/tools/typesetting/pdf2djvu/default.nix +++ b/pkgs/tools/typesetting/pdf2djvu/default.nix @@ -1,42 +1,60 @@ -{ stdenv, fetchurl, fetchpatch, pkgconfig, djvulibre, poppler, fontconfig, libjpeg }: +{ stdenv +, lib +, fetchFromGitHub +, autoreconfHook +, gettext +, libtool +, pkgconfig +, djvulibre +, exiv2 +, fontconfig +, graphicsmagick +, libjpeg +, libuuid +, poppler +}: stdenv.mkDerivation rec { - version = "0.9.14"; + version = "0.9.17"; pname = "pdf2djvu"; - src = fetchurl { - url = "https://github.com/jwilk/pdf2djvu/releases/download/${version}/${pname}-${version}.tar.xz"; - sha256 = "05z2bbg54pfsi668fwcjrcr5iz9llf9gprzdsrn6fw5wjv4876zi"; + src = fetchFromGitHub { + owner = "jwilk"; + repo = "pdf2djvu"; + rev = version; + sha256 = "1iff5ha5ls9hni9ivj05r1vzbnjrb326ivjb8d05q2sfng3gfp3z"; }; - patches = [ - # fix build with Poppler 0.83 - (fetchpatch { - url = "https://github.com/jwilk/pdf2djvu/commit/0aa17bb79dbcdfc249e4841f5b5398e27cfdfd41.patch"; - sha256 = "0mr14nz5w7z4ri2556bxkf3cnn2f7dhwsld7csrh6z5qqb7d5805"; - }) - (fetchpatch { - url = "https://github.com/jwilk/pdf2djvu/commit/27b9e028091a2f370367e9eaf37b4bb1cde87b62.patch"; - sha256 = "03apsg1487jl800q8j70hicvg6xsndd593bg7babm4vgivkxb0da"; - }) + nativeBuildInputs = [ autoreconfHook pkgconfig ]; + + buildInputs = [ + djvulibre + exiv2 + fontconfig + graphicsmagick + libjpeg + libuuid + poppler ]; - nativeBuildInputs = [ pkgconfig ]; + postPatch = '' + substituteInPlace private/autogen \ + --replace /usr/share/gettext ${gettext}/share/gettext \ + --replace /usr/share/libtool ${libtool}/share/libtool - buildInputs = [ djvulibre poppler fontconfig libjpeg ]; + substituteInPlace configure.ac \ + --replace '$djvulibre_bin_path' ${djvulibre.bin}/bin + ''; - preConfigure = '' - sed -i 's#\$djvulibre_bin_path#${djvulibre.bin}/bin#g' configure - - # Configure skips the failing check for usability of windres when it is nonempty. - unset WINDRES + preAutoreconf = '' + private/autogen ''; enableParallelBuilding = true; meta = with stdenv.lib; { description = "Creates djvu files from PDF files"; - homepage = https://jwilk.net/software/pdf2djvu; + homepage = "https://jwilk.net/software/pdf2djvu"; license = licenses.gpl2; maintainers = with maintainers; [ pSub ]; inherit version;