2022-08-12 12:06:08 +00:00
|
|
|
{ lib, fetchFromGitLab, python3Packages
|
|
|
|
, gitMinimal, rpm, dpkg, fakeroot
|
|
|
|
}:
|
|
|
|
|
|
|
|
python3Packages.buildPythonApplication rec {
|
|
|
|
pname = "apkg";
|
2023-08-04 22:07:22 +00:00
|
|
|
version = "0.4.1";
|
|
|
|
format = "pyproject";
|
2022-08-12 12:06:08 +00:00
|
|
|
|
|
|
|
src = fetchFromGitLab {
|
|
|
|
domain = "gitlab.nic.cz";
|
|
|
|
owner = "packaging";
|
|
|
|
repo = pname;
|
|
|
|
rev = "v${version}";
|
2023-08-04 22:07:22 +00:00
|
|
|
sha256 = "x7UYkqkF1XJ3OMfQpIQ4+27KI0dLvL42Wms5xQTY/H4=";
|
2022-08-12 12:06:08 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
propagatedBuildInputs = with python3Packages; [
|
|
|
|
# copy&pasted requirements.txt (almost exactly)
|
|
|
|
beautifulsoup4 # upstream version detection
|
2023-08-04 22:07:22 +00:00
|
|
|
blessed # terminal colors
|
2022-08-12 12:06:08 +00:00
|
|
|
build # apkg distribution
|
2023-08-04 22:07:22 +00:00
|
|
|
cached-property # for python <= 3.7; but pip complains even with 3.8
|
2022-08-12 12:06:08 +00:00
|
|
|
click # nice CLI framework
|
|
|
|
distro # current distro detection
|
|
|
|
jinja2 # templating
|
|
|
|
packaging # version parsing
|
|
|
|
requests # HTTP for humans™
|
|
|
|
toml # config files
|
|
|
|
];
|
|
|
|
|
2023-08-04 22:07:22 +00:00
|
|
|
nativeBuildInputs = with python3Packages; [ hatchling ];
|
|
|
|
|
2022-08-12 12:06:08 +00:00
|
|
|
makeWrapperArgs = [ # deps for `srcpkg` operation for other distros; could be optional
|
|
|
|
"--prefix" "PATH" ":" (lib.makeBinPath [ gitMinimal rpm dpkg fakeroot ])
|
|
|
|
];
|
|
|
|
|
2023-08-04 22:07:22 +00:00
|
|
|
nativeCheckInputs = with python3Packages; [ pytest dunamai ];
|
2022-08-12 12:06:08 +00:00
|
|
|
checkPhase = ''
|
|
|
|
runHook preCheck
|
|
|
|
py.test # inspiration: .gitlab-ci.yml
|
|
|
|
runHook postCheck
|
|
|
|
'';
|
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
description = "Upstream packaging automation tool";
|
|
|
|
homepage = "https://pkg.labs.nic.cz/pages/apkg";
|
|
|
|
license = licenses.gpl3Plus;
|
|
|
|
maintainers = [ maintainers.vcunat /* close to upstream */ ];
|
2024-01-02 11:29:13 +00:00
|
|
|
mainProgram = "apkg";
|
2022-08-12 12:06:08 +00:00
|
|
|
};
|
|
|
|
}
|