Unverified Commit b29dc3a7 authored by TomaSajt's avatar TomaSajt
Browse files

mimeo: migrate to pyproject = true, clean up installation

parent 9c492c32
Loading
Loading
Loading
Loading
+8 −13
Original line number Diff line number Diff line
@@ -12,30 +12,25 @@ in
python3Packages.buildPythonApplication {
  pname = "mimeo";
  inherit version;
  format = "setuptools";
  pyproject = true;

  src = fetchurl {
    url = "https://xyne.dev/projects/mimeo/src/mimeo-${version}.tar.xz";
    hash = "sha256-CahvSypwR1aHVDHTdtty1ZfaKBWPolxc73uZ5OyeqZA=";
  };

  buildInputs = [
    file
    desktop-file-utils
  ];
  build-system = [ python3Packages.setuptools ];

  propagatedBuildInputs = [ python3Packages.pyxdg ];
  dependencies = [ python3Packages.pyxdg ];

  preConfigure = ''
  postPatch = ''
    substituteInPlace Mimeo.py \
      --replace "EXE_UPDATE_DESKTOP_DATABASE = 'update-desktop-database'" \
      --replace-fail "EXE_UPDATE_DESKTOP_DATABASE = 'update-desktop-database'" \
                     "EXE_UPDATE_DESKTOP_DATABASE = '${desktop-file-utils}/bin/update-desktop-database'" \
      --replace "EXE_FILE = 'file'" \
      --replace-fail "EXE_FILE = 'file'" \
                     "EXE_FILE = '${file}/bin/file'"
  '';

  installPhase = "install -Dm755 Mimeo.py $out/bin/mimeo";

  doInstallCheck = true;
  installCheckPhase = ''
    $out/bin/mimeo --help > /dev/null