crudini: 0.9.3 -> 0.9.4

This commit is contained in:
Theodore Ni 2023-08-29 11:21:22 -07:00 committed by Peter Hoeg
parent 63f920e4f2
commit fae0b99edc

View File

@ -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";
};
}