Gaetan Lepage
2025-03-31 14:15:18 +02:00
parent 590759457a
commit 7d02bb4882
+35 -10
View File
@@ -4,20 +4,28 @@
fetchFromGitHub,
gitMinimal,
python3,
versionCheckHook,
nix-update-script,
}:
buildGoModule rec {
buildGoModule (finalAttrs: {
pname = "databricks-cli";
version = "0.244.0";
version = "0.245.0";
src = fetchFromGitHub {
owner = "databricks";
repo = "cli";
rev = "v${version}";
hash = "sha256-TGbmGAS3hS9m6CNTtHQ0N3Fz6Ei+ry06enfYtWK/xOw=";
rev = "v${finalAttrs.version}";
hash = "sha256-4EWBDfDCiOF9LcON5XT77kNcAXBd57ZjsSGB+hzRgOw=";
};
vendorHash = "sha256-W1tAFLSy5rX07Dkj+r+T6whbuTevpxxtakG2caUdWJQ=";
# Otherwise these tests fail asserting that the version is 0.0.0-dev
postPatch = ''
substituteInPlace bundle/deploy/terraform/init_test.go \
--replace-fail "cli/0.0.0-dev" "cli/${finalAttrs.version}"
'';
vendorHash = "sha256-XkUkCraKR9AP0lRZa+u1YMWzLZV+xxWZgbAlxkVjsXM=";
excludedPackages = [
"bundle/internal"
@@ -25,6 +33,10 @@ buildGoModule rec {
"integration"
];
ldflags = [
"-X github.com/databricks/cli/internal/build.buildVersion=${finalAttrs.version}"
];
postBuild = ''
mv "$GOPATH/bin/cli" "$GOPATH/bin/databricks"
'';
@@ -60,15 +72,28 @@ buildGoModule rec {
git remote add origin https://github.com/databricks/cli.git
'';
meta = with lib; {
__darwinAllowLocalNetworking = true;
nativeInstallCheckInputs = [
versionCheckHook
];
versionCheckProgram = "${placeholder "out"}/bin/databricks";
versionCheckProgramArg = "--version";
doInstallCheck = true;
passthru = {
updateScript = nix-update-script { };
};
meta = {
description = "Databricks CLI";
mainProgram = "databricks";
homepage = "https://github.com/databricks/cli";
changelog = "https://github.com/databricks/cli/releases/tag/v${version}";
license = licenses.databricks;
maintainers = with maintainers; [
changelog = "https://github.com/databricks/cli/releases/tag/v${finalAttrs.version}";
license = lib.licenses.databricks;
maintainers = with lib.maintainers; [
kfollesdal
taranarmo
];
};
}
})