1
# QML support for the Go language
3
This is an ALPHA release
4
------------------------
6
This package is in an alpha stage, and still in heavy development. APIs
7
may change, and things may break.
9
At this time contributors and developers that are interested in tracking
10
the development closely are encouraged to use it. If you'd prefer a more
11
stable release, please hold on a bit and subscribe to the mailing list
12
for news. It's in a pretty good state, so it shall not take too long.
18
These introductory videos demonstrate the use of Go QML:
20
* [Initial demo and overview](http://youtu.be/FVQlMrPa7lI)
21
* [Initial demo running on an Ubuntu Touch phone](http://youtu.be/HB-3o8Cysec)
22
* [Spinning Gopher with Go + QML + OpenGL](http://youtu.be/qkH7_dtOyPk)
23
* [SameGame QML tutorial in Go](http://youtu.be/z8noX48hiMI)
29
Please join the [mailing list](https://groups.google.com/forum/#!forum/go-qml) for
30
following relevant development news and discussing project details.
36
The introductory documentation as well as the detailed API documentation is
37
available at [gopkg.in/qml.v0](http://godoc.org/gopkg.in/qml.v0).
43
To try the alpha release you'll need:
45
* Go 1.2, for the C++ support of _go build_
46
* Qt 5.0.X or 5.1.X with the development files
47
* The Qt headers qmetaobject_p.h and qmetaobjectbuilder_p.h, for the dynamic meta object support
49
See below for more details about getting these requirements installed in different environments and operating systems.
51
After the requirements are satisfied, _go get_ should work as usual:
53
go get gopkg.in/qml.v0
56
Requirements on Ubuntu
57
----------------------
59
If you are using Ubuntu, the [Ubuntu SDK](http://developer.ubuntu.com/get-started/) will take care of the Qt dependencies:
61
$ sudo add-apt-repository ppa:ubuntu-sdk-team/ppa
63
$ sudo apt-get install ubuntu-sdk qtbase5-private-dev qtdeclarative5-private-dev libqt5opengl5-dev
65
and Go 1.2 may be installed using [godeb](http://blog.labix.org/2013/06/15/in-flight-deb-packages-of-go):
67
$ # Pick the right one for your system: 386 or amd64
69
$ wget -q https://godeb.s3.amazonaws.com/godeb-$ARCH.tar.gz
70
$ tar xzvf godeb-$ARCH.tar.gz
72
$ sudo mv godeb /usr/local/bin
74
$ go get gopkg.in/qml.v0
77
Requirements on Ubuntu Touch
78
----------------------------
80
After following the [installation instructions](https://wiki.ubuntu.com/Touch/Install) for Ubuntu Touch,
81
run the following commands to get a working build environment inside the device:
85
# wget https://github.com/go-qml/qml/raw/master/cmd/ubuntu-touch/setup.sh
90
At the end of setup.sh, the phablet user will have GOPATH=$HOME in the environment,
91
the qml package will be built, and the particle example will be built and run. For
92
stopping it from the command line, run as the phablet user:
94
$ upstart-app-stop gopkg.in.qml.particle-example
98
$ upstart-app-launch gopkg.in.qml.particle-example
100
These commands depend on the following file, installed by setup.sh:
102
~/.local/share/applications/gopkg.in.qml.particle-example.desktop
105
Requirements on Mac OS X
106
------------------------
108
On Mac OS X you'll need gcc (not a symlinked clang, as it complains about `-std=c++11`), and
109
must specify the `CXX`, `PKG_CONFIG_PATH`, and `CGO_CPPFLAGS` environment variables.
111
Something along these lines should be effective:
113
$ brew tap homebrew/versions
114
$ brew install gcc48 qt5
116
$ export PKG_CONFIG_PATH=`brew --prefix qt5`/lib/pkgconfig
117
$ CXX=g++-4.8 go get gopkg.in/qml.v0
119
For Mac OS X Mavericks you may need to use `brew install qt5 --HEAD` and check that QT5VERSION
120
is something reasonable like `5.2.0`, `ls /usr/local/Cellar/qt5/HEAD/include/QtCore/ | grep '^5'`
123
Requirements on Windows
124
-----------------------
126
On Windows you'll need the following:
128
* [MinGW gcc](http://sourceforge.net/projects/mingw/files/latest/download) 4.8.1 (install mingw-get and install the gcc from within the setup GUI)
129
* [Qt 5.1.1](http://download.qt-project.org/official_releases/qt/5.1/5.1.1/qt-windows-opensource-5.1.1-mingw48_opengl-x86-offline.exe) for MinGW 4.8
130
* [Go 1.2rc1](https://code.google.com/p/go/downloads/list?can=1&q=go1.2rc1) for Windows
132
Then, assuming Qt was installed under `C:\Qt5.1.1\`, set up the following environment variables in the respective configuration:
134
CPATH += C:\Qt5.1.1\5.1.1\mingw48_32\include
135
LIBRARY_PATH += C:\Qt5.1.1\5.1.1\mingw48_32\lib
136
PATH += C:\Qt5.1.1\5.1.1\mingw48_32\bin
138
After reopening the shell for the environment changes to take effect, this should work:
140
go get gopkg.in/qml.v0
143
Requirements everywhere else
144
----------------------------
146
If your operating system does not offer these dependencies readily,
147
you may still have success installing [Go 1.2rc1](https://code.google.com/p/go/downloads/list?can=1&q=go1.2rc1)
148
and [Qt 5.0.2](http://download.qt-project.org/archive/qt/5.0/5.0.2/)
149
directly from the upstreams. Note that you'll likely have to adapt
150
environment variables to reflect the custom installation path for
151
these libraries. See the instructions above for examples.