Created
January 9, 2014 18:03
-
-
Save benbjohnson/8338908 to your computer and use it in GitHub Desktop.
Cross Compile w/ drone.io
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# This is what I have so far. The Go 1.2 installation doesn't seem to be correct so it's still breaking. | |
rm -rf /usr/local/go/src/pkg/appengine | |
rm -rf /usr/local/go/src/pkg/appengine_internal | |
rm /usr/local/go/src/pkg/os/error_posix.go | |
wget -O golang-crosscompile-master.zip https://github.com/davecheney/golang-crosscompile/archive/master.zip | |
unzip golang-crosscompile-master.zip | |
source golang-crosscompile-master/crosscompile.bash | |
go-crosscompile-build darwin/amd64 | |
go-crosscompile-build windows/amd64 | |
go-linux-amd64 build -o megajson | |
gzip megajson > megajson-linux-amd64.gz | |
go-darwin-amd64 build | |
gzip megajson > megajson-darwin-amd64.gz | |
go-windows-amd64 build | |
zip megajson > megajson-windows-amd64.zip |
Thanks for this. The drone.io
docs just don't cut it. This worked!
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Thanks for the start. Got this working, not very elegant but:
go get github.com/elazarl/goproxy
go build
go test
pushd ~
wget -q -O go1.3.linux-amd64.tar.gz http://golang.org/dl/go1.3.linux-amd64.tar.gz
tar -xzf go1.3.linux-amd64.tar.gz
export GOROOT=~/go
export PATH=$GOROOT/bin:$PATH
rm -rf ~/go/src/pkg/appengine
rm -rf ~/go/src/pkg/appengine_internal
popd
which go
wget -q -O golang-crosscompile-master.zip https://github.com/davecheney/golang-crosscompile/archive/master.zip
unzip golang-crosscompile-master.zip
source golang-crosscompile-master/crosscompile.bash
go-crosscompile-build darwin/amd64 2>&1 /dev/null
go-crosscompile-build windows/amd64 2>&1 /dev/null
cd $BUILD_DIR
go-linux-amd64 build
gzip -c fauxpi > fauxpi-linux-amd64.gz
go-darwin-amd64 build
gzip -c fauxpi > fauxpi-darwin-amd64.gz
go-windows-amd64 build
gzip -c fauxpi > fauxpi-windows-amd64.gz