anchor.diff:  
       # Remove unneeded files and libs
       rm -rf resources/calibre-portable.* \
  -           src/{chardet,cherrypy,html5lib,odf,routes}
  +           src/odf
     '';
   
     dontUseQmakeConfigure = true;
  
positive.code:     poppler_utils libpng imagemagick libjpeg
      fontconfig podofo qtbase chmlib icu sqlite libusb1 libmtp xdg_utils wrapGAppsHook
    ] ++ (with python2Packages; [
      html5lib_0_9999999 # needs to be before mechanize ?
      apsw cssselect cssutils dateutil lxml mechanize netifaces pillow
      python pyqt5 sip
      regex msgpack
      # the following are distributed with calibre, but we use upstream instead
      chardet cherrypy odfpy routes
    ]);
  
    installPhase = ''
  
negative.code:     for entry in $out/share/applications/*.desktop; do
        substituteAllInPlace $entry
      done
  
      mkdir -p $out/share
      cp -a man-pages $out/share/man
  
      runHook postInstall
    '';
  