|
| 1 | +let { standaloneTest, subsetOf, Attrs, BuildSpec, Local, OutputBin, Source, Test, .. } = import "minimal.ncl" in |
| 2 | +let base = import "../base/build.ncl" in |
| 3 | +let python = import "../python/build.ncl" in |
| 4 | +let ninja = import "../ninja/build.ncl" in |
| 5 | +let toolchain = import "../toolchain/build.ncl" in |
| 6 | + |
| 7 | +let glibc = import "../glibc/build.ncl" in |
| 8 | +let gcc = import "../gcc/build.ncl" in |
| 9 | + |
| 10 | +# gn — Google's meta-build system generator (generates ninja files). |
| 11 | +# Packaged as a chromium-from-source build prerequisite (pkgmgr-rs#681): |
| 12 | +# the official chromium tarball ships only an x86-64 prebuilt gn, so the |
| 13 | +# arm64 build needs a system gn either way, and a package beats |
| 14 | +# re-bootstrapping it inside every chromium build. |
| 15 | +# |
| 16 | +# Versioning: upstream has NO releases or tags beyond `initial-commit`; |
| 17 | +# its version IS the commit position — `gn --version` prints |
| 18 | +# "<position> (<12-char sha>)", derived from `git describe`. We follow |
| 19 | +# Gentoo's scheme: version 0.<position>. Source is a `git archive` of |
| 20 | +# that commit mirrored to gs:// — gitiles' own /+archive/ tarballs are |
| 21 | +# generated on the fly and NOT byte-stable, so they can never be |
| 22 | +# sha256-pinned directly. Bumping = new archive from a newer commit, |
| 23 | +# update `version` here AND the position/sha pinned in build.sh. |
| 24 | +# |
| 25 | +# ⚠ Version-tracking: update-dark for now. Upstream is |
| 26 | +# gn.googlesource.com (no provenance category fits), and repology's |
| 27 | +# `gn` project is all-`noscheme` (each distro invents its own scheme: |
| 28 | +# dates, short hashes, positions) so `repology_project` would propose |
| 29 | +# garbage. The clean fix is a curated NAME_KEYED_VERSION_CHECK entry in |
| 30 | +# pkgmgr-rs reading the gitiles API for the latest commit position — |
| 31 | +# tracked as a follow-up on pkgmgr-rs#681. |
| 32 | +let version = "0.2511" in |
| 33 | +{ |
| 34 | + name = "gn", |
| 35 | + build_deps = [ |
| 36 | + { file = "build.sh" } | Local, |
| 37 | + { |
| 38 | + url = "gs://minimal-staging-archives/gn/gn/%{version}.tar.gz", |
| 39 | + sha256 = "3e85ceeb08cdb563a5db995175f9e5173a337f7e0b4822078f514a0bb7c991bf", |
| 40 | + extract = true, |
| 41 | + strip_prefix = "gn-%{version}", |
| 42 | + } | Source, |
| 43 | + base, |
| 44 | + python, |
| 45 | + ninja, |
| 46 | + toolchain, |
| 47 | + ], |
| 48 | + runtime_deps = [ |
| 49 | + glibc, |
| 50 | + subsetOf gcc ["libstdcpp"], |
| 51 | + ], |
| 52 | + |
| 53 | + cmd = "./build.sh", |
| 54 | + |
| 55 | + outputs = { |
| 56 | + gn = { glob = "usr/bin/gn" } | OutputBin, |
| 57 | + }, |
| 58 | + |
| 59 | + attrs = |
| 60 | + { |
| 61 | + upstream_version = version, |
| 62 | + license_spdx = "BSD-3-Clause", |
| 63 | + } | Attrs, |
| 64 | + |
| 65 | + tests = { |
| 66 | + # Pins the version header wired in build.sh: `gn --version` must |
| 67 | + # print the pinned commit position, not 0 (UNKNOWN) — the tarball |
| 68 | + # has no .git, so a silent fallback would ship a gn that lies about |
| 69 | + # what it is. |
| 70 | + smoketest = |
| 71 | + { |
| 72 | + class = 'Standalone, |
| 73 | + test_deps = [base], |
| 74 | + cmds = [ |
| 75 | + ["/bin/bash", "-c", "/bin/gn --version | grep -q '^2511 '"], |
| 76 | + ], |
| 77 | + } | Test, |
| 78 | + }, |
| 79 | +} | BuildSpec |
0 commit comments