diff options
| author | Ophestra <cat@gensokyo.uk> | 2026-10-24 15:11:46 +0900 |
|---|---|---|
| committer | Ophestra <cat@gensokyo.uk> | 2026-10-24 15:11:46 +0900 |
| commit | 408c2149b3ff6858ef164e98359184ef28079fad (patch) | |
| tree | b9c86f9617e5ca9f57057fe9e6fa0dc318fb584e /internal | |
| parent | e1d23fab1c7e3b9edcd23676cd2a141b7d9713a9 (diff) | |
internal/rosa/package/hakurei: enable additional cross-compilationstaging
For cross-compiling Rosa OS.
Signed-off-by: Ophestra <cat@gensokyo.uk>
Diffstat (limited to 'internal')
| -rw-r--r-- | internal/rosa/package/hakurei.az | 25 |
1 files changed, 20 insertions, 5 deletions
diff --git a/internal/rosa/package/hakurei.az b/internal/rosa/package/hakurei.az index 04d6078f..90fe016b 100644 --- a/internal/rosa/package/hakurei.az +++ b/internal/rosa/package/hakurei.az @@ -28,12 +28,18 @@ package hakurei { exec = generic { chdir = false; + cross = ` +export CC='clang --target=`+triple+` --sysroot=/system/`+arch+`' +export CXX='clang++ --target=`+triple+` --sysroot=/system/`+arch+`' +export PKG_CONFIG_SYSROOT_DIR='/system/`+arch+`' +export PKG_CONFIG_LIBDIR='/system/`+arch+`/system/lib/pkgconfig:/system/`+arch+`/system/share/pkgconfig' +`; build = ` mkdir -p /work/system/libexec/hakurei/ -echo "Building hakurei for $(go env GOOS)/$(go env GOARCH)." +echo "Building hakurei for $(go env GOOS)/`+arch+`." go generate ./... -go build -trimpath -tags=rosa -o /work/system/libexec/hakurei -ldflags="-s -w +GOARCH='`+arch+`' go build -trimpath -tags=rosa -o /work/system/libexec/hakurei -ldflags="-s -w -buildid= -linkmode external -extldflags=-static @@ -43,12 +49,12 @@ go build -trimpath -tags=rosa -o /work/system/libexec/hakurei -ldflags="-s -w " ./cmd/hakurei ./cmd/sharefs echo "Building hsu for $(go env GOOS)/$(go env GOARCH)." -CGO_ENABLED=0 go build -trimpath -tags=rosa -o /work/system/libexec/hakurei -ldflags="-s -w +GOARCH='`+arch+`' CGO_ENABLED=0 go build -trimpath -tags=rosa -o /work/system/libexec/hakurei -ldflags="-s -w -buildid= -X main.hakureiPath=/system/bin/hakurei -" ./cmd/hsu -echo`; +" ./cmd/hsu`; check = ` +echo echo '##### Testing hakurei.' go test -ldflags='-buildid= -linkmode external -extldflags=-static' ./... echo`; @@ -66,6 +72,8 @@ mkdir -p /work/system/bin/ pkgconf, net-tools, acl, + wayland, + wayland-protocols, ]; inputs = [ @@ -203,6 +211,13 @@ package earlyinit { exec = generic { chdir = false; + cross = ` +export GOARCH='`+arch+`' +export CC='clang --target=`+triple+` --sysroot=/system/`+arch+`' +export CXX='clang++ --target=`+triple+` --sysroot=/system/`+arch+`' +export PKG_CONFIG_SYSROOT_DIR='/system/`+arch+`' +export PKG_CONFIG_LIBDIR='/system/`+arch+`/system/lib/pkgconfig:/system/`+arch+`/system/share/pkgconfig' +`; build = ` echo '# Building earlyinit.' go build -trimpath -v -o /work/ -ldflags="-s -w |
