sergio/takana
> Una distribución Linux construida con un laboratorio funcional y hermético en el > sótano, y una terminal mutable, clásica y anárquica en el piso de arriba — diseñada > desde el suelo para que una IA programadora entienda, modifique y co…
Etapa G: fuel-go-1 — primera tanda Go con importador automatizado
1# Importada de Alpine aports por `hammer import-alpine` (Etapa G). PUNTO DE PARTIDA — pero
2# YA trae los parches de musl de Alpine (lo que un import de nix pierde). Pendiente: el
3# sha256 del tarball (el wrapper lo calcula), y adaptar build/install del shell de abuild.
4name = "glab"
5version = "1.102.0"
6
7[source]
8tarball = "https://gitlab.com/gitlab-org/cli/-/archive/v1.102.0/cli-v1.102.0.tar.gz"
9# FIXME sha256: el wrapper lo calcula (Alpine publica sha512). sha512 de Alpine:
10# sha512 = "5015ecee3240514b135b0498183b9a912ad4b4fcdc7b1f06d62777904084aeece14ef585c5fee733b5cf5392a214d9b05fe7053b4c6dd21a38c9a3552e748b17"
11sha256 = "40b1ba91634c150c01358bf41dd7878621002a248a40e5d62926bdf64e89709a"
12patches = ["no-telemetry.patch"]
13
14[build]
15compiler = "zig-cc"
16target = "x86_64-linux-musl"
17link = "static"
18flags = []
19
20[build.phases]
21# de build() de Alpine (traducido; el lab provee $CBUILD/$CHOST — Etapa G Fase 3; revisá --shared para estático):
22compile = '''
23_abuild_phase() {
24# date seems a little broken to override
25 go build -ldflags "
26 -X main.debugMode=false
27 -X main.version=v1.102.0
28 -X main.buildDate=$(date -u "+%Y-%m-%d" ${SOURCE_DATE_EPOCH:+-d @$SOURCE_DATE_EPOCH})
29 -extldflags \"$LDFLAGS\"
30 " \
31 -o build/bin/glab \
32 ./cmd/glab/main.go
33
34 go run ./cmd/gen-docs/docs.go --manpage --path ./build/man
35
36 # XXX: When glab is run in fakeroot it segfaults for some reason
37 # on ppc64le. By generating the compilation files here we
38 # workaround that but we need to investigate why it segfaults in
39 # fakeroot eventually.
40 mkdir -p build/shell
41 build/bin/glab completion --shell bash > build/shell/bash.comp
42 build/bin/glab completion --shell zsh > build/shell/zsh.comp
43 build/bin/glab completion --shell fish > build/shell/fish.comp
44}
45_abuild_phase
46'''
47# de package() de Alpine (traducido $pkgdir→/out):
48install = '''
49_abuild_phase() {
50install -Dm755 build/bin/glab -t "/out"/usr/bin/
51
52 install -Dm644 build/man/*.1 -t "/out"/usr/share/man/man1/
53
54 install -Dm644 build/shell/bash.comp \
55 "/out"/usr/share/bash-completion/completions/glab.bash
56 install -Dm644 build/shell/zsh.comp \
57 "/out"/usr/share/zsh/site-functions/_glab
58 install -Dm644 build/shell/fish.comp \
59 "/out"/usr/share/fish/vendor_completions.d/glab.fish
60}
61_abuild_phase
62'''
63
64# depends de runtime de Alpine (NO build-deps): git