diff options
author | Slack Coder <slackcoder@server.ky> | 2024-06-15 07:04:28 -0500 |
---|---|---|
committer | Slack Coder <slackcoder@server.ky> | 2024-06-15 07:03:23 -0500 |
commit | 71612b37e7e7511c7a3ef48288778975d6a9e656 (patch) | |
tree | cd1cfec846dece7b0904493670ef4b7056319ed5 | |
parent | f09803982cd8f8a1517301a8e90174bcbe224deb (diff) | |
download | slackbuilds-71612b37e7e7511c7a3ef48288778975d6a9e656.tar.xz |
golang: 1.22.4google-go-lang
-rw-r--r-- | google-go-lang/README | 58 | ||||
-rw-r--r-- | google-go-lang/google-go-lang.SlackBuild | 313 | ||||
-rw-r--r-- | google-go-lang/google-go-lang.info | 14 | ||||
-rw-r--r-- | google-go-lang/slack-desc | 19 |
4 files changed, 404 insertions, 0 deletions
diff --git a/google-go-lang/README b/google-go-lang/README new file mode 100644 index 0000000..0663187 --- /dev/null +++ b/google-go-lang/README @@ -0,0 +1,58 @@ +The Go programming language is an open source project to make +programmers more productive. Go is expressive, concise, clean, +and efficient. Its concurrency mechanisms make it easy to write +programs that get the most out of multicore and networked machines, +while its novel type system enables flexible and modular program +construction. Go compiles quickly to machine code yet has the +convenience of garbage collection and the power of run-time +reflection. It's a fast, statically typed, compiled language that +feels like a dynamically typed, interpreted language. + +The tools are added to the path by putting go.sh and go.csh files in +/etc/profile.d and letting the system's /etc/profile or /etc/csh.login +pick it up. If you want to add any of Go's environment variables you +can add them there. + +Also, to easily setup a user-independent path for Go libraries to +be installed to and used, is the GOPATH environment variable. This +variable can be colon delimited. For example, once installing the +built google-go-lang package, then set in your user's ~/.bashrc +something like: + + export GOPATH="$HOME" + +Then, you'll be able to use the `go` command to install an additional +library that will not need root permission and will be in the +compiler's path. Like so: + + go get golang.org/x/tools/cmd/godoc + +Now in ~/src you'll have this source code checked-out, and a binary +built at ~/bin/godoc + +Since the golang idiom is very `go get'able as a limited user, +installed libraries from slackbuilds.org are located outside of GOROOT +(which is only for golang standard library), in /usr/share/gocode By +not setting a system-wide GOPATH defaulting to this location, then +it is up to the user of whether to include this system path as well, +like: + + export GOPATH="$HOME:/usr/share/gocode" + +This system source directory is primarly only for buildtime of +slackbuilds. + +This is because `go get' iterates through the paths provided, looking +for matching imports. If a match is not found, then is cloned to the +first path provided. You would not want this to be a system path, as +to need root privilege to clone source. + +As of go1.2, the 'go doc ...' command has been relocated to the +go.tools library (golang-googlecode-gotools), which provide `godoc`. + +As of go1.5, shared libraries are now supported. The flags to use +linking are available for `go get`, `go install` and `go build`. +To learn more see `go help buildmode`. + +To elect to run the buildtime tests of this package, provide the +environment variable RUN_TEST=true at build time. diff --git a/google-go-lang/google-go-lang.SlackBuild b/google-go-lang/google-go-lang.SlackBuild new file mode 100644 index 0000000..5b7fb52 --- /dev/null +++ b/google-go-lang/google-go-lang.SlackBuild @@ -0,0 +1,313 @@ +#!/bin/bash + +# Slackware build script for google-go-lang + +# Written by Eric Schultz eric at schultzter.ca +# Taken over by Vincent Batts vbatts@hashbangbash.com + +# Copyright (c) 2012, 2013, 2014, 2015, 2016, 2017, 2018 Vincent Batts +# Copyright (c) 2012 Eric Schultz +# +# Permission is hereby granted, free of charge, to any person obtaining a copy of +# this software and associated documentation files (the "Software"), to deal in +# the Software without restriction, including without limitation the rights to +# use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of +# the Software, and to permit persons to whom the Software is furnished to do so, +# subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in all +# copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +# SOFTWARE. + +cd $(dirname $0) ; CWD=$(pwd) + +PRGNAM=google-go-lang +VERSION=${VERSION:-1.22.4} +BOOTSTRAP_VERSION=${BOOTSTRAP_VERSION:-1.19.13} +BOOTSTRAP_VERSION2=${BOOTSTRAP_VERSION2:-1.21.8} +BUILD=${BUILD:-1} +TAG=${TAG:-_SBo} +PKGTYPE=${PKGTYPE:-tgz} + +RELEASE=${RELEASE:-linux} + +RUN_TEST=${RUN_TEST:-false} + +if [ -z "$ARCH" ]; then + case "$( uname -m )" in + i?86) ARCH=i586 ;; + arm*) ARCH=arm ;; + *) ARCH=$( uname -m ) ;; + esac +fi + +if [ "$ARCH" = "i586" ]; then + LIBDIRSUFFIX="" + GOARCH="386" +elif [ "$ARCH" = "x86_64" ]; then + LIBDIRSUFFIX="64" + GOARCH="amd64" +elif [ "$ARCH" = "arm" ]; then + LIBDIRSUFFIX="" + GOARCH="arm" + export GOARM="7" # can be '5' as well, to use soft float instead of hard float +elif [ "$ARCH" = "aarch64" ]; then + LIBDIRSUFFIX="64" + GOARCH="arm64" +else + LIBDIRSUFFIX="" + GOARCH=386 +fi + +if [ ! -z "${PRINT_PACKAGE_NAME}" ]; then + echo "$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE" + exit 0 +fi + +TMP=${TMP:-/tmp/SBo} +PKG=$TMP/package-$PRGNAM +OUTPUT=${OUTPUT:-/tmp} + +set -e + +rm -rf $PKG + +CGO_MINOR_VERSION="$(/usr/bin/go version | awk '{ print $3 }' | sed 's/go//' | awk -F. '{ print $2 }')" +if [[ $CGO_MINOR_VERSION -lt 18 ]] ; then + mkdir -p $TMP $PKG/usr/lib${LIBDIRSUFFIX}/go${BOOTSTRAP_VERSION} $OUTPUT + cd $PKG/usr/lib${LIBDIRSUFFIX}/go${BOOTSTRAP_VERSION} + tar xvf $CWD/go${BOOTSTRAP_VERSION}.src.tar.gz + cd go + chown -R root:root . + find -L . \ + \( -perm 777 -o -perm 775 -o -perm 750 -o -perm 711 -o -perm 555 \ + -o -perm 511 \) -exec chmod 755 {} \; -o \ + \( -perm 666 -o -perm 664 -o -perm 640 -o -perm 600 -o -perm 444 \ + -o -perm 440 -o -perm 400 \) -exec chmod 644 {} \; + + # as of >= go1.5, the cross-compiler does not need to be bootstrap, so the + # compiler need only be compiled for the host OS, which it detects + unset GOBIN GOPATH GOOS GOARCH + + # Not sure why, but this causes run.bash to fail --rworkman + unset BASH_ENV + + # gcc 5+ is go1.4 API, so we'll bootstrap with it + export GOROOT_BOOTSTRAP="/usr" + + # Default GOROOT is the parent directory of all.bash, + # which is the current directory we're in. + # Defining it here means we can use it below when building + # shared libraries + GOROOT="$(pwd)" + export GOROOT + + # The value of GOROOT once the package is installed + export GOROOT_FINAL="/usr/lib${LIBDIRSUFFIX}/go${BOOTSTRAP_VERSION}/go" + + case "$ARCH" in + arm|i?86) export GOMAXPROCS=1 ;; + esac + + cd src + + if [[ "${RUN_TEST}" = "true" ]] ; then + LC_ALL=C \ + ./all.bash + else + LC_ALL=C \ + ./make.bash + fi + + # As of go1.5, golang supports shared libraries, so generate them for use. + $GOROOT/bin/go install -buildmode=shared std + + cd .. + + # remove Go build cache + rm -rf pkg/obj/go-build/* + + # remove the doc Makefile + rm -f doc/Makefile + + mkdir -p $PKG$GOROOT_FINAL +fi + +if [[ $CGO_MINOR_VERSION -lt 20 ]] ; then + mkdir -p $TMP $PKG/usr/lib${LIBDIRSUFFIX}/go${BOOTSTRAP_VERSION2} $OUTPUT + cd $PKG/usr/lib${LIBDIRSUFFIX}/go${BOOTSTRAP_VERSION2} + tar xvf $CWD/go${BOOTSTRAP_VERSION2}.src.tar.gz + cd go + chown -R root:root . + find -L . \ + \( -perm 777 -o -perm 775 -o -perm 750 -o -perm 711 -o -perm 555 \ + -o -perm 511 \) -exec chmod 755 {} \; -o \ + \( -perm 666 -o -perm 664 -o -perm 640 -o -perm 600 -o -perm 444 \ + -o -perm 440 -o -perm 400 \) -exec chmod 644 {} \; + + # as of >= go1.5, the cross-compiler does not need to be bootstrap, so the + # compiler need only be compiled for the host OS, which it detects + unset GOBIN GOPATH GOOS GOARCH + + # Not sure why, but this causes run.bash to fail --rworkman + unset BASH_ENV + + # gcc 5+ is go1.4 API, so we'll bootstrap with it + if [[ $CGO_MINOR_VERSION -lt 18 ]] ; then + export GOROOT_BOOTSTRAP="$PKG/usr/lib${LIBDIRSUFFIX}/go${BOOTSTRAP_VERSION}/go" + else + export GOROOT_BOOTSTRAP="/usr" + fi + + # Default GOROOT is the parent directory of all.bash, + # which is the current directory we're in. + # Defining it here means we can use it below when building + # shared libraries + GOROOT="$(pwd)" + export GOROOT + + # The value of GOROOT once the package is installed + export GOROOT_FINAL="/usr/lib${LIBDIRSUFFIX}/go${BOOTSTRAP_VERSION2}/go" + + case "$ARCH" in + arm|i?86) export GOMAXPROCS=1 ;; + esac + + cd src + + if [[ "${RUN_TEST}" = "true" ]] ; then + LC_ALL=C \ + ./all.bash + else + LC_ALL=C \ + ./make.bash + fi + + # As of go1.5, golang supports shared libraries, so generate them for use. + $GOROOT/bin/go install -buildmode=shared std + + cd .. + + # remove Go build cache + rm -rf pkg/obj/go-build/* + + # remove the doc Makefile + rm -f doc/Makefile + + mkdir -p $PKG$GOROOT_FINAL +fi + +# remove bootstrap +if [[ $CGO_MINOR_VERSION -lt 18 ]] ; then + rm -rf $PKG/usr/lib$LIBDIRSUFFIX/go$BOOTSTRAP_VERSION +fi + +mkdir -p $PKG/usr/lib${LIBDIRSUFFIX}/go${VERSION} $OUTPUT +cd $PKG/usr/lib${LIBDIRSUFFIX}/go${VERSION} +tar xvf $CWD/go${VERSION}.src.tar.gz +cd go +chown -R root:root . +find -L . \ + \( -perm 777 -o -perm 775 -o -perm 750 -o -perm 711 -o -perm 555 \ + -o -perm 511 \) -exec chmod 755 {} \; -o \ + \( -perm 666 -o -perm 664 -o -perm 640 -o -perm 600 -o -perm 444 \ + -o -perm 440 -o -perm 400 \) -exec chmod 644 {} \; + +# as of >= go1.5, the cross-compiler does not need to be bootstrap, so the +# compiler need only be compiled for the host OS, which it detects +unset GOBIN GOPATH GOOS GOARCH + +# Not sure why, but this causes run.bash to fail --rworkman +unset BASH_ENV + +# gcc 5+ is go1.4 API, so we'll bootstrap with it +if [[ $CGO_MINOR_VERSION -lt 20 ]] ; then + export GOROOT_BOOTSTRAP="$PKG/usr/lib${LIBDIRSUFFIX}/go${BOOTSTRAP_VERSION2}/go" +else + export GOROOT_BOOTSTRAP="/usr" +fi + +# Default GOROOT is the parent directory of all.bash, +# which is the current directory we're in. +# Defining it here means we can use it below when building +# shared libraries +GOROOT="$(pwd)" +export GOROOT + +# The value of GOROOT once the package is installed +export GOROOT_FINAL="/usr/lib${LIBDIRSUFFIX}/go${VERSION}/go" + +case "$ARCH" in + arm|i?86) export GOMAXPROCS=1 ;; +esac + +cd src + +if [[ "${RUN_TEST}" = "true" ]] ; then + LC_ALL=C \ + ./all.bash +else + LC_ALL=C \ + ./make.bash +fi + +# As of go1.5, golang supports shared libraries, so generate them for use. +$GOROOT/bin/go install -buildmode=shared std + +find $PKG/$GOROOT_FINAL -print0 | xargs -0 file | grep -e "executable" -e "shared object" | grep ELF \ + | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null || true +find $PKG/$GOROOT_FINAL -type f -name "*.so" -exec chmod +x {} \; 2> /dev/null || true + +cd .. + +# remove Go build cache +rm -rf pkg/obj/go-build/* + +# remove the doc Makefile +rm -f doc/Makefile + +# remove tests, nothing needs these at runtime +find $PKG/$GOROOT_FINAL/src -type d -name "testdata" -exec rm -rf {} + +find $PKG/$GOROOT_FINAL/src -type f -name "*_test.go" -exec rm -rf {} + + +mkdir -p $PKG$GOROOT_FINAL + +# remove bootstrap +if [[ $CGO_MINOR_VERSION -lt 20 ]] ; then + rm -rf $PKG/usr/lib$LIBDIRSUFFIX/go$BOOTSTRAP_VERSION2 +fi + +# Put the profile scripts for setting PATH and env variables +mkdir -p $PKG/etc/profile.d +cat > $PKG/etc/profile.d/go.csh << EOF +#!/bin/csh +setenv GOROOT ${GOROOT_FINAL} +setenv PATH \${GOROOT}/bin:\${PATH} +EOF +cat > $PKG/etc/profile.d/go.sh << EOF +#!/bin/sh +export GOROOT="${GOROOT_FINAL}" +export PATH="\${GOROOT}/bin:\${PATH}" +EOF + +chmod 0755 $PKG/etc/profile.d/go.csh +chmod 0755 $PKG/etc/profile.d/go.sh + +mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION +cp -a \ + CONTRIBUTING.md LICENSE PATENTS README.md SECURITY.md VERSION \ + $PKG/usr/doc/$PRGNAM-$VERSION +cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild + +mkdir -p $PKG/install +cat $CWD/slack-desc > $PKG/install/slack-desc + +cd $PKG +/sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE diff --git a/google-go-lang/google-go-lang.info b/google-go-lang/google-go-lang.info new file mode 100644 index 0000000..2e0d5da --- /dev/null +++ b/google-go-lang/google-go-lang.info @@ -0,0 +1,14 @@ +PRGNAM="google-go-lang" +VERSION="1.22.4" +HOMEPAGE="http://golang.org" +DOWNLOAD="https://storage.googleapis.com/golang/go1.22.4.src.tar.gz \ + https://storage.googleapis.com/golang/go1.21.8.src.tar.gz \ + https://storage.googleapis.com/golang/go1.19.13.src.tar.gz" +MD5SUM="f0065e733afc3fe13587a743cd9aefb9 \ + 02711c04f9fbe4087ab54805458a2a9d \ + 6d3625cac26503932002b98eae2d0001" +DOWNLOAD_x86_64="" +MD5SUM_x86_64="" +REQUIRES="" +MAINTAINER="Vincent Batts" +EMAIL="vbatts@hashbangbash.com" diff --git a/google-go-lang/slack-desc b/google-go-lang/slack-desc new file mode 100644 index 0000000..84d7e1d --- /dev/null +++ b/google-go-lang/slack-desc @@ -0,0 +1,19 @@ +# HOW TO EDIT THIS FILE: +# The "handy ruler" below makes it easier to edit a package description. +# Line up the first '|' above the ':' following the base package name, and +# the '|' on the right side marks the last column you can put a character in. +# You must make exactly 11 lines for the formatting to be correct. It's also +# customary to leave one space after the ':' except on otherwise blank lines. + + |-----handy-ruler------------------------------------------------------| +google-go-lang: google-go-lang (Google's Go Language kit with gc tool chain) +google-go-lang: +google-go-lang: The Go programming language is an open source project to make +google-go-lang: programmers more productive. Go is expressive, concise, clean, and +google-go-lang: efficient. Its concurrency mechanisms make it easy to write programs +google-go-lang: that get the most out of multicore and networked machines, while its +google-go-lang: novel type system enables flexible and modular program construction. +google-go-lang: +google-go-lang: +google-go-lang: +google-go-lang: |