mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-01-22 12:53:54 +00:00
571c71e6f7
We are migrating packages that meet below requirements: 1. using `callPackage` 2. called path is a directory 3. overriding set is empty (`{ }`) 4. not containing path expressions other than relative path (to makenixpkgs-vet happy) 5. not referenced by nix files outside of the directory, other than`pkgs/top-level/all-packages.nix` 6. not referencing nix files outside of the directory 7. not referencing `default.nix` (since it's changed to `package.nix`) 8. `outPath` doesn't change after migration The tool is here: https://github.com/Aleksanaa/by-name-migrate.
53 lines
1.6 KiB
Nix
53 lines
1.6 KiB
Nix
{ lib, fetchFromGitLab, python3Packages
|
|
, gitMinimal, rpm, dpkg, fakeroot
|
|
}:
|
|
|
|
python3Packages.buildPythonApplication rec {
|
|
pname = "apkg";
|
|
version = "0.5.0";
|
|
format = "pyproject";
|
|
|
|
src = fetchFromGitLab {
|
|
domain = "gitlab.nic.cz";
|
|
owner = "packaging";
|
|
repo = pname;
|
|
rev = "v${version}";
|
|
hash = "sha256-VQNUzbWIDo/cbCdtx8JxN5UUMBW3mQ2B42In4b3AA+A=";
|
|
};
|
|
|
|
propagatedBuildInputs = with python3Packages; [
|
|
# copy&pasted requirements.txt (almost exactly)
|
|
beautifulsoup4 # upstream version detection
|
|
blessed # terminal colors
|
|
build # apkg distribution
|
|
cached-property # for python <= 3.7; but pip complains even with 3.8
|
|
click # nice CLI framework
|
|
distro # current distro detection
|
|
jinja2 # templating
|
|
packaging # version parsing
|
|
requests # HTTP for humans™
|
|
toml # config files
|
|
];
|
|
|
|
nativeBuildInputs = with python3Packages; [ hatchling ];
|
|
|
|
makeWrapperArgs = [ # deps for `srcpkg` operation for other distros; could be optional
|
|
"--prefix" "PATH" ":" (lib.makeBinPath [ gitMinimal rpm dpkg fakeroot ])
|
|
];
|
|
|
|
nativeCheckInputs = with python3Packages; [ pytest dunamai ];
|
|
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 */ ];
|
|
mainProgram = "apkg";
|
|
};
|
|
}
|