-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathbuild.ncl
More file actions
177 lines (170 loc) · 6.55 KB
/
Copy pathbuild.ncl
File metadata and controls
177 lines (170 loc) · 6.55 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
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
let { standaloneTest, Attrs, BuildSpec, Local, OutputBin, OutputData, Source, Test, .. } = import "minimal.ncl" in
let { target, .. } = import "config.ncl" in
let base = import "../base/build.ncl" in
let unzip = import "../unzip/build.ncl" in
let bash = import "../bash/build.ncl" in
let glibc = import "../glibc/build.ncl" in
let gcc = import "../gcc/build.ncl" in
let alsa-lib = import "../alsa-lib/build.ncl" in
let cairo = import "../cairo/build.ncl" in
let cups = import "../cups/build.ncl" in
let dbus = import "../dbus/build.ncl" in
let expat = import "../expat/build.ncl" in
let fontconfig = import "../fontconfig/build.ncl" in
let freetype = import "../freetype/build.ncl" in
let fribidi = import "../fribidi/build.ncl" in
let glib = import "../glib/build.ncl" in
let harfbuzz = import "../harfbuzz/build.ncl" in
let libdrm = import "../libdrm/build.ncl" in
let libx11 = import "../libx11/build.ncl" in
let libxcb = import "../libxcb/build.ncl" in
let libxcomposite = import "../libxcomposite/build.ncl" in
let libxdamage = import "../libxdamage/build.ncl" in
let libxext = import "../libxext/build.ncl" in
let libxfixes = import "../libxfixes/build.ncl" in
let libxkbcommon = import "../libxkbcommon/build.ncl" in
let libxrandr = import "../libxrandr/build.ncl" in
let libxrender = import "../libxrender/build.ncl" in
let libxshmfence = import "../libxshmfence/build.ncl" in
let libxtst = import "../libxtst/build.ncl" in
let mesa = import "../mesa/build.ncl" in
let nss = import "../nss/build.ncl" in
let nspr = import "../nspr/build.ncl" in
let pango = import "../pango/build.ncl" in
let atk = import "../atk/build.ncl" in
let at-spi2-core = import "../at-spi2-core/build.ncl" in
let eudev = import "../eudev/build.ncl" in
let liberation-fonts = import "../liberation-fonts/build.ncl" in
# Prebuilt full chromium browser (headed mode), named with the
# Gentoo/AUR `-bin` convention. The headless-shell variant ships in a
# sibling pkg `chromium-headless-shell-bin` so consumers (and download
# size) only pay for the variant they need. Building chromium from
# source needs depot_tools, a hermetic clang toolchain, a ~30 GB git
# checkout, and 4-8 hours of build time — none of which is packaged.
# CLAUDE.md's "build from source" rule has an explicit carve-out for
# this case. The bare `chromium` name is intentionally left available
# for a future source-built pkg.
#
# Source mix — both legs are true open-source Chromium (BSD-3-Clause),
# deliberately NOT Chrome for Testing: CfT is a *branded Google Chrome*
# build governed by the Chrome ToS, which does not permit redistribution
# — and our binary cache redistributes (gominimal/inbox#284). Playwright
# itself stopped publishing its own linux-x64 Chromium (its registry now
# fetches CfT directly for x64), so:
# amd64 → Chromium's official snapshot bucket
# (chromium-browser-snapshots), pinned to `snapshot_position` — the
# main-branch position Chrome `browser_version` branched from
# (chromiumdash fetch_version), i.e. the same code the arm64 build
# was cut from, minus branch cherry-picks.
# arm64 → Playwright's own arm64 Chromium build on cdn.playwright.dev
# (Google publishes no linux-arm64; Playwright still builds arm64).
#
# `revision` is the Playwright browser-revision number from
# packages/playwright-core/browsers.json. Revision 1233 ↔ Chrome 151.0.7922.19
# ↔ playwright-core ^1.59. `snapshot_position` must be re-derived whenever
# `browser_version` bumps. Keep all three in lockstep with
# chromium-headless-shell-bin.
#
# Consumer note (Playwright): files are laid out under
# /usr/share/playwright-browsers/chromium-<rev>/ in Playwright's
# registry layout, so installing both this pkg and
# chromium-headless-shell-bin and setting
# `PLAYWRIGHT_BROWSERS_PATH=/usr/share/playwright-browsers` lets
# @playwright/test discover both binaries with zero further config —
# provided the installed playwright-core revision matches `revision`.
# If it doesn't, pass `executablePath: '/bin/chromium'` (or
# '/bin/chromium-headless-shell' from the headless-shell pkg) to
# bypass the registry lookup. See packages/chromium-bin/README.md.
let revision = "1233" in
let browser_version = "151.0.7922.34" in
let snapshot_position = "1654408" in
{
name = "chromium-bin",
build_deps = [
{ file = "build.sh" } | Local,
match {
{ arch = 'Amd64, .. } =>
{
url = "https://commondatastorage.googleapis.com/chromium-browser-snapshots/Linux_x64/%{snapshot_position}/chrome-linux.zip",
sha256 = "c094b77ad8d462bacd54769c5aa1fcd2e9d61f9b146796bbcded9276cdc40a5e",
} | Source,
{ arch = 'Arm64, .. } =>
{
url = "https://cdn.playwright.dev/dbazure/download/playwright/builds/chromium/%{revision}/chromium-linux-arm64.zip",
sha256 = "aacc401c41eb236aff88c8d2a2d2e8f4c5f67ffd5508339ce2542f8470f846f3",
} | Source,
} target,
base,
unzip,
],
runtime_deps = [
bash,
glibc,
gcc,
alsa-lib,
cairo,
cups,
dbus,
expat,
fontconfig,
freetype,
fribidi,
glib,
harfbuzz,
libdrm,
libx11,
libxcb,
libxcomposite,
libxdamage,
libxext,
libxfixes,
libxkbcommon,
libxrandr,
libxrender,
libxshmfence,
libxtst,
mesa,
nss,
nspr,
pango,
atk,
at-spi2-core,
eudev,
liberation-fonts,
],
cmd = "./build.sh",
build_args = {
include revision,
include browser_version,
},
outputs = {
bin = { glob = "usr/bin/chromium" } | OutputBin,
data = { glob = "usr/share/playwright-browsers/chromium-*/**", allow_executable = true } | OutputData,
},
attrs =
{
upstream_version = browser_version,
license_spdx = "BSD-3-Clause",
source_provenance = {
category = 'GithubRepo,
owner = "microsoft",
repo = "playwright",
},
binary_from =
match {
{ arch = 'Amd64, .. } => "https://commondatastorage.googleapis.com/chromium-browser-snapshots/Linux_x64/%{snapshot_position}/chrome-linux.zip",
{ arch = 'Arm64, .. } => "https://cdn.playwright.dev/dbazure/download/playwright/builds/chromium/%{revision}/chromium-linux-arm64.zip",
} target,
} | Attrs,
tests = {
smoketest = standaloneTest "/bin/chromium --version",
launch_check =
{
class = 'Standalone,
test_deps = [base],
cmds = [
["/bin/bash", "-c", "/bin/chromium --headless --no-sandbox --disable-gpu --disable-dev-shm-usage --dump-dom 'data:text/html,<title>chromium-launch-ok</title>' | grep -q chromium-launch-ok"],
],
} | Test,
},
} | BuildSpec