blob: 48c52e1b403632303ba9899a76b74a5da3abd357 (
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
|
# libglycin {#libglycin-hooks}
[Glycin](https://gitlab.gnome.org/GNOME/glycin) is a library for sandboxed and extendable image loading.
[]{#libglycin-setup-hook} For most applications using it, individual image formats are loaded through binaries provided by `glycin-loaders`. The paths of these loaders must be injected into the environment, e.g. using [`wrapGAppsHook`](#ssec-gnome-hooks). `libglycin.setupHook` will do that.
[]{#libglycin-patch-vendor-hook} Additionally, for Rust projects `glycin` Rust crate itself requires a patch to become self-contained. `libglycin.patchVendorHook` will do that. This is not needed for projects using the ELF library from `libglycin` package.
## Example code snippet {#libglycin-hooks-example-code-snippet}
```nix
{
lib,
rustPlatform,
libglycin,
glycin-loaders,
wrapGAppsHook4,
}:
rustPlatform.buildRustPackage {
# ...
cargoHash = "...";
nativeBuildInputs = [
wrapGAppsHook4
libglycin.patchVendorHook
];
buildInputs = [
libglycin.setupHook
glycin-loaders
];
# ...
}
```
## Variables controlling glycin-loaders {#libglycin-hook-variables-controlling}
### `glycinCargoDepsPath` {#glycin-cargo-deps-path}
Path to a directory containing the `glycin` crate to patch. Defaults to the crate directory created by `cargoSetupHook`, or `./vendor/`.
### `dontWrapGlycinLoaders` {#glycin-dont-wrap}
Disable adding the Glycin loaders path `XDG_DATA_DIRS` with `wrapGAppsHook`.
|