Update source.sh script

This commit is contained in:
2025-12-10 12:22:11 +02:00
parent b402b76c77
commit 52ef73d59a
2 changed files with 22 additions and 14 deletions
+1 -1
View File
@@ -1,7 +1,7 @@
name: golang name: golang
description: The GO programming language description: The GO programming language
version: 1.25.5 version: 1.25.5
revision: 1 revision: 2
url: https://go.dev/ url: https://go.dev/
license: BSD-3-Clause license: BSD-3-Clause
architecture: any architecture: any
+21 -13
View File
@@ -6,10 +6,13 @@
# This function is used to compile the source code # This function is used to compile the source code
build() { build() {
cd src cd src
# Set variables for compilation
export GOOS=linux export GOOS=linux
export GOARCH=amd64 export GOARCH=amd64
export GOROOT_FINAL=/usr/lib/go export GOROOT_FINAL=/usr/lib/go
export GOROOT_BOOTSTRAP=/usr/lib/go [ -z "$GOROOT_BOOTSTRAP" ] && export GOROOT_BOOTSTRAP=/usr/lib/go
./make.bash -v ./make.bash -v
} }
@@ -17,6 +20,7 @@ build() {
# This function is used to run tests to verify the package has been compiled correctly # This function is used to run tests to verify the package has been compiled correctly
check() { check() {
cd src cd src
export GO_TEST_TIMEOUT_SCALE=3 export GO_TEST_TIMEOUT_SCALE=3
./run.bash --no-rebuild -v -v -v -k -run "!cmd/cgo/internal/testsanitizers" ./run.bash --no-rebuild -v -v -v -k -run "!cmd/cgo/internal/testsanitizers"
} }
@@ -24,22 +28,26 @@ check() {
# The package function is executed in the source directory # The package function is executed in the source directory
# This function is used to move the compiled files into the output directory # This function is used to move the compiled files into the output directory
package() { package() {
install -d "${BPM_OUTPUT}/usr/bin" "${BPM_OUTPUT}/usr/lib/go" "${BPM_OUTPUT}/usr/share/doc/go" \ install -d "$BPM_OUTPUT"/usr/bin \
"${BPM_OUTPUT}/usr/lib/go/pkg/linux_amd64_"{dynlink,race} "$BPM_OUTPUT"/usr/lib/go \
"$BPM_OUTPUT"/usr/share/doc/go \
"$BPM_OUTPUT"/usr/lib/go/pkg/linux_amd64_{dynlink,race}
cp -a bin pkg src lib misc api test "${BPM_OUTPUT}/usr/lib/go" cp -a bin pkg src lib misc api test "${BPM_OUTPUT}/usr/lib/go"
cp -r doc/* "${BPM_OUTPUT}/usr/share/doc/go" install -Dm644 go.env "$BPM_OUTPUT"/usr/lib/go/go.env
install -Dm644 VERSION "$BPM_OUTPUT"/usr/lib/go/VERSION
ln -sf /usr/lib/go/bin/go "${BPM_OUTPUT}/usr/bin/go" # Symlink go binaries to usr/bin
ln -sf /usr/lib/go/bin/gofmt "${BPM_OUTPUT}/usr/bin/gofmt" ln -sf /usr/lib/go/bin/go "$BPM_OUTPUT"/usr/bin/go
ln -sf /usr/share/doc/go "${BPM_OUTPUT}/usr/lib/go/doc" ln -sf /usr/lib/go/bin/gofmt "$BPM_OUTPUT"/usr/bin/gofmt
install -Dm644 VERSION "${BPM_OUTPUT}/usr/lib/go/VERSION" # Install documentation
cp -r doc/* "$BPM_OUTPUT"/usr/share/doc/go
ln -sf /usr/share/doc/go "$BPM_OUTPUT"/usr/lib/go/doc
rm -rf "${BPM_OUTPUT}/usr/lib/go/pkg/bootstrap" "${BPM_OUTPUT}/usr/lib/go/pkg/tool/*/api" # Remove unwanted directory
rm -rf "$BPM_OUTPUT"/usr/lib/go/pkg/bootstrap "$BPM_OUTPUT"/usr/lib/go/pkg/tool/*/api
install -Dm644 go.env "${BPM_OUTPUT}/usr/lib/go/go.env"
install -Dm644 LICENSE "${BPM_OUTPUT}/usr/share/licenses/go/LICENSE"
# Install package license
install -Dm644 "$BPM_SOURCE"/LICENSE "$BPM_OUTPUT"/usr/share/licenses/golang/LICENSE
} }