Building QtJsonDb from Git: Difference between revisions

From Qt Wiki
Jump to navigation Jump to search
No edit summary
(Refactored gitorious.org to code.qt.io)
 
(5 intermediate revisions by 3 users not shown)
Line 1: Line 1:
[[Category:HowTo]]<br />[[Category:Developing_with_Qt::Qt 5]]
[[Category:HowTo]]
 
'''English'''
 
[toc align_right=&quot;yes&amp;quot; depth=&quot;3&amp;quot;]
 
= Building QtJsonDb from Git =
 
== Introduction ==
== Introduction ==


Line 13: Line 6:
== System Requirements ==
== System Requirements ==


QtJsonDb is one of the addons of Qt 5, hence before building qtjsondb you need to build dependent modules - qtbase, qtxmlpatterns, qtjsbackend and qtdeclarative. See [[Building_Qt_5_from_Git]] for more information.
QtJsonDb is one of the addons of Qt 5, hence before building qtjsondb you need to build dependent modules - qtbase, qtxmlpatterns, qtjsbackend and qtdeclarative. See [[Building Qt 5 from Git]] for more information.


At this moment the only supported platforms for qtjsondb are '''Linux''' and '''Mac OS X'''
At this moment the only supported platforms for QtJsonDb are '''Linux''' and '''Mac OS X'''.


=== Linux/X11 ===
=== Linux/X11 ===
Line 23: Line 16:
==== QtJsonDb dependencies on Ubuntu/Debian: ====
==== QtJsonDb dependencies on Ubuntu/Debian: ====


<code><br />sudo apt-get install libedit-dev<br />sudo apt-get install libicu-dev<br /></code>
$ sudo apt-get install libedit-dev
$ sudo apt-get install libicu-dev


==== QtJsonDb dependencies on Mandriva/ROSA/Unity: ====
==== QtJsonDb dependencies on Mandriva/ROSA/Unity: ====


<code><br />urpmi 'pkgconfig(libedit)'<br />urpmi 'pkgconfig(libicu)'<br /></code>
$ urpmi 'pkgconfig(libedit)'
$ urpmi 'pkgconfig(libicu)'


=== Mac OS X ===
=== Mac OS X ===
Line 33: Line 28:
QtJsonDb depends on libicu(optionally).
QtJsonDb depends on libicu(optionally).


==== Via &quot;HomeBrew&amp;quot;:http://mxcl.github.com/homebrew/ ====
==== Via [http://mxcl.github.com/homebrew/ HomeBrew] ====


You need to have HomeBrew installed at first.
You need to have HomeBrew installed at first.


<code><br />brew install icu4c<br /></code>
$ brew install icu4c


==== Via &quot;MacPorts&amp;quot;:http://www.macports.org/ ====
==== Via [http://www.macports.org/ MacPorts] ====


<code><br />port install icu<br /></code>
$ port install icu


== Getting the source code ==
== Getting the source code ==


First clone the QtJsonDb git repository(for example, under &lt;code&amp;gt;<sub>/dev/git&amp;lt;/code&amp;gt;):
First clone the QtJsonDb git repository(for example, under <tt>~/dev/git</tt>):
<br /><code><br />git clone git://gitorious.org/qt/qtjsondb.git qtjsondb<br /></code>
 
<br />h3. Current temporary patch
git clone <nowiki>git://code.qt.io/qt/qtjsondb.git</nowiki> qtjsondb
<br />Only for enable collation feature based on whether ICU header files are available or not on Mac.
 
<br />h4. Mac OS X
=== Current temporary patch ===
<br />For '''HomeBrew''' users, patch &quot;this file&amp;quot;:https://gist.github.com/2584990 or &quot;download the patch directly&amp;quot;:https://gist.github.com/gists/2584990/download .<br /><code><br />git am</sub>/Downloads/0001-tmp-patch-for-add-path-for-icu-on-mac-with-brew.patch<br /></code>
 
Only for enable collation feature based on whether ICU header files are available or not on Mac.
 
== Qmakeing and building ==
 
Now start to <tt>qmake</tt> and <tt>make</tt> a shadow build:
 
$ mkdir ~/build/qtjsondb
$ cd ~/build/qtjsondb
$ ~/build/qt5/qtbase/bin/qmake -o Makefile ~/dev/git/qtjsondb/qtjsondb.pro
 
If you have seen following output, then the ICU was enabled successfully:
 
Configuration tests:
  icu: yes
  libedit: yes
 
== How to run examples ==
 
Launch jsondb daemon in a terminal(the first):
 
$ cd ~/dev/git/qtjsondb/examples/declarative
$ ~/build/qt5/qtbase/bin/jsondb
 
Run the example code in another terminal(the second):
 
$ cd ~/dev/git/qtjsondb/examples/declarative/simplelistmodel
$ ~/build/qt5/qtbase/bin/qmlscene ./simplelistmodel.qml
 
If want to clean the db files after running(in the first terminal):


For '''MacPorts''' users, patch &quot;this file&amp;quot;:https://gist.github.com/2659021 or &quot;download the patch directly&amp;quot;:https://gist.github.com/gists/2659021/download .<br /><code><br />git am <sub>/Downloads/0001-tmp-patch-for-add-path-for-icu-on-mac-with-macports.patch<br /></code>
$ cd ~/dev/git/qtjsondb/examples/declarative
<br />h2. Qmakeing and building
$ rm *.db
<br />Now start to qmake and make a shadow build:<br /><code><br />mkdir</sub>/build/qtjsondb<br />cd <sub>/build/qtjsondb<br /></sub>/build/qt5/qtbase/bin/qmake -o Makefile <sub>/dev/git/qtjsondb/qtjsondb.pro<br /></code>
<br />If you have seen following output, then the ICU was enabled successfully:<br /><code><br />Configuration tests:<br /> icu: yes<br /> libedit: yes<br /></code>
<br />h2. How to run examples
<br />Launch jsondb daemon in a terminal(the first):
<br /><code><br />cd</sub>/dev/git/qtjsondb/examples/declarative<br /><sub>/build/qt5/qtbase/bin/jsondb<br /></code>
<br />Run the example code in another terminal(the second):
<br /><code><br />cd</sub>/dev/git/qtjsondb/examples/declarative/simplelistmodel<br /><sub>/build/qt5/qtbase/bin/qmlscene ./simplelistmodel.qml<br /></code>
<br />If want to clean the db files after running(in the first terminal):
<br /><code><br />cd</sub>/dev/git/qtjsondb/examples/declarative<br />rm *.db

Latest revision as of 15:29, 1 April 2015

Introduction

Todo.

System Requirements

QtJsonDb is one of the addons of Qt 5, hence before building qtjsondb you need to build dependent modules - qtbase, qtxmlpatterns, qtjsbackend and qtdeclarative. See Building Qt 5 from Git for more information.

At this moment the only supported platforms for QtJsonDb are Linux and Mac OS X.

Linux/X11

QtJsonDb depends on libedit and libicu(optionally):

QtJsonDb dependencies on Ubuntu/Debian:

$ sudo apt-get install libedit-dev
$ sudo apt-get install libicu-dev

QtJsonDb dependencies on Mandriva/ROSA/Unity:

$ urpmi 'pkgconfig(libedit)'
$ urpmi 'pkgconfig(libicu)'

Mac OS X

QtJsonDb depends on libicu(optionally).

Via HomeBrew

You need to have HomeBrew installed at first.

$ brew install icu4c

Via MacPorts

$ port install icu

Getting the source code

First clone the QtJsonDb git repository(for example, under ~/dev/git):

git clone git://code.qt.io/qt/qtjsondb.git qtjsondb

Current temporary patch

Only for enable collation feature based on whether ICU header files are available or not on Mac.

Qmakeing and building

Now start to qmake and make a shadow build:

$ mkdir ~/build/qtjsondb
$ cd ~/build/qtjsondb
$ ~/build/qt5/qtbase/bin/qmake -o Makefile ~/dev/git/qtjsondb/qtjsondb.pro

If you have seen following output, then the ICU was enabled successfully:

Configuration tests:
 icu: yes
 libedit: yes

How to run examples

Launch jsondb daemon in a terminal(the first):

$ cd ~/dev/git/qtjsondb/examples/declarative
$ ~/build/qt5/qtbase/bin/jsondb

Run the example code in another terminal(the second):

$ cd ~/dev/git/qtjsondb/examples/declarative/simplelistmodel
$ ~/build/qt5/qtbase/bin/qmlscene ./simplelistmodel.qml

If want to clean the db files after running(in the first terminal):

$ cd ~/dev/git/qtjsondb/examples/declarative
$ rm *.db