Merged in zhuowei/haikuports (pull request #204)

Add recipe for the Golang 1.3 port
This commit is contained in:
Augustin Cavalier
2014-08-16 08:55:01 -04:00

View File

@@ -0,0 +1,84 @@
SUMMARY="Reference compiler for the Go programming language."
DESCRIPTION="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."
HOMEPAGE="https://bitbucket.org/zhuowei/go-1-3-haiku"
# archived tar for this version
SRC_URI="https://bitbucket.org/zhuowei/go-1-3-haiku/downloads/golang-1.3-porthaiku2.tar.gz"
SOURCE_DIR="golang-1.3-porthaiku2"
CHECKSUM_SHA256="7ec832d47bf5080f579aa80f8f196bf0b8f60aa99718510e8028586255f716c7"
REVISION="1"
LICENSE="BSD (3-clause)"
COPYRIGHT="2009-2014 The Go Authors"
ARCHITECTURES="x86 x86_64"
if [ $effectiveTargetArchitecture != x86_gcc2 ]; then
# x86_gcc2 is fine as primary target architecture as long as we're building
# for a different secondary architecture.
ARCHITECTURES="$ARCHITECTURES x86_gcc2"
else
ARCHITECTURES="$ARCHITECTURES !x86_gcc2"
fi
SECONDARY_ARCHITECTURES="x86 x86_64"
PROVIDES="
golang$secondaryArchSuffix = $portVersion
cmd:go$secondaryArchSuffix = $portVersion
cmd:gofmt$secondaryArchSuffix = $portVersion
cmd:godoc$secondaryArchSuffix = $portVersion
"
if [ "$secondaryArchSuffix" != "" ]; then
PROVIDES="$PROVIDES
cmd:go = $portVersion
cmd:gofmt = $portVersion
cmd:godoc = $portVersion
"
fi
REQUIRES="
haiku$secondaryArchSuffix >= $haikuVersion
"
BUILD_REQUIRES="
haiku${secondaryArchSuffix}_devel >= $haikuVersion
"
BUILD_PREREQUIRES="
cmd:gcc$secondaryArchSuffix
cmd:hg
"
BUILD()
{
echo "1.3-porthaiku2" > VERSION
export GOROOT_FINAL=/system/develop/lib$secondaryArchSubDir/go
cd src
./make.bash
cd ..
export GOPATH=/tmp
export GOROOT=`pwd`
bin/go get code.google.com/p/go.tools/cmd/godoc
bin/go get code.google.com/p/go.tools/cmd/vet
}
INSTALL()
{
mkdir -p $developLibDir/go/
cp -r src pkg doc $developLibDir/go/
mkdir -p $binDir
cp bin/* $binDir/
if [ "$secondaryArchSuffix" != "" ]; then
cd $binDir/..
for a in `ls $binDir`
do
ln -s .$secondaryArchSubDir/$a $a
done
fi
}