Unverified Commit a4c91807 authored by Jan Tojnar's avatar Jan Tojnar Committed by GitHub
Browse files

libglycin-gtk4: init (split out of libglycin) (#481377)

parents 534c232c 8f65f524
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -22,6 +22,7 @@ haredo.section.md
installShellFiles.section.md
julec.section.md
just.section.md
libglycin.section.md
libiconv.section.md
libxml2.section.md
meson.section.md
+47 −0
Original line number Diff line number Diff line
# 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`.
+2 −0
Original line number Diff line number Diff line
@@ -129,6 +129,8 @@ The hooks do the following:

- []{#ssec-gnome-hooks-gst-grl-plugins} Setup hooks of `gst_all_1.gstreamer` and `grilo` will populate the `GST_PLUGIN_SYSTEM_PATH_1_0` and `GRL_PLUGIN_PATH` variables, respectively, which will then be added to the wrapper by `wrapGApps*` hook.

- []{#ssec-gnome-hooks-libglycin} `libglycin`'s [setup hook](#libglycin-setup-hook) will populate `XDG_DATA_DIRS` with the path to the loaders.

You can also pass additional arguments to `makeWrapper` using `gappsWrapperArgs` in `preFixup` hook:

```nix
+24 −0
Original line number Diff line number Diff line
@@ -2473,6 +2473,27 @@
  "setup-hook-gdk-pixbuf": [
    "index.html#setup-hook-gdk-pixbuf"
  ],
  "libglycin-hooks": [
    "index.html#libglycin-hooks"
  ],
  "libglycin-setup-hook": [
    "index.html#libglycin-setup-hook"
  ],
  "libglycin-patch-vendor-hook": [
    "index.html#libglycin-patch-vendor-hook"
  ],
  "libglycin-hooks-example-code-snippet": [
    "index.html#libglycin-hooks-example-code-snippet"
  ],
  "libglycin-hook-variables-controlling": [
    "index.html#libglycin-hook-variables-controlling"
  ],
  "glycin-cargo-deps-path": [
    "index.html#glycin-cargo-deps-path"
  ],
  "glycin-dont-wrap": [
    "index.html#glycin-dont-wrap"
  ],
  "ghc": [
    "index.html#ghc"
  ],
@@ -3173,6 +3194,9 @@
  "ssec-gnome-hooks-gst-grl-plugins": [
    "index.html#ssec-gnome-hooks-gst-grl-plugins"
  ],
  "ssec-gnome-hooks-libglycin": [
    "index.html#ssec-gnome-hooks-libglycin"
  ],
  "ssec-gnome-updating": [
    "index.html#ssec-gnome-updating"
  ],
+0 −3
Original line number Diff line number Diff line
@@ -21,7 +21,6 @@
  sqlite,
  wayland,
  zbar,
  glycin-loaders,
  nix-update-script,
}:

@@ -78,8 +77,6 @@ stdenv.mkDerivation (finalAttrs: {
    gappsWrapperArgs+=(
      # vp8enc preset
      --prefix GST_PRESET_PATH : "${gst_all_1.gst-plugins-good}/share/gstreamer-1.0/presets"
      # See https://gitlab.gnome.org/sophie-h/glycin/-/blob/0.1.beta.2/glycin/src/config.rs#L44
      --prefix XDG_DATA_DIRS : "${glycin-loaders}/share"
    )
  '';

Loading