anchor.diff:      done
     '';
   
  +  preFixup = ''
  +    # Make sure the python libraries reference $lib/lib
  +    for plib in $(find $(toPythonPath $lib) -name \*.so\* -type f); do
  +      patchelf --set-rpath "$lib/lib:$(patchelf --print-rpath "$plib")" "$plib"
  +    done
  +
  +    # Make sure libs in $lib/lib don't reference $out/lib
  +    find $lib/lib -name \*.so\* -type f -exec patchelf --shrink-rpath {} \;
  +    
  +    wrapPythonPrograms $out/bin
  +  '';
  +
     meta = with stdenv.lib; {
       description = "Distributed storage system";
       homepage = https://ceph.com/;
  
positive.code:     openssl
    ];
  
    postPatch = ''
      patchShebangs .
  
      # Fix zfs pkgconfig detection
      sed -i 's,\[zfs\],\[libzfs\],g' configure.ac
  
      # Fix GNU_SOURCE
      sed -i '/AC_INIT/aAC_GNU_SOURCE' configure.ac
    '' + optionalString (versionAtLeast version "10.1.0") ''
      # Fix LDAP linking
      ! grep '\(-lldap\|LDAP_LIB\)' src/rgw/Makefile.am
      sed -i 's,LIBRGW_DEPS +=,\0 -lldap,g' src/rgw/Makefile.am
  
      # Remove anything that depends on virtualenv
      sed -i '/include ceph-\(disk\|detect-init\)/d' src/Makefile.am
    '';
  
    preConfigure = ''
  
negative.code:     inherit rev sha256;
    };
  
    patches = optionals (versionOlder version "9.0.0") [
      (fetchTritonPatch {
        rev = "3e20a6c39775b724eff44af93f08b38205be1f5b";
        file = "ceph/fix-pgrefdebugging.patch";
        sha256 = "11xn226mlzh6c13j9h1xavr9pnnfvkykkxzmf7c0w7hqm3w8r0gs";
      })
    ];
  
  