Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/binocarlos/go-go-gadget
Install a cross-compiling go development environment
https://github.com/binocarlos/go-go-gadget
Last synced: 11 days ago
JSON representation
Install a cross-compiling go development environment
- Host: GitHub
- URL: https://github.com/binocarlos/go-go-gadget
- Owner: binocarlos
- Created: 2015-02-19T17:20:37.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2015-02-19T17:21:54.000Z (over 9 years ago)
- Last Synced: 2024-04-14T14:36:41.167Z (7 months ago)
- Language: Shell
- Size: 117 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
go-go-gadget
------------Installation instructions for getting a cross-compiling go development environment to work.
## install
First you clone this repository and then:
```bash
$ sudo bash ./install.sh
```## notes
The install script does the following steps:
* install the package managers used by go (mercurial, subversion, bzr, git)
* clone the go source code into $GO_CODE (/srv/projects/gocode)
* checkout the $GO_VERSION (1.4.1)
* build the go binaries for GOOS=darwin
* build the go binaries for GOOS=linux
* setup the environment with:
* GOROOT - $GO_BUILD
* GOPATH - $GO_PATH
* GOBIN - $GO_CODE/bin
* PATH - $PATH:$GO_BUILD/bin
* change ownership of $GO_BUILD/src and $GO_CODE to the user## compiling
To compile a package against darwin and linux - here is a simple Makefile format:
```
NAME=powerstrip
VERSION=0.1.0build:
mkdir -p build/linux && CGO_ENABLED=0 GOOS=linux \
go build -ldflags "-X main.Version $(VERSION)" -o build/linux/$(NAME)
mkdir -p build/darwin && CGO_ENABLED=0 GOOS=darwin \
go build -ldflags "-X main.Version $(VERSION)" -o build/darwin/$(NAME)
```## licence
MIT