diff options
| author | Ophestra <cat@gensokyo.uk> | 2026-11-11 21:59:18 +0900 |
|---|---|---|
| committer | Ophestra <cat@gensokyo.uk> | 2026-11-12 12:44:39 +0900 |
| commit | ac4cec1625da50d6abd9fca40446e7f75aa5bd37 (patch) | |
| tree | 22b3789634008a43277952abea766be4f278e4f7 /internal/rosa/package/hakurei.az | |
| parent | e28bac0fe480c065e653b847d1b54f3e3d712156 (diff) | |
internal/rosa: set common cross-compile environment
This change avoids duplicating this piece of code all over the place.
Signed-off-by: Ophestra <cat@gensokyo.uk>
Diffstat (limited to 'internal/rosa/package/hakurei.az')
| -rw-r--r-- | internal/rosa/package/hakurei.az | 21 |
1 files changed, 6 insertions, 15 deletions
diff --git a/internal/rosa/package/hakurei.az b/internal/rosa/package/hakurei.az index 8041d380..7e71ae72 100644 --- a/internal/rosa/package/hakurei.az +++ b/internal/rosa/package/hakurei.az @@ -19,6 +19,7 @@ package hakurei { enterSource = true; writable = true; chmod = true; + ccommon = true; env = [ "CGO_ENABLED=1", @@ -28,12 +29,7 @@ package hakurei { exec = generic { chdir = false; - cross = ` -export CC='clang --target=`+triple+` --sysroot=`+prefix+`/`+arch+`' -export CXX='clang++ --target=`+triple+` --sysroot=`+prefix+`/`+arch+`' -export PKG_CONFIG_SYSROOT_DIR='`+prefix+`/`+arch+`' -export PKG_CONFIG_LIBDIR='`+prefix+`/`+arch+prefix+`/lib/pkgconfig:`+prefix+`/`+arch+prefix+`/share/pkgconfig' -`; + cross = "\x00"; build = ` mkdir -p /work`+prefix+`/bin/ @@ -57,8 +53,7 @@ GOARCH='`+arch+`' CGO_ENABLED=0 go build -trimpath -tags=rosa -o /work`+prefix+` default = ` echo echo '##### Testing hakurei.' -go test -ldflags='-buildid= -linkmode external -extldflags=-static' ./... -echo`; +go test -ldflags='-buildid= -linkmode external -extldflags=-static' ./...`; cross = unset; }; install = ` @@ -97,6 +92,7 @@ package hakurei-dist { enterSource = true; writable = true; chmod = true; + ccommon = true; env = [ "CGO_ENABLED=1", @@ -107,11 +103,9 @@ package hakurei-dist { exec = generic { chdir = false; cross = ` +unset CC CXX export HAKUREI_ARCH='`+arch+`' export HAKUREI_SYSROOT='`+prefix+`/`+arch+`' - -export PKG_CONFIG_SYSROOT_DIR='`+prefix+`/`+arch+`' -export PKG_CONFIG_LIBDIR='`+prefix+`/`+arch+prefix+`/lib/pkgconfig:`+prefix+`/`+arch+``+prefix+`/share/pkgconfig' `; build = ` NAME=make`; @@ -201,6 +195,7 @@ package earlyinit { enterSource = true; writable = true; chmod = true; + ccommon = true; env = [ "CGO_ENABLED=1", @@ -212,10 +207,6 @@ package earlyinit { chdir = false; cross = ` export GOARCH='`+arch+`' -export CC='clang --target=`+triple+` --sysroot=`+prefix+`/`+arch+`' -export CXX='clang++ --target=`+triple+` --sysroot=`+prefix+`/`+arch+`' -export PKG_CONFIG_SYSROOT_DIR='`+prefix+`/`+arch+`' -export PKG_CONFIG_LIBDIR='`+prefix+`/`+arch+prefix+`/lib/pkgconfig:`+prefix+`/`+arch+prefix+`/share/pkgconfig' `; build = ` go build -trimpath -o /work/ -ldflags="-s -w |
