aboutsummaryrefslogtreecommitdiffhomepage
path: root/internal/rosa/package/hakurei.az
diff options
context:
space:
mode:
authorOphestra <cat@gensokyo.uk>2026-10-28 03:05:09 +0900
committerOphestra <cat@gensokyo.uk>2026-10-28 04:12:42 +0900
commit53e9dd6aa933c1a5b43da83a88d5e07bf27285bf (patch)
tree75d23f52901368c2e9764df631d37b8eb7484723 /internal/rosa/package/hakurei.az
parent7e3ba55cdc4d4a7c19deb65879e8abbb12a8e458 (diff)
internal/rosa: do not hard code prefix
This allows the prefix to be changed, at runtime if needed. Signed-off-by: Ophestra <cat@gensokyo.uk>
Diffstat (limited to 'internal/rosa/package/hakurei.az')
-rw-r--r--internal/rosa/package/hakurei.az38
1 files changed, 19 insertions, 19 deletions
diff --git a/internal/rosa/package/hakurei.az b/internal/rosa/package/hakurei.az
index acb356f4..a9283d96 100644
--- a/internal/rosa/package/hakurei.az
+++ b/internal/rosa/package/hakurei.az
@@ -29,29 +29,29 @@ 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'
+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 = `
-mkdir -p /work/system/libexec/hakurei/
+mkdir -p /work`+prefix+`/libexec/hakurei/
echo "Building hakurei for $(go env GOOS)/`+arch+`."
go generate ./...
-GOARCH='`+arch+`' go build -trimpath -tags=rosa -o /work/system/libexec/hakurei -ldflags="-s -w
+GOARCH='`+arch+`' go build -trimpath -tags=rosa -o /work`+prefix+`/libexec/hakurei -ldflags="-s -w
-buildid=
-linkmode external
-extldflags=-static
-X hakurei.app/internal/info.buildVersion=$(cat cmd/dist/VERSION)
- -X hakurei.app/internal/info.hakureiPath=/system/bin/hakurei
- -X hakurei.app/internal/info.hsuPath=/system/bin/hsu
+ -X hakurei.app/internal/info.hakureiPath=`+prefix+`/bin/hakurei
+ -X hakurei.app/internal/info.hsuPath=`+prefix+`/bin/hsu
" ./cmd/hakurei ./cmd/sharefs
echo "Building hsu for $(go env GOOS)/$(go env GOARCH)."
-GOARCH='`+arch+`' 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`+prefix+`/libexec/hakurei -ldflags="-s -w
-buildid=
- -X main.hakureiPath=/system/bin/hakurei
+ -X main.hakureiPath=`+prefix+`/bin/hakurei
" ./cmd/hsu`;
check = `
echo
@@ -59,8 +59,8 @@ echo '##### Testing hakurei.'
go test -ldflags='-buildid= -linkmode external -extldflags=-static' ./...
echo`;
install = `
-mkdir -p /work/system/bin/
-(cd /work/system/libexec/hakurei && mv \
+mkdir -p /work`+prefix+`/bin/
+(cd /work`+prefix+`/libexec/hakurei && mv \
hakurei \
sharefs \
../../bin/)
@@ -109,10 +109,10 @@ package hakurei-dist {
chdir = false;
cross = `
export HAKUREI_ARCH='`+arch+`'
-export HAKUREI_SYSROOT='/system/`+arch+`'
+export HAKUREI_SYSROOT='`+prefix+`/`+arch+`'
-export PKG_CONFIG_SYSROOT_DIR='/system/`+arch+`'
-export PKG_CONFIG_LIBDIR='/system/`+arch+`/system/lib/pkgconfig:/system/`+arch+`/system/share/pkgconfig'
+export PKG_CONFIG_SYSROOT_DIR='`+prefix+`/`+arch+`'
+export PKG_CONFIG_LIBDIR='`+prefix+`/`+arch+``+prefix+`/lib/pkgconfig:`+prefix+`/`+arch+``+prefix+`/share/pkgconfig'
`;
build = `
NAME=make`;
@@ -213,10 +213,10 @@ package earlyinit {
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'
+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 = `
echo '# Building earlyinit.'