From 408c2149b3ff6858ef164e98359184ef28079fad Mon Sep 17 00:00:00 2001 From: Ophestra Date: Sat, 24 Oct 2026 15:11:46 +0900 Subject: internal/rosa/package/hakurei: enable additional cross-compilation For cross-compiling Rosa OS. Signed-off-by: Ophestra --- internal/rosa/package/hakurei.az | 25 ++++++++++++++++++++----- 1 file changed, 20 insertions(+), 5 deletions(-) (limited to 'internal') 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 -- cgit v1.3.1