diff --git a/pkgs/tools/misc/crudini/default.nix b/pkgs/tools/misc/crudini/default.nix index 6527a01e43b7..1e25413b151f 100644 --- a/pkgs/tools/misc/crudini/default.nix +++ b/pkgs/tools/misc/crudini/default.nix @@ -1,32 +1,52 @@ -{ lib, fetchFromGitHub, python3Packages, help2man, installShellFiles }: +{ lib +, fetchFromGitHub +, fetchpatch +, python3Packages +, help2man +, installShellFiles +}: python3Packages.buildPythonApplication rec { pname = "crudini"; - version = "0.9.3"; + version = "0.9.4"; + format = "pyproject"; src = fetchFromGitHub { owner = "pixelb"; repo = "crudini"; rev = version; - sha256 = "0298hvg0fpk0m0bjpwryj3icksbckwqqsr9w1ain55wf5s0v24k3"; + hash = "sha256-jbTOaCF/ZqRpM0scDBBAcV5bSYg/QhBPbM9R5cONZ2o="; }; - nativeBuildInputs = [ help2man installShellFiles ]; - - propagatedBuildInputs = with python3Packages; [ iniparse ]; + patches = [ + (fetchpatch { + name = "add-missing-install-file.patch"; + url = "https://github.com/pixelb/crudini/commit/d433e4d9c4106ae26985e3f4b2efa593bdd5c274.patch"; + hash = "sha256-aDGzoG4i2tvYeL8m1WoqwNFNHe4xR1dGk+XDt3f3i5E="; + }) + ]; postPatch = '' - substituteInPlace crudini-help \ - --replace ./crudini $out/bin/crudini - substituteInPlace tests/test.sh \ - --replace ..: $out/bin: + patchShebangs crudini.py crudini-help tests/test.sh ''; + env.SETUPTOOLS_SCM_PRETEND_VERSION = version; + + nativeBuildInputs = [ + help2man + installShellFiles + python3Packages.setuptools + python3Packages.setuptools-scm + python3Packages.wheel + ]; + + propagatedBuildInputs = with python3Packages; [ iniparse ]; + postInstall = '' # this just creates the man page make all - install -Dm444 -t $out/share/doc/${pname} README EXAMPLES + install -Dm444 -t $out/share/doc/${pname} README.md EXAMPLES installManPage *.1 ''; @@ -34,7 +54,7 @@ python3Packages.buildPythonApplication rec { runHook preCheck pushd tests >/dev/null - bash ./test.sh + ./test.sh popd >/dev/null runHook postCheck @@ -45,5 +65,6 @@ python3Packages.buildPythonApplication rec { homepage = "https://www.pixelbeat.org/programs/crudini/"; license = licenses.gpl2Only; maintainers = with maintainers; [ peterhoeg ]; + mainProgram = "crudini"; }; }