SliTaz Packages

Community Doc Forum Pro Shop Bugs Hg
.

Receipt for package "go"

# SliTaz package receipt.

PACKAGE="go"
VERSION="1.2.1"
CATEGORY="development"
SHORT_DESC="The Go programming language (R.Griesemer R.Pike K.Thompson)"
MAINTAINER="domcox@slitaz.org"
LICENSE="BSD"
WEB_SITE="https://golang.org/"
TARBALL="$PACKAGE$VERSION.src.tar.gz"
WGET_URL="https://github.com/golang/go/archive/go$VERSION.tar.gz"
TAGS="go"

DEPENDS=""
BUILD_DEPENDS="bash bison make ed wget"

current_version()
{
    wget -O - https://golang.org/dl 2>/dev/null | \
    sed '/go[0-9]/!d;/src/!d;s|.*/dl/go\(.*\).src.*".*|\1|;q'
}

# Rules to configure and make the package.
compile_rules()
{
    sed -i 's|gohostarch = "amd64"|gohostarch = "386"|' src/cmd/dist/unix.c
    cd $src/src

    # Setting up environnment before building go.
    # For more information, see: http://golang.org/doc/install/source

    # Go tree, binaries and scripts locations.
    export GOROOT_FINAL=/usr/lib/go

    # Support all x86 chips (Pentium MMX or later)
    # or optionaly only Pentium 4/Opteron/Athlon 64 or later.
    export GO386=387    # Pentium MMX or later
    # export GO386=sse2    # Pentium 4/Opteron/Athlon 64 or later

    # Target operating system (optional).
    export GOOS=linux

    # Target compilation architecture.
    case $ARCH in
        x86_64)
            # A mature implementation. The compiler has an effective optimizer
            # (registerizer) and generates good code (although gccgo can do
            # noticeably better sometimes).
            export GOARCH="amd64" ;;

        i486)
            # Comparable to the amd64
            export GOARCH="386" ;;

        arm)
            # Supports Linux, FreeBSD and NetBSD binaries. Less widely used
            # than the other ports.
            export GOARCH="arm"
            # ARM11 (VFPv1) or better cores + cross-compiling.
            export GOARM=6 ;;
    esac

    # Build go
    /bin/bash make.bash --no-banner
}

# Rules to gen a SliTaz package suitable for Tazpkg.
genpkg_rules()
{
    mkdir -p $fs/usr/lib/go/src
    # bin
    cp -a $src/bin $fs/usr
    # go tree
    cp -a $src/pkg $fs/usr/lib/go
    # lib
    cp -a $src/lib $fs/usr/lib/go
    # include
    cp -a $src/include $fs/usr/lib/go
    # pkg
    cp -a $src/src/pkg $fs/usr/lib/go/src
    cp -a $src/src/cmd $fs/usr/lib/go/src
    cp -a $src/src/lib9 $fs/usr/lib/go/src
}
6047 packages and 209931 files in current database (Wed Jun 26 15:35:30 2024)