From 913cbfda3332f42da21dd37f49944c06b8b20aec Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20=C4=8Cun=C3=A1t?= Date: Thu, 21 Jul 2022 19:55:40 +0200 Subject: [PATCH] apkg: init at 0.4.0 --- .../tools/package-management/apkg/default.nix | 49 +++++++++++++++++++ pkgs/top-level/all-packages.nix | 2 + 2 files changed, 51 insertions(+) create mode 100644 pkgs/tools/package-management/apkg/default.nix diff --git a/pkgs/tools/package-management/apkg/default.nix b/pkgs/tools/package-management/apkg/default.nix new file mode 100644 index 000000000000..9f187724666d --- /dev/null +++ b/pkgs/tools/package-management/apkg/default.nix @@ -0,0 +1,49 @@ +{ lib, fetchFromGitLab, python3Packages +, gitMinimal, rpm, dpkg, fakeroot +}: + +python3Packages.buildPythonApplication rec { + pname = "apkg"; + version = "0.4.0"; + + src = fetchFromGitLab { + domain = "gitlab.nic.cz"; + owner = "packaging"; + repo = pname; + rev = "v${version}"; + sha256 = "duZz2Kwjgek5pMJTDH8gMZAZ13uFwaIYT5E1brW7I7U="; + }; + + propagatedBuildInputs = with python3Packages; [ + # copy&pasted requirements.txt (almost exactly) + beautifulsoup4 # upstream version detection + blessings # terminal colors + build # apkg distribution + cached-property # @cached_property for python <= 3.7 + click # nice CLI framework + distro # current distro detection + jinja2 # templating + packaging # version parsing + requests # HTTP for humans™ + setuptools # required by minver + toml # config files + ]; + + makeWrapperArgs = [ # deps for `srcpkg` operation for other distros; could be optional + "--prefix" "PATH" ":" (lib.makeBinPath [ gitMinimal rpm dpkg fakeroot ]) + ]; + + checkInputs = with python3Packages; [ pytest ]; + 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 */ ]; + }; +} diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 49772490ff0f..06d72e898a91 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -15157,6 +15157,8 @@ with pkgs; anybadge = with python3Packages; toPythonApplication anybadge; + apkg = callPackage ../tools/package-management/apkg { }; + augeas = callPackage ../tools/system/augeas { }; autoadb = callPackage ../misc/autoadb { };