QML support for the Go language
This is an ALPHA release
This package is in an alpha stage, and still in heavy development. APIs
may change, and things may break.
At this time contributors and developers that are interested in tracking
the development closely are encouraged to use it. If you'd prefer a more
stable release, please hold on a bit and subscribe to the mailing list
for news. It's in a pretty good state, so it shall not take too long.
Demo
See this video for a quick demo and overview, and
the follow up to see it working on an Ubuntu Touch phone.
Please join the mailing list for
following relevant development news and discussing project details.
API documentation
The API documentation is available in the usual location.
Installation
To try the alpha release you'll need:
- Go 1.2 (release candidate), for the C++ support of go build
- Qt 5.0.X or 5.1.X with the development files
- The Qt headers qmetaobject_p.h and qmetaobjectbuilder_p.h, for the dynamic meta object support
See below for more details about getting these requirements installed in different environments and operating systems.
After the requirements are satisfied, go get should work as usual:
go get github.com/niemeyer/qml
Requirements on Ubuntu
If you are using Ubuntu, the Ubuntu SDK will take care of the Qt dependencies:
$ sudo add-apt-repository ppa:ubuntu-sdk-team/ppa
$ sudo apt-get update
$ sudo apt-get install ubuntu-sdk qtbase5-private-dev qtdeclarative5-private-dev
and Go 1.2 may be installed using godeb:
$ # Pick the right one for your system: 386 or amd64
$ ARCH=amd64
$ wget -q https://godeb.s3.amazonaws.com/godeb-$ARCH.tar.gz
$ tar xzvf godeb-$ARCH.tar.gz
godeb
$ sudo mv godeb /usr/local/bin
$ godeb list | head -1
1.2rc1
$ godeb install 1.2rc1
$ go get github.com/niemeyer/qml
Requirements on Mac OS
On Mac OS you'll need gcc (not a symlinked clang, as it complains about -std=c++11
), and
must specify the CXX
, PKG_CONFIG_PATH
, and CGO_CPPFLAGS
environment variables.
Something along these lines should be effective:
$ brew tap homebrew/versions
$ brew install gcc48 qt5
$ export PKG_CONFIG_PATH=`brew --prefix qt5`/lib/pkgconfig
$ QT5VERSION=`pkg-config --cflags Qt5Core | sed 's/^.*\(5\..\..\).*/\1/g'`
$ # For "private/qmetaobject_p.h" inclusion
$ export CGO_CPPFLAGS=-I`brew --prefix qt5`/include/QtCore/$QT5VERSION/QtCore
$ CXX=g++-4.8 go get github.com/niemeyer/qml
Requirements on Windows
On Windows you'll need the following:
Then, assuming Qt was installed under C:\Qt5.1.1\
, set up the following environment variables in the respective configuration:
CPATH += C:\Qt5.1.1\5.1.1\mingw48_32\include;C:\Qt5.1.1\5.1.1\mingw48_32\include\QtCore\5.1.1\QtCore
LIBRARY_PATH += C:\Qt5.1.1\5.1.1\mingw48_32\lib
PATH += C:\Qt5.1.1\5.1.1\mingw48_32\bin
After reopening the shell for the environment changes to take effect, this should work:
go get github.com/niemeyer/qml
Requirements everywhere else
If your operating system does not offer these dependencies readily,
you may still have success installing Go 1.2rc1
and Qt 5.0.2
directly from the upstreams.