Building QtJsonDb from Git: Difference between revisions

From Qt Wiki
Jump to navigation Jump to search
(Convert ExpressionEngine section headers)
(Style)
Line 1: Line 1:
{{Cleanup | reason=Auto-imported from ExpressionEngine.}}
[[Category:HowTo]]
[[Category:HowTo]]
[[Category:Developing_with_Qt::Qt 5]]
'''English'''
[toc align_right="yes" depth="3"]
= Building QtJsonDb from Git =
== Introduction ==
== Introduction ==


Line 16: 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 26: Line 16:
==== QtJsonDb dependencies on Ubuntu/Debian: ====
==== QtJsonDb dependencies on Ubuntu/Debian: ====


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


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


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


=== Mac OS X ===
=== Mac OS X ===
Line 46: Line 32:
You need to have HomeBrew installed at first.
You need to have HomeBrew installed at first.


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


==== Via [http://www.macports.org/ MacPorts] ====
==== Via [http://www.macports.org/ MacPorts] ====


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


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


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


<code>
git clone <nowiki>git://gitorious.org/qt/qtjsondb.git</nowiki> qtjsondb
git clone git://gitorious.org/qt/qtjsondb.git qtjsondb
</code>


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


==== Mac OS X ====
== Qmakeing and building ==
For '''HomeBrew''' users, patch [https://gist.github.com/2584990 this file] or [https://gist.github.com/gists/2584990/download download the patch directly] .
<code>
git am~/Downloads/0001-tmp-patch-for-add-path-for-icu-on-mac-with-brew.patch
</code>


For '''MacPorts''' users, patch [https://gist.github.com/2659021 this file] or [https://gist.github.com/gists/2659021/download download the patch directly] .
Now start to <tt>qmake</tt> and <tt>make</tt> a shadow build:
<code>
git am ~/Downloads/0001-tmp-patch-for-add-path-for-icu-on-mac-with-macports.patch
</code>


== Qmakeing and building ==
$ mkdir ~/build/qtjsondb
Now start to qmake and make a shadow build:
$ cd ~/build/qtjsondb
<code>
$ ~/build/qt5/qtbase/bin/qmake -o Makefile ~/dev/git/qtjsondb/qtjsondb.pro
mkdir~/build/qtjsondb
cd ~/build/qtjsondb
~/build/qt5/qtbase/bin/qmake -o Makefile ~/dev/git/qtjsondb/qtjsondb.pro
</code>


If you have seen following output, then the ICU was enabled successfully:
If you have seen following output, then the ICU was enabled successfully:
<code>
 
Configuration tests:
Configuration tests:
icu: yes
  icu: yes
libedit: yes
  libedit: yes
</code>


== How to run examples ==
== How to run examples ==
Launch jsondb daemon in a terminal(the first):
Launch jsondb daemon in a terminal(the first):


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


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


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


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


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

Revision as of 15:09, 17 March 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://gitorious.org/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