build-style: use XBPS_MAKEJOBS to set go processes
Clean up some minor unnecessary bashisms, and an unquoted variable.
This commit is contained in:
parent
a32236ab19
commit
5e35764d3f
2 changed files with 14 additions and 9 deletions
|
@ -12,31 +12,31 @@ do_configure() {
|
|||
# This isn't really configuration, but its needed by packages
|
||||
# that do unusual things with the build where the expect to be
|
||||
# able to cd into the $GOSRCPATH
|
||||
if [[ "${go_mod_mode}" != "off" ]] && [[ -f go.mod ]]; then
|
||||
if [ "${go_mod_mode}" != "off" ] && [ -f go.mod ]; then
|
||||
# Skip GOPATH symlink for Go modules
|
||||
msg_normal "Building $pkgname using Go modules.\n"
|
||||
elif [[ "${go_get}" != "yes" ]]; then
|
||||
elif [ "${go_get}" != "yes" ]; then
|
||||
mkdir -p ${GOSRCPATH%/*}/
|
||||
ln -fs $PWD "${GOSRCPATH}"
|
||||
ln -fs "$PWD" "${GOSRCPATH}"
|
||||
fi
|
||||
}
|
||||
|
||||
do_build() {
|
||||
go_package=${go_package:-$go_import_path}
|
||||
# Build using Go modules if there's a go.mod file
|
||||
if [[ "${go_mod_mode}" != "off" ]] && [[ -f go.mod ]]; then
|
||||
if [[ -z "${go_mod_mode}" ]] && [[ -d vendor ]]; then
|
||||
if [ "${go_mod_mode}" != "off" ] && [ -f go.mod ]; then
|
||||
if [ -z "${go_mod_mode}" ] && [ -d vendor ]; then
|
||||
msg_normal "Using vendor dir for $pkgname Go dependencies.\n"
|
||||
go_mod_mode=vendor
|
||||
elif [[ "${go_mod_mode}" = "default" ]]; then
|
||||
elif [ "${go_mod_mode}" = "default" ]; then
|
||||
# Allow templates to explicitly opt into the go tool's
|
||||
# default behavior.
|
||||
go_mod_mode=
|
||||
fi
|
||||
go install -mod="${go_mod_mode}" -x -tags "${go_build_tags}" -ldflags "${go_ldflags}" ${go_package}
|
||||
go install -p "$XBPS_MAKEJOBS" -mod="${go_mod_mode}" -x -tags "${go_build_tags}" -ldflags "${go_ldflags}" ${go_package}
|
||||
else
|
||||
# Otherwise, build using GOPATH
|
||||
go get -x -tags "${go_build_tags}" -ldflags "${go_ldflags}" ${go_package}
|
||||
go get -p "$XBPS_MAKEJOBS" -x -tags "${go_build_tags}" -ldflags "${go_ldflags}" ${go_package}
|
||||
fi
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue