mimeo: migrate to pyproject = true, clean up installation

This commit is contained in:
TomaSajt
2025-07-12 15:21:03 +02:00
parent 9c492c3233
commit b29dc3a7c6
+8 -13
View File
@@ -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'" \
"EXE_UPDATE_DESKTOP_DATABASE = '${desktop-file-utils}/bin/update-desktop-database'" \
--replace "EXE_FILE = 'file'" \
"EXE_FILE = '${file}/bin/file'"
--replace-fail "EXE_UPDATE_DESKTOP_DATABASE = 'update-desktop-database'" \
"EXE_UPDATE_DESKTOP_DATABASE = '${desktop-file-utils}/bin/update-desktop-database'" \
--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