File: setup.rst

package info (click to toggle)
blueprint-compiler 0.18.0-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 2,140 kB
  • sloc: python: 8,504; sh: 31; makefile: 6
file content (64 lines) | stat: -rw-r--r-- 1,743 bytes parent folder | download
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
62
63
64
=====
Setup
=====

Setting up Blueprint on a new or existing project
-------------------------------------------------

Using the porting tool
~~~~~~~~~~~~~~~~~~~~~~

Clone `blueprint-compiler <https://gitlab.gnome.org/GNOME/blueprint-compiler>`_
from source. You can install it using ``meson _build`` and ``ninja -C _build install``,
or you can leave it uninstalled.

In your project's directory, run ``blueprint-compiler port`` (or ``<path to blueprint-compiler.py> port``)
to start the porting process. It will walk you through the steps outlined below.
It should work for most projects, but if something goes wrong you may need to
follow the manual steps instead.


Manually
~~~~~~~~

blueprint-compiler works as a meson subproject.

#. Save the following file as ``subprojects/blueprint-compiler.wrap``:

   .. code-block:: cfg

      [wrap-git]
      directory = blueprint-compiler
      url = https://gitlab.gnome.org/GNOME/blueprint-compiler.git
      revision = main
      depth = 1

      [provide]
      program_names = blueprint-compiler

#. Add this to your ``.gitignore``:

   .. code-block::

      /subprojects/blueprint-compiler

#. Rewrite your .ui XML files in blueprint format.

#. Add this to the ``meson.build`` file where you build your GResources:

   .. code-block:: meson.build

      blueprints = custom_target('blueprints',
        input: files(
          # LIST YOUR BLUEPRINT FILES HERE
        ),
        output: '.',
        command: [find_program('blueprint-compiler'), 'batch-compile', '@OUTPUT@', '@CURRENT_SOURCE_DIR@', '@INPUT@'],
      )

#. In the same ``meson.build`` file, add this argument to your ``gnome.compile_resources`` command:

   .. code-block:: meson.build

      dependencies: blueprints,