Go Package Manager for GVM
Go
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
builder
container Make compatible with weekly.2012-03-22 Mar 28, 2012
gpkglib
gvm
logger
pkg
source
specs
tools
util Recursive dir copy. Should work on windows. Mar 29, 2012
version
.gitignore
README.md
VERSION
app.go
commands.go Initial support for cross compiling gpkg packages Apr 6, 2012
logger.go
main.go
target.gb

README.md

gpkg

gpkg is the package manager for http://github.com/moovweb/gvm.

Once you've installed Go using the instructions found at http://github.com/moovweb/gvm you'll have the gpkg command.

Creating your first package

Creating a gpkg package is pretty simple.

mkdir example1
cd example1
echo "package main
func main() {
  println(\"Hello World\")
}" >> main.go
gpkg build example1
example1

Creating and using a custom library

gpkg uses a special Package.gvm file to make imports available during compile time. See the following example:

mkdir lib1
cd lib1
echo "package lib1
func Hello(name string) {
  println(\"Hello\", name)
}" >> lib1.go
gpkg build lib1
cd ..

mkdir example2
cd example2
echo "pkg lib1" >> Package.gvm
echo "package main
import \"lib1\"
func main() {
  lib1.Hello(\"Josh\")
}" >> main.go
gpkg build example2
example2

Sources

gpkg uses a list of sources to find packages for gpkg install. You can add and remove source via the gpkg command:

  • Add a source gpkg sources add github.com/moovweb
  • Remove a source gpkg sources remove github.com/badrepo