15 releases (8 breaking)

Uses old Rust 2015

0.10.0 Jul 4, 2020
0.9.1 Dec 14, 2019
0.9.0 Jun 22, 2019
0.8.0 Feb 21, 2019
0.2.1 Oct 20, 2015

#71 in Unix APIs

Download history 5598/week @ 2020-12-25 7804/week @ 2021-01-01 9953/week @ 2021-01-08 9511/week @ 2021-01-15 9161/week @ 2021-01-22 10894/week @ 2021-01-29 10352/week @ 2021-02-05 11490/week @ 2021-02-12 10443/week @ 2021-02-19 9196/week @ 2021-02-26 8434/week @ 2021-03-05 10072/week @ 2021-03-12 8388/week @ 2021-03-19 8970/week @ 2021-03-26 8871/week @ 2021-04-02 8752/week @ 2021-04-09

38,329 downloads per month
Used in 333 crates (127 directly)

MIT license



Autogenerated FFI definitions for various GNOME libraries.


This repository contains the "sys" crates – FFI definitions intended for use in the actual bindings (e.g. gtk).

Each crate expects the development files of the respective library to be installed on the system.

Library versions

The installed library version is detected via pkg-config in the build script, which controls conditional compilation so only the functions availiable in that library version are visible.

For instance, if the gdk-sys crate's build script detects libgdk3 version 3.12, it sets a number of cfg directives gdk_3_4, gdk_3_6, ..., up togdk_3_12. Correspondingly, the definitions of functions introduced in version x.y carry #[cfg(gdk_x_y)] attributes. (The build script actually contains a complete list of the versions it knows, 3.4 doesn't have any special meaning, it's just the first in that list in that crate). The build script passes that set of directives on to its dependencies, so a depenendent crate's build script will see

env::var("DEP_GDK_CFG").unwrap() == "gdk_3_4 gdk_3_6 gdk_3_8 gdk_3_10 gdk_3_12"


> make

will build the generator in gir and generate the crates using specifications from conf and GIR definitions from gir-files.

Currently gir-files is populated from the gnome-staging ppa. Using a single set of GIR definitions for all platforms and versions is considered good enough at this point.