diff options
Diffstat (limited to 'nixpkgs/pkgs/applications/misc/calibre/default.nix')
-rw-r--r-- | nixpkgs/pkgs/applications/misc/calibre/default.nix | 33 |
1 files changed, 20 insertions, 13 deletions
diff --git a/nixpkgs/pkgs/applications/misc/calibre/default.nix b/nixpkgs/pkgs/applications/misc/calibre/default.nix index c05b98a07283..0b66be1f84c1 100644 --- a/nixpkgs/pkgs/applications/misc/calibre/default.nix +++ b/nixpkgs/pkgs/applications/misc/calibre/default.nix @@ -1,16 +1,16 @@ -{ stdenv, fetchurl, poppler_utils, pkgconfig, libpng +{ stdenv, mkDerivation, fetchurl, poppler_utils, pkgconfig, libpng , imagemagick, libjpeg, fontconfig, podofo, qtbase, qmake, icu, sqlite -, makeWrapper, unrarSupport ? false, chmlib, python2Packages, libusb1, libmtp -, xdg_utils, makeDesktopItem, wrapGAppsHook, removeReferencesTo +, unrarSupport ? false, chmlib, python2Packages, libusb1, libmtp +, xdg_utils, makeDesktopItem, wrapGAppsHook, removeReferencesTo, qt5 }: -stdenv.mkDerivation rec { - version = "3.44.0"; +mkDerivation rec { name = "calibre-${version}"; + version = "3.45.2"; src = fetchurl { url = "https://download.calibre-ebook.com/${version}/${name}.tar.xz"; - sha256 = "13d3cbn8qbjd8a19qprra6gmib1d818c3zgf3q70kx6b2fq58lzi"; + sha256 = "1379g375s3h0fgv9qg43hrg16knd76ym7qkffpn1qyc7kkhv8a05"; }; patches = [ @@ -35,11 +35,11 @@ stdenv.mkDerivation rec { enableParallelBuilding = true; - nativeBuildInputs = [ makeWrapper pkgconfig qmake removeReferencesTo ]; + nativeBuildInputs = [ pkgconfig qmake removeReferencesTo wrapGAppsHook ]; buildInputs = [ poppler_utils libpng imagemagick libjpeg - fontconfig podofo qtbase chmlib icu sqlite libusb1 libmtp xdg_utils wrapGAppsHook + fontconfig podofo qtbase chmlib icu sqlite libusb1 libmtp xdg_utils ] ++ (with python2Packages; [ apsw cssselect css-parser dateutil dnspython html5-parser lxml mechanize netifaces pillow python pyqt5_with_qtwebkit sip @@ -70,11 +70,6 @@ stdenv.mkDerivation rec { sed -i "s/env python[0-9.]*/python/" $PYFILES sed -i "2i import sys; sys.argv[0] = 'calibre'" $out/bin/calibre - for a in $out/bin/*; do - wrapProgram $a --prefix PYTHONPATH : $PYTHONPATH \ - --prefix PATH : ${poppler_utils.out}/bin - done - # Replace @out@ by the output path. mkdir -p $out/share/applications/ cp {$calibreDesktopItem,$ebookEditDesktopItem,$ebookViewerDesktopItem}/share/applications/* $out/share/applications/ @@ -88,11 +83,23 @@ stdenv.mkDerivation rec { runHook postInstall ''; + # Wrap manually + dontWrapQtApps = true; + dontWrapGApps = true; + # Remove some references to shrink the closure size. This reference (as of # 2018-11-06) was a single string like the following: # /nix/store/xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx-podofo-0.9.6-dev/include/podofo/base/PdfVariant.h preFixup = '' remove-references-to -t ${podofo.dev} $out/lib/calibre/calibre/plugins/podofo.so + + for program in $out/bin/*; do + wrapProgram $program \ + ''${qtWrapperArgs[@]} \ + ''${gappsWrapperArgs[@]} \ + --prefix PYTHONPATH : $PYTHONPATH \ + --prefix PATH : ${poppler_utils.out}/bin + done ''; disallowedReferences = [ podofo.dev ]; |