nixpkgs/pkgs/by-name/lu/luarocks-packages-updater/package.nix
Matthieu Coudron 57bbd52af5
packages luarocks updater as pyproject package (#343584)
* luarocks-packages-updater: convert into pyproject package

* pluginupdate: move to its own folder

so we can copy just the folder when using this as a module

* luarocks-packages-updater: adress review
2024-09-22 21:15:41 +02:00

56 lines
1.1 KiB
Nix

{ nix
, makeWrapper
, python3Packages
, lib
, nix-prefetch-scripts
, luarocks-nix
, pluginupdate
}:
let
path = lib.makeBinPath [
nix nix-prefetch-scripts luarocks-nix
];
attrs = builtins.fromTOML (builtins.readFile ./pyproject.toml);
pname = attrs.project.name;
inherit (attrs.project) version;
in
python3Packages.buildPythonApplication {
inherit pname version;
pyproject = true;
src = lib.cleanSource ./.;
build-system = [
python3Packages.setuptools
];
dependencies = [
python3Packages.gitpython
];
postFixup = ''
echo "pluginupdate folder ${pluginupdate}"
wrapProgram $out/bin/luarocks-packages-updater \
--prefix PYTHONPATH : "${pluginupdate}" \
--prefix PATH : "${path}"
'';
shellHook = ''
export PYTHONPATH="maintainers/scripts/pluginupdate-py:$PYTHONPATH"
export PATH="${path}:$PATH"
'';
meta = {
inherit (attrs.project) description;
license = lib.licenses.gpl3Only;
homepage = attrs.project.urls.Homepage;
mainProgram = "luarocks-packages-updater";
maintainers = with lib.maintainers; [ teto ];
};
}