{ libsolv, python3, swig, ... }:

(libsolv.override {
  withRpm = false;
}).overrideAttrs ({
  cmakeFlags,
  buildInputs,
  nativeBuildInputs,
  postPatch ? "",
  ... }: {
  postPatch = ''
    ${postPatch}

    sed -i 's,DESTINATION ''${PYTHON_INSTALL_DIR},DESTINATION "${placeholder "out"}/${python3.sitePackages}",g' bindings/python/CMakeLists.txt
  '';
  cmakeFlags = cmakeFlags ++ [
    "-DENABLE_PYTHON=true"
  ];
  nativeBuildInputs = nativeBuildInputs ++ [
    swig
  ];
  buildInputs = buildInputs ++ [
    python3
  ];
})