Skip to content

Building MoonDeploy

Gianluca Costa edited this page Apr 11, 2016 · 20 revisions

This short tutorial is mainly dedicated to Mac OS users - especially if they wish to customize MoonDeploy making it employ the GTK+ user interface (available out-of-the-box for Windows and Linux) in lieu of the terminal interface.

Considering the portable nature of the Go programming language, the required steps are the same for every OS.

Requirements

  1. Install the Java Development Kit (required to run Gradle) and:
  • set the JAVA_HOME environment variable to its root directory

  • add its bin subdirectory to the PATH environment variable

  1. Install Gradle and add its bin directory to the PATH environment variable

  2. Install Go and:

  • set the GOROOT environment variable to its root directory

  • add its bin subdirectory to the PATH environment variable

  1. Install a suitable C compiler, as well as library support for GTK 3. It is definitely an OS-dependent process, which might require you to consult the documentation of your operating system, compiler and libraries

GUI customization step (for Mac OS users)

On Mac OS, you can replace the Bash user interface with the GTK+ user interface, but you'll need to slightly change a few source files:

  1. In the project directory, open the file named moonclient/verbs/startGUI_darwin.go

  2. Replace

"github.com/giancosta86/moondeploy/moonclient/gui/bash"

with

"github.com/giancosta86/moondeploy/moonclient/gui/gtk"
  1. Replace
return bash.StartGUI(launcher, bootDescriptorPath)

with

return gtk.StartGUI(launcher, bootDescriptorPath)

Build steps

  1. Create a directory that will be your Go path (for example, GoPath in your home directory)

  2. Assign such dir to the GOPATH environment variable

  3. Within GOPATH, create the src/github.com/giancosta86/moondeploy directory subtree

  4. Open a terminal within the moondeploy directory

  5. Run: git clone "https://github.com/giancosta86/moondeploy.git"

  6. Run gradle build. The most critical part will be to build the C libraries - please check the error messages and consult the documentation of your compiler suite

  7. If the process completes successfully, you will find a zip file within the build subdirectory: it is the archive containing the binary files for your operating system!

  8. Extract the zip file to a directory of your choice, which you should add to the PATH environment variable

After this setup, to run an application packaged with MoonDeploy you should just run:

moondeploy "PATH OF A .moondeploy descriptor"

Clone this wiki locally