Skip to content

Building MoonDeploy

Gianluca Costa edited this page May 2, 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

You might also have to:

  1. Install a suitable C compiler

  2. install library support for GTK 3 - if you also wish the GUI interface (the default for Windows and Linux, but not Mac)

The last points above are definitely an OS-dependent process, which might require you to consult the documentation of your operating system, compiler and libraries

Project setup

  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 directory subtree

  4. Open a terminal within the giancosta86 directory

  5. Run:

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

GUI customization step (for Mac OS users)

On Mac OS, you can replace the Bash user interface with the GTK+ user interface:

  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. 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

  1. 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!

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

  3. Be sure to add the resource files (in particular, .png images) from the PROJECT_DIR/moonclient/resources/ directory

Now, to run an application packaged with MoonDeploy you should just run:

moondeploy "any .moondeploy descriptor"

Clone this wiki locally