anchor.diff:      export PODOFO_INC_DIR=${podofo.dev}/include/podofo
       export PODOFO_LIB_DIR=${podofo.lib}/lib
       export SIP_BIN=${pypkgs.sip}/bin/sip
  -    ${pypkgs.python.interpreter} setup.py install --prefix=$out
  +    export XDG_DATA_HOME=$out/share
  +    export XDG_UTILS_INSTALL_MODE="user"
  +
  +    ${pypkgs.python.interpreter} setup.py install --root=$out \
  +      --prefix=$out \
  +      --libdir=$out/lib \
  +      --staging-root=$out \
  +      --staging-libdir=$out/lib \
  +      --staging-sharedir=$out/share
  +
   
       PYFILES="$out/bin/* $out/lib/calibre/calibre/web/feeds/*.py
         $out/lib/calibre/calibre/ebooks/metadata/*.py
  
positive.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/
      for entry in $out/share/applications/*.desktop; do
        substituteAllInPlace $entry
      done
  
      mkdir -p $out/share
      cp -a man-pages $out/share/man
  
negative.code: 
    disallowedReferences = [ podofo.dev ];
  
    meta = with lib; {
      description = "Comprehensive e-book software";
      homepage = "https://calibre-ebook.com";
  