Detailed compilation instructions - Development guide for librsvg documentation (original) (raw)

View this page

Toggle table of contents sidebar

A full build of librsvg requires themeson build system. A full build will produce these artifacts (see Librsvg as a product for details):

Some of the artifacts above are optional; please see the sectionCompile-time options below for details.

It is perfectly fine to ask the maintainerif you have questions about the meson setup; it’s a tricky bit of machinery, and we are glad to help.

The rest of this document explains librsvg’s peculiarities apart from the usual way of compiling meson projects.

Build-time dependencies

To compile librsvg, you need the following packages installed. The minimum version is listed here; you may use a newer version instead.

Compilers and build tools:

Mandatory dependencies:

Optional dependencies:

See Setting up your development environment for details on how to install these dependencies.

Basic compilation instructions

If you are compiling a tarball:

mkdir -p _build meson setup _build -Ddocs=enabled -Dintrospection=enabled -Dvala=enabled meson compile -C _build meson install -C _build

The options that start with -D are listed in themeson_options.txt file and are described in the next section.

Compile-time options

These are invoked during meson setup as -Doption_name=value. See meson’s documentation on using build-time options for details.

These are librsvg’s options:

Building with no network access

Automated build systems generally avoid network access so that they can compile from known-good sources, instead of pulling random updates from the net every time. However, normally Cargo likes to download dependencies when it first compiles a Rust project.

You can use cargo vendor to download librsvg’s Rust dependencies ahead of time, so that subsequent compilation don’t require network access.

Build systems can use Cargo’s source replacement mechanism to override the location of the source code for the Rust dependencies, for example, in order to patch one of the Rust crates that librsvg uses internally.