Qt wiki will be updated on October 12th 2023 starting at 11:30 AM (EEST) and the maintenance will last around 2-3 hours. During the maintenance the site will be unavailable.

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)
 
(6 intermediate revisions by 3 users not shown)
Line 1: Line 1:
'''English'''
[[Category:HowTo]]
== Introduction ==


=Building QtJsonDb from Git=
Todo.


==Introduction==
== System Requirements ==


Todo.
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.


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


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|Building_Qt_5_from_Git]] for more information.
=== Linux/X11 ===


At this moment the only supported platforms for qtjsondb are '''Linux''' and '''Mac OS X'''
QtJsonDb depends on libedit and libicu(optionally):


===Linux/X11===
==== QtJsonDb dependencies on Ubuntu/Debian: ====


QtJsonDb depends on libedit and libicu(optionally):
$ sudo apt-get install libedit-dev
$ sudo apt-get install libicu-dev


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


====QtJsonDb dependencies on Mandriva/ROSA/Unity:====
$ urpmi 'pkgconfig(libedit)'
$ urpmi 'pkgconfig(libicu)'


===Mac OS X===
=== Mac OS X ===


QtJsonDb depends on libicu(optionally).
QtJsonDb depends on libicu(optionally).


====Via [http://mxcl.github.com/homebrew/ HomeBrew] ''[mxcl.github.com]''====
==== Via [http://mxcl.github.com/homebrew/ HomeBrew] ====


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


====Via [http://www.macports.org/ MacPorts] ''[macports.org]''====
$ brew install icu4c


==Getting the source code==
==== Via [http://www.macports.org/ MacPorts] ====


First clone the QtJsonDb git repository(for example, under <code>~/dev/git</code>):
$ port install icu


===Current temporary patch===
== Getting the source code ==


Only for enable collation feature based on whether <span class="caps">ICU</span> header files are available or not on Mac.
First clone the QtJsonDb git repository(for example, under <tt>~/dev/git</tt>):


====Mac OS X====
git clone <nowiki>git://code.qt.io/qt/qtjsondb.git</nowiki> qtjsondb


For '''HomeBrew''' users, patch [https://gist.github.com/2584990 this file] ''[gist.github.com]'' or [https://gist.github.com/gists/2584990/download download the patch directly] ''[gist.github.com]'' .<br />
=== Current temporary patch ===


For '''MacPorts''' users, patch [https://gist.github.com/2659021 this file] ''[gist.github.com]'' or [https://gist.github.com/gists/2659021/download download the patch directly] ''[gist.github.com]'' .<br />
Only for enable collation feature based on whether ICU header files are available or not on Mac.


==Qmakeing and building==
== Qmakeing and building ==


Now start to qmake and make a shadow build:<br />
Now start to <tt>qmake</tt> and <tt>make</tt> a shadow build:


If you have seen following output, then the <span class="caps">ICU</span> was enabled successfully:<br />
$ mkdir ~/build/qtjsondb
$ cd ~/build/qtjsondb
$ ~/build/qt5/qtbase/bin/qmake -o Makefile ~/dev/git/qtjsondb/qtjsondb.pro


==How to run examples==
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):
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):
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):
If want to clean the db files after running(in the first terminal):


===Categories:===
$ cd ~/dev/git/qtjsondb/examples/declarative
 
$ rm *.db
* [[:Category:Developing with Qt|Developing_with_Qt]]
** [[:Category:Developing with Qt::Qt-5|Qt 5]]
* [[:Category:HowTo|HowTo]]

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