depot/pkgs/by-name/ni/nixpkgs-openjdk-updater/package.nix
Luke Granger-Brown 57725ef3ec Squashed 'third_party/nixpkgs/' content from commit 76612b17c0ce
git-subtree-dir: third_party/nixpkgs
git-subtree-split: 76612b17c0ce71689921ca12d9ffdc9c23ce40b2
2024-11-10 23:59:47 +00:00

80 lines
1.4 KiB
Nix

{
lib,
python3Packages,
ruff,
pyright,
fetchFromGitHub,
nixpkgs-openjdk-updater,
}:
python3Packages.buildPythonApplication {
pname = "nixpkgs-openjdk-updater";
version = "0.1.0";
format = "pyproject";
src = ./nixpkgs-openjdk-updater;
build-system = [ python3Packages.hatchling ];
dependencies = [
python3Packages.pydantic
python3Packages.pygithub
];
nativeCheckInputs = [
ruff
pyright
python3Packages.pytestCheckHook
];
preCheck = ''
ruff format --check
ruff check
pyright
'';
postCheck = ''
$out/bin/nixpkgs-openjdk-updater --help >/dev/null
'';
passthru.openjdkSource =
{
sourceFile,
featureVersionPrefix,
}:
let
# TODO: Tighten up after update scripts are run.
src = fetchFromGitHub (lib.importJSON sourceFile);
in
{
inherit src;
updateScript = {
command = [
(lib.getExe nixpkgs-openjdk-updater)
"--source-file"
sourceFile
"--owner"
src.owner
"--repo"
src.repo
"--feature-version-prefix"
featureVersionPrefix
];
supportedFeatures = [ "silent" ];
};
};
meta = {
description = "Updater for Nixpkgs OpenJDK packages";
license = lib.licenses.mit;
sourceProvenance = [ lib.sourceTypes.fromSource ];
maintainers = [ lib.maintainers.emily ];
mainProgram = "nixpkgs-openjdk-updater";
};
}