-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathbuild.ncl
More file actions
73 lines (67 loc) · 2.53 KB
/
Copy pathbuild.ncl
File metadata and controls
73 lines (67 loc) · 2.53 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
let { Attrs, BuildSpec, Local, OutputBin, OutputLib, Source, .. } = import "minimal.ncl" in
let { target, .. } = import "config.ncl" in
let base = import "../base/build.ncl" in
let coreutils = import "../coreutils/build.ncl" in
let findutils = import "../findutils/build.ncl" in
let curl = import "../curl/build.ncl" in
let git = import "../git/build.ncl" in
let glibc = import "../glibc/build.ncl" in
let openssh = import "../openssh/build.ncl" in
let ripgrep = import "../ripgrep/build.ncl" in
let { version, amd64_sha256, arm64_sha256, gcs_bucket } = {
gcs_bucket = "https://storage.googleapis.com/claude-code-dist-86c565f3-f756-42ad-8dfa-d59b1c096819/claude-code-releases",
version = "2.1.221",
amd64_sha256 = "60db8e88d42c24b5199c92cfd56ec88370c510c3789c6f364af748354f087ada",
arm64_sha256 = "d3c59d6bcc4adcf4cd85abca3bc13fa1131a34cb32f982bdf030d83a3b11e700",
}
in
{
name = "claude-code",
build_deps = [
{ file = "build.sh" } | Local,
# Based on https://storage.googleapis.com/claude-code-dist-86c565f3-f756-42ad-8dfa-d59b1c096819/claude-code-releases/bootstrap.sh
#
# - The current stable version is given by the string in the file at: $GCS_BUCKET/stable
# - The manifest JSON for a version is $GCS_BUCKET/$version/manifest.json
# - The actual binary is $GCS_BUCKET/$version/$platform/claude, where $platform is "$os-$arch" where $os in [linux, darwin] and arch in [x64, arm64].
match {
{ arch = 'Amd64, .. } =>
{
url = "%{gcs_bucket}/%{version}/linux-x64/claude",
sha256 = amd64_sha256,
} | Source,
{ arch = 'Arm64, .. } =>
{
url = "%{gcs_bucket}/%{version}/linux-arm64/claude",
sha256 = arm64_sha256,
} | Source,
} target,
],
runtime_deps = [
base,
coreutils,
findutils,
curl,
git,
glibc,
ripgrep,
openssh,
],
cmd = "./build.sh",
build_args = {
include version,
},
outputs = {
claude = { glob = "usr/bin/claude" } | OutputBin,
install = { glob = "usr/share/claude/versions/%{version}" } | OutputLib,
},
attrs =
{
upstream_version = version,
license_spdx = "LicenseRef-Anthropic-Proprietary",
binary_from = "https://storage.googleapis.com/claude-code-dist-86c565f3-f756-42ad-8dfa-d59b1c096819/claude-code-releases",
closed_source = true,
# Claude code wires `.claude.json`, which contains anthropic credentials for the user
env_file_mappings = [{ read_only = false, path = "~/.claude.json", class = 'Credential }],
} | Attrs,
} | BuildSpec