aboutsummaryrefslogtreecommitdiffstats
path: root/sources/shiboken2/doc/gettingstarted.rst
blob: e064cec5dfb6b47f8e7b166f108acc766e5b2c3d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
Getting started
===============

Building from source
--------------------

This step is focused on building Shiboken from source, both the Generator and Python module.
Please notice that these are built when you are building PySide from source too, so there is no
need to continue if you already have a built PySide.

General Requirements
^^^^^^^^^^^^^^^^^^^^

 * **Python**: 3.5+ and 2.7
 * **Qt:** 5.12+ is recommended
 * **libclang:** The libclang library, recommended: version 6 for Shiboken2 5.12.
   Prebuilt versions of it can be `downloaded here`_.
 * **CMake:** 3.1+ is needed.

.. _downloaded here: http://download.qt.io/development_releases/prebuilt/libclang/

Simple build
^^^^^^^^^^^^

If you need only Shiboken Generator, a simple build run would look like this::

    python setup.py install --qmake=/path/to/qmake \
                            --build-tests \
                            --parallel=8 \
                            --verbose-build \
                            --internal-build=shiboken2-generator

The same can be used for the module, changing the value of ``internal-build`` to
``shiboken2-module``.

Using the wheels
----------------

Installing ``pyside2`` or ``shiboken2`` from pip **does not** install ``shiboken2_generator``,
because the wheels are not on PyPi.

You can get the ``shiboken2_generator`` wheels from Qt servers, and you can still install it
via ``pip``::

    pip install \
        --index-url=http://download.qt.io/official_releases/QtForPython/ \
        --trusted-host download.qt.io \
        shiboken2 pyside2 shiboken2_generator


The ``whl`` package cannot automatically discover in your system the location for:

* Clang installation,
* ``qmake`` location with the same version as the one described in the wheel,
* Qt libraries with the same package version.

So using this process requires you to manually modify the variables:

* ``CLANG_INSTALL_DIR`` must be set to where the libraries are,
* ``PATH`` must include the location for a ``qmake`` with the same Qt version as the package,
* ``LD_LIBRARY_PATH`` including the Qt libraries and Clang libraries paths.