~baidu-picture-scope-team/baidu-picture-scope/trunk

« back to all changes in this revision

Viewing changes to src/go/src/gopkg.in/qml.v0/README.md

  • Committer: Zhang Enwei
  • Date: 2016-08-26 02:22:48 UTC
  • Revision ID: enwei.zhang@canonical.com-20160826022248-mf89jsetpcc2hg9e
Intial release

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
# QML support for the Go language
 
2
 
 
3
This is an ALPHA release
 
4
------------------------
 
5
 
 
6
This package is in an alpha stage, and still in heavy development. APIs
 
7
may change, and things may break.
 
8
 
 
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.
 
13
 
 
14
 
 
15
Demos
 
16
-----
 
17
 
 
18
These introductory videos demonstrate the use of Go QML:
 
19
 
 
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)
 
24
 
 
25
 
 
26
Community
 
27
---------
 
28
 
 
29
Please join the [mailing list](https://groups.google.com/forum/#!forum/go-qml) for
 
30
following relevant development news and discussing project details.
 
31
 
 
32
 
 
33
Documentation
 
34
-------------
 
35
 
 
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).
 
38
 
 
39
 
 
40
Installation
 
41
------------
 
42
 
 
43
To try the alpha release you'll need:
 
44
 
 
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
 
48
 
 
49
See below for more details about getting these requirements installed in different environments and operating systems.
 
50
 
 
51
After the requirements are satisfied, _go get_ should work as usual:
 
52
 
 
53
    go get gopkg.in/qml.v0
 
54
 
 
55
 
 
56
Requirements on Ubuntu
 
57
----------------------
 
58
 
 
59
If you are using Ubuntu, the [Ubuntu SDK](http://developer.ubuntu.com/get-started/) will take care of the Qt dependencies:
 
60
 
 
61
    $ sudo add-apt-repository ppa:ubuntu-sdk-team/ppa
 
62
    $ sudo apt-get update
 
63
    $ sudo apt-get install ubuntu-sdk qtbase5-private-dev qtdeclarative5-private-dev libqt5opengl5-dev
 
64
 
 
65
and Go 1.2 may be installed using [godeb](http://blog.labix.org/2013/06/15/in-flight-deb-packages-of-go):
 
66
 
 
67
    $ # Pick the right one for your system: 386 or amd64
 
68
    $ ARCH=amd64
 
69
    $ wget -q https://godeb.s3.amazonaws.com/godeb-$ARCH.tar.gz
 
70
    $ tar xzvf godeb-$ARCH.tar.gz
 
71
    godeb
 
72
    $ sudo mv godeb /usr/local/bin
 
73
    $ godeb install 1.2
 
74
    $ go get gopkg.in/qml.v0
 
75
 
 
76
 
 
77
Requirements on Ubuntu Touch
 
78
----------------------------
 
79
 
 
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:
 
82
 
 
83
    $ adb shell
 
84
    # cd /tmp
 
85
    # wget https://github.com/go-qml/qml/raw/master/cmd/ubuntu-touch/setup.sh
 
86
    # /bin/bash setup.sh
 
87
    # su - phablet
 
88
    $
 
89
 
 
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:
 
93
 
 
94
    $ upstart-app-stop gopkg.in.qml.particle-example
 
95
 
 
96
for running it again:
 
97
 
 
98
    $ upstart-app-launch gopkg.in.qml.particle-example
 
99
 
 
100
These commands depend on the following file, installed by setup.sh:
 
101
 
 
102
    ~/.local/share/applications/gopkg.in.qml.particle-example.desktop
 
103
 
 
104
 
 
105
Requirements on Mac OS X
 
106
------------------------
 
107
 
 
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.
 
110
 
 
111
Something along these lines should be effective:
 
112
 
 
113
    $ brew tap homebrew/versions
 
114
    $ brew install gcc48 qt5
 
115
 
 
116
    $ export PKG_CONFIG_PATH=`brew --prefix qt5`/lib/pkgconfig
 
117
    $ CXX=g++-4.8 go get gopkg.in/qml.v0
 
118
 
 
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'`
 
121
should also work.
 
122
 
 
123
Requirements on Windows
 
124
-----------------------
 
125
 
 
126
On Windows you'll need the following:
 
127
 
 
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
 
131
 
 
132
Then, assuming Qt was installed under `C:\Qt5.1.1\`, set up the following environment variables in the respective configuration:
 
133
 
 
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
 
137
 
 
138
After reopening the shell for the environment changes to take effect, this should work:
 
139
 
 
140
    go get gopkg.in/qml.v0
 
141
 
 
142
 
 
143
Requirements everywhere else
 
144
----------------------------
 
145
 
 
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.