more pretty md files

This commit is contained in:
2016-02-02 00:55:13 +07:00
parent c0ad1a6912
commit 518956bdff
39 changed files with 1550 additions and 484 deletions

View File

@ -7,13 +7,21 @@ tags: archlinux, linux, building, qutim
title: Building Qutim using Qt5
short: building-qutim-using-qt5
---
[Qutim](//qutim.org) is a multiprotocol and cross platform messenger. It is written on `CPP` using Qt library. The project is actively developed. In this paper I will say about building this package in Archlinux using Qt5 library (instead of Qt4 which is used in current AUR packages).
[Qutim](//qutim.org) is a multiprotocol and cross platform messenger. It is
written on `CPP` using Qt library. The project is actively developed. In this
paper I will say about building this package in Archlinux using Qt5 library
(instead of Qt4 which is used in current AUR packages).
<!--more-->
# <a href="#problems" class="anchor" id="problems"><span class="octicon octicon-link"></span></a>What's wrong?
This package uses [qbs](//qt-project.org/wiki/qbs "Wiki") for building, which is a bit strange IMHO. A package, which is necessary for building, is [in AUR](//aur.archlinux.org/packages/qbs-git/ "AUR") . I recommend to use git version of the package. When I asked Andrea Scarpino (who maintains KDE and Qt packages into the official repos) about qbs, he told me "we will support it in time". And I agree with him, the project seems to be a little unstable.
This package uses [qbs](//qt-project.org/wiki/qbs "Wiki") for building, which is
a bit strange IMHO. A package, which is necessary for building, is [in
AUR](//aur.archlinux.org/packages/qbs-git/ "AUR"). I recommend to use git
version of the package. When I asked Andrea Scarpino (who maintains KDE and Qt
packages into the official repos) about qbs, he told me "we will support it in
time". And I agree with him, the project seems to be a little unstable.
# <a href="#prepare" class="anchor" id="prepare"><span class="octicon octicon-link"></span></a>Prepare
@ -26,21 +34,28 @@ yaourt -S --asdeps jreen-git qbs-git
### <a href="#qbs" class="anchor" id="qbs"><span class="octicon octicon-link"></span></a>qbs settings
You may read about qbs [on the link](//qt-project.org/wiki/qbs "Wiki") or see examples which are provides by the package. qbs uses configuration file that firstly you must create and secondly it is stored in your home directory. In theory a configuration file creating (`~/.config/QtProject/qbs.conf`) looks like this:
You may read about qbs [on the link](//qt-project.org/wiki/qbs "Wiki") or see
examples which are provides by the package. qbs uses configuration file that
firstly you must create and secondly it is stored in your home directory. In
theory a configuration file creating (`~/.config/QtProject/qbs.conf`) looks like
this:
```bash
qbs-setup-qt --detect
qbs-detect-toolchains
```
Firstly we find Qt libraries. Then we find toolchains (such as compilers). And next we must insert a toolchain into Qt profile (for example, we need `clang` toolchain):
Firstly we find Qt libraries. Then we find toolchains (such as compilers). And
next we must insert a toolchain into Qt profile (for example, we need `clang`
toolchain):
```bash
sed 's/clang\\/qt-5-2-0\\/g' -i ~/.config/QtProject/qbs.conf
```
And there are other ways. You may edit the file manually or use `qbs-config-ui` or `qbs-config`.
So, we have created the configuration file and put it into build directory:
And there are other ways. You may edit the file manually or use `qbs-config-ui`
or `qbs-config`. So, we have created the configuration file and put it into
build directory:
```ini
[General]
@ -69,7 +84,7 @@ qutim\Qt\core\libPath=/usr/lib
qutim\Qt\core\mkspecPath=/usr/lib/qt/mkspecs/linux-g++
qutim\Qt\core\namespace=
qutim\Qt\core\pluginPath=/usr/lib/qt/plugins
qutim\Qt\core\qtConfig=minimal-config, small-config, medium-config, large-config, full-config, gtk2, gtkstyle, fontconfig, libudev, evdev, xlib, xcb-glx, xcb-xlib, xcb-sm, xrender, accessibility-atspi-bridge, linuxfb, c++11, accessibility, opengl, shared, qpa, reduce_exports, reduce_relocations, clock-gettime, clock-monotonic, mremap, getaddrinfo, ipv6ifname, getifaddrs, inotify, eventfd, system-jpeg, system-png, png, system-freetype, no-harfbuzz, system-zlib, nis, cups, iconv, glib, dbus, dbus-linked, openssl-linked, xcb, xinput2, alsa, pulseaudio, icu, concurrent, audio-backend, release
qutim\Qt\core\qtConfig=minimal-config, small-config, medium-config,large-config, full-config, gtk2, gtkstyle, fontconfig, libudev, evdev, xlib,xcb-glx, xcb-xlib, xcb-sm, xrender, accessibility-atspi-bridge, linuxfb, c++11,accessibility, opengl, shared, qpa, reduce_exports, reduce_relocations,clock-gettime, clock-monotonic, mremap, getaddrinfo, ipv6ifname, getifaddrs,inotify, eventfd, system-jpeg, system-png, png, system-freetype, no-harfbuzz,system-zlib, nis, cups, iconv, glib, dbus, dbus-linked, openssl-linked, xcb,xinput2, alsa, pulseaudio, icu, concurrent, audio-backend, release
qutim\Qt\core\version=5.2.0
qutim\cpp\compilerName=clang++
qutim\cpp\toolchainInstallPath=/usr/bin
@ -91,7 +106,8 @@ diff -ruN qutim.orig/core/libqutim.qbs qutim/core/libqutim.qbs
@@ -75,7 +75,7 @@
cpp.linkerFlags: {
var flags = base;
if (qbs.toolchain.contains("clang") && qbs.targetOS.contains("linux"))
if (qbs.toolchain.contains("clang") &&
qbs.targetOS.contains("linux"))
- flags = flags.concat("-stdlib=libc++ -lcxxrt");
+ flags = flags.concat("-lc++abi");
return flags;
@ -102,9 +118,12 @@ diff -ruN qutim.orig/core/libqutim.qbs qutim/core/libqutim.qbs
And the second one is Vk plugin:
```diff
diff -ruN qutim.orig/protocols/vkontakte/vreen/vreen.qbs qutim/protocols/vkontakte/vreen/vreen.qbs
--- qutim.orig/protocols/vkontakte/vreen/vreen.qbs 2014-01-06 15:41:42.000000000 +0400
+++ qutim/protocols/vkontakte/vreen/vreen.qbs 2014-01-06 15:46:47.142178486 +0400
diff -ruN qutim.orig/protocols/vkontakte/vreen/vreen.qbs
qutim/protocols/vkontakte/vreen/vreen.qbs
--- qutim.orig/protocols/vkontakte/vreen/vreen.qbs 2014-01-06
15:41:42.000000000 +0400
+++ qutim/protocols/vkontakte/vreen/vreen.qbs 2014-01-06 15:46:47.142178486
+0400
@@ -5,6 +5,7 @@
property string vreen_qml_path: "bin"
property string vreen_lib_path: "lib"
@ -142,7 +161,10 @@ cd qutim
HOME=$(pwd) qbs -j $(nproc) -d ../build release profile:qutim
```
I want to create a universal recipe for the building, thus we must set `$HOME` directory. Flag `-j` means number of jobs, `-d` means build directory, `release` means building type (debug, release), `profile` is used profile, which is described in the configuration file.
I want to create a universal recipe for the building, thus we must set `$HOME`
directory. Flag `-j` means number of jobs, `-d` means build directory, `release`
means building type (debug, release), `profile` is used profile, which is
described in the configuration file.
## <a href="#install" class="anchor" id="install"><span class="octicon octicon-link"></span></a>Installation
@ -150,7 +172,8 @@ I want to create a universal recipe for the building, thus we must set `$HOME` d
HOME=$(pwd) sudo qbs install -d ../build --install-root "/usr" profile:qutim
```
We must set root directory (`--install-root`), because without this option the package will be installed into `/` (`/bin` and `/lib`).
We must set root directory (`--install-root`), because without this option the
package will be installed into `/` (`/bin` and `/lib`).
## <a href="#pkgbuild" class="anchor" id="pkgbuild"><span class="octicon octicon-link"></span></a>PKGBUILD