Compiling GoGUI on Windows

If you are using Unix/Linux/Ubuntu there are brief installation and build instructions INCLUDED with GoGUI in (gogui)/INSTALL.html.

This example is for Windows using the Eclipse IDE for Java. 32-bit versions of Java and Eclipse are required.

Before compiling the GoGUI Java source code on Windows, you will need to download several files and install a few programs.

Things you will need:

  1. GoGUI source code from the sourceforge GIT repository. On Windows, this is most easily achieved by installing…
      1. MSYSGIT

        • Add GIT executable (from MSYSGIT) to the Windows path variable (it is under My Computer->Properties->Advanced->Environment Variables…->System Variables pane–>Select “Path” and click the edit button.

          My path was: C:\Program Files (x86)\Git\bin

          (if you add this to the end of the list, add a semi-colon (;) at the end of the previous entry such as: C:\Program Files\TortoiseGit\bin;C:\Program Files (x86)\Git\bin)

      2. and then using TortoiseGIT to create a clone of the most recent (head) revision.
        • You may need to tell TortoiseGIT where the MSYSGIT executable is located. To create a clone, right-click on the desktop or on a folder and use the TortoiseGit context menu select “Git clone…”. The path to the GoGUI GIT repository is git://gogui.git.sourceforge.net/gitroot/gogui/gogui .
  2. You will also need libxslt compiled for Windows. The 32-bit executables can be found here:
    http://www.zlatkovic.com/libxml.en.html (ftp://ftp.zlatkovic.com/libxml/).

    You can download and extract the files anywhere, just make sure to add the bin directory to the Windows Path variable (C:\libxslt-1.1.26.win32\bin).

  3. You need to download Quaqua (it is NOT included in the GoGUI GIT repository, as indicated by the README file shown below).
    This directory contains the Quaqua Look And Feel from
    http://www.randelshofer.ch/quaqua/download.html.
    Due to its size, a copy is not included in the GoGui SVN repository
    (however it is included in the GoGui releases).
    If you checked out the GoGui sources from SVN, download the Quaqua zip-file
    with the version used in build.xml and copy it here.
    

    The developer suggests downloading the most up-to-date version from the direct link http://www.randelshofer.ch/quaqua/files/quaqua-5.4.1.nested.zip (or modifying this link if a different version is desired) and then updating the Build.xml file to look for this new version (see screenshot below).

    Screenshot of the Quaqua reference in the ANT Build.xml to be modified if using a new version of Quaqua

    NOTE: The official website (www.randelshofer.ch/quaqua/) was down for me when I wrote this page, so I would recommend, as a contingency plan, downloading the Fuego 1.0 release from sourceforge and copying the file (quaqua-5.2.1.nested.zip) over to your GIT directory.

    After downloading the ZIP file, place it in (GoGUI root)\external\quaqua. You do NOT need to extract the contents!

The full clone of the current GoGUI GIT repository should be downloaded before proceeding.

If you try to create an Eclipse project right away (and auto-build is turned on) you will notice that there are hundreds of warnings and several compile errors. The compile errors report a problem with the Version.java package because there is a Version.java.in makefile but no actual *.java file included in the GIT repository. This is because Unix/Linux/Ubuntu with autoconf and make functionality is expected (in other words Windows is not officially supported for building GoGUI from source). This is because it is the ANT Buildfile that tells Eclipse to process the Version.java.in and Eclipse does NOT use the ANT build system by default (this is true even if you just created a new project based on an ANT buildfile, go figure).

Nevertheless, the Version.java.in is almost identical to Version.java. The only difference is that the file is processed so that the package version number value is inserted for @VERSION@ such as:

//----------------------------------------------------------------------------
// The file Version.java is automatically created from Version.java.in.
// Do not edit Version.java.
//----------------------------------------------------------------------------

package net.sf.gogui.version;

/** Version information for all packages. */
public final class Version
{
    /** Get version for packages in net.sf.gogui.
        @return Version string, no assumptions about the format should be
        made.
    */
    public static String get()
    {
        return "1.2.3.abc123"; /* this used to be: return "@VERSION@"; */
    }

    /** Make constructor unavailable; class is for namespace only. */
    private Version()
    {
    }
}

Instead of creating the Version.java file manually in the \src\net\sf\gogui\version directory and inserting the version for the GIT revision you are using, we want the GIT executable to do this for us when it is called upon by Build.xml. (GIT versions are actually SHA1 hash values such as: 8b5db739d9b9a72f377cf40888918b0ce1d7795d)

Open Eclipse, using the GoGUI GIT folder as your working directory (unless you want to go through additional filepath troubles, which you are free to do).

Create a new Java project (File->New->Project) from an existing Ant Buildfile. (You may have to click “go to workbench” to see the regular Eclipse interface instead of the intro screen).

Select the Build.xml file in the GoGUI GIT repository source directory root.

Select the “compile” javac declaration. You can name the project whatever you’d like and it is not necessary to link the buildfile in the filesystem. and wait for Eclipse to build the project.

Now create an Ant builder by right-clicking on the project and going to Properties. Choose Builder->Add New->Ant and select Build.xml as the build file.

After doing all of the above, a full build of the Java project should be executed. Building may have been done automatically earlier and failed, so cleaning and then rebuilding may be necessary! All of these options are under the Project menu at the top of Eclipse.

Alternative Git Download Method:

If desired, you can use Eclipse instead of Tortoise GIT to download the GoGUI GIT repository. To do this you need Egit. This can be downloaded separately OR directly though Eclipse. To do it directly, go to the Eclipse menu under Help->Install New Software… and choose to “Work with…” a server that contains the EGit program such as “Helios – http://download.eclipse.org/releases/helios”

Choose the following program to download and install (version number may differ):
Eclipse EGit (incubation) 0.11.1

Once installed, connect with the following settings:
gogui.git.sourceforge.net
gitroot/gogui/gogui

References:

ANT on Eclipse: http://www.latenightpc.com/blog/archives/2006/02/13/steps-for-making-an-ant-build-with-eclipse

ANT Buildfile Documentation: http://ant.apache.org/manual/Tasks/exec.html

XSLT on Windows: http://www.sagehill.net/docbookxsl/InstallingAProcessor.html

EGit usage example: http://sourceforge.net/apps/mediawiki/cocovila/index.php?title=Eclipse_Git_Tutorial

Advertisements

2 Responses to Compiling GoGUI on Windows

  1. Markus says:

    Two small corrections:

    Version.java is created from Version.java.in by ant (see target “version” in build.xml). GNU make or autotools are not required to build GoGui.

    The version of Quaqua used in build.xml is still available from the Quaqua homepage, although only the newest versions are linked from there. But you can simply modify the URL of the newest version to get the version needed by GoGui (http://www.randelshofer.ch/quaqua/files/quaqua-5.4.1.nested.zip). Of course, you can also copy it from any of the GoGui releases or use the newest version and modify quaqua.nestedzipfile in build.xml.

Comments are closed.