anchor.diff: -{ 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
  +, unrarSupport ? false, chmlib, python2Packages, libusb1, libmtp
   , xdg_utils, makeDesktopItem, wrapGAppsHook, removeReferencesTo, qt5
   }:
   
  -stdenv.mkDerivation rec {
  +mkDerivation rec {
  +  name = "calibre-${version}";
     version = "3.45.2";
  -  name = "calibre-${version}";
   
     src = fetchurl {
       url = "https://download.calibre-ebook.com/${version}/${name}.tar.xz";
  
positive.code: 
    enableParallelBuilding = true;
  
    nativeBuildInputs = [ makeWrapper pkgconfig qmake removeReferencesTo qt5.wrapQtAppsHook ];
  
    buildInputs = [
      poppler_utils libpng imagemagick libjpeg
      fontconfig podofo qtbase chmlib icu sqlite libusb1 libmtp xdg_utils wrapGAppsHook
    ] ++ (with python2Packages; [
      apsw cssselect css-parser dateutil dnspython html5-parser lxml mechanize netifaces pillow
      python pyqt5_with_qtwebkit sip
  
negative.code:     sed -i "s/env python[0-9.]*/python/" $PYFILES
      sed -i "2i import sys; sys.argv[0] = 'calibre'" $out/bin/calibre
  
      # Replace @out@ by the output path.
      mkdir -p $out/share/applications/
      cp {$calibreDesktopItem,$ebookEditDesktopItem,$ebookViewerDesktopItem}/share/applications/* $out/share/applications/
  