Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
344f0b7
authenticator: remove unneeded glycin-loaders dependency
getchoo Aug 20, 2025
b8b9586
bazaar: Remove pointless glycin patch passthru
jtojnar Jan 18, 2026
0df3f73
recordbox: Inline glycin patch
jtojnar Jan 18, 2026
20db24b
libglycin: Split outputs
jtojnar Jan 18, 2026
c68c6af
libglycin: Add setup hook for patching Rust vendor directory
pluiedev Dec 12, 2024
1def697
libglycin: Introduce setup hook for adding loader paths to wrapper
pluiedev Dec 12, 2024
7ea919b
libglycin: Use our setup hook for patching vendor directory
jtojnar Jan 18, 2026
0d016ba
fractal: Use glycin setup hooks
pluiedev Dec 12, 2024
7549757
loupe: Switch to new glycin setup hook
pluiedev Dec 12, 2024
9d55157
snapshot: Switch to new glycin setup hook
pluiedev Dec 12, 2024
30bd058
libglycin: Remove glycin3PathsPatch
jtojnar Jan 18, 2026
df85a0c
libglycin: Use GNOME tarball as a source
jtojnar Jan 17, 2026
1fc6c69
glycin-loaders: Remove unused git
jtojnar Jan 18, 2026
0072537
glycin-loaders: Use source from libglycin
jtojnar Jan 17, 2026
9830254
libglycin: Correct dependencies
jtojnar Jan 18, 2026
67d6a23
libglycin: Do not require /usr
jtojnar Jan 18, 2026
7be95de
glycin-loaders: Move tests dependencies to `checkInputs`
jtojnar Jan 18, 2026
b55a110
libglycin-gtk4: init (split out of libglycin)
jtojnar Jan 18, 2026
7374751
gst-thumbnailers: Rely on libglycin setup hook
jtojnar Jan 19, 2026
53f2f74
bazaar: Rely on libglycin setup hook
jtojnar Jan 19, 2026
93f86d1
turntable: Rely on libglycin setup hook
jtojnar Jan 19, 2026
f0b96b9
valent: Rely on libglycin setup hook
jtojnar Jan 19, 2026
8f65f52
constrict: Rely on libglycin setup hook
jtojnar Jan 19, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions doc/hooks/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
47 changes: 47 additions & 0 deletions doc/hooks/libglycin.section.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,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`.
2 changes: 2 additions & 0 deletions doc/languages-frameworks/gnome.section.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
24 changes: 24 additions & 0 deletions doc/redirects.json
Original file line number Diff line number Diff line change
Expand Up @@ -2468,6 +2468,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"
],
Expand Down Expand Up @@ -3158,6 +3179,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"
],
Expand Down
3 changes: 0 additions & 3 deletions pkgs/by-name/au/authenticator/package.nix
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Everything seems to work the same without glycin-loaders.

Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
sqlite,
wayland,
zbar,
glycin-loaders,
nix-update-script,
}:

Expand Down Expand Up @@ -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"
)
'';

Expand Down
12 changes: 3 additions & 9 deletions pkgs/by-name/ba/bazaar/package.nix
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
pkg-config,
wrapGAppsHook4,
appstream,
bubblewrap,
flatpak,
glib-networking,
glycin-loaders,
Expand All @@ -18,6 +17,7 @@
libadwaita,
libdex,
libglycin,
libglycin-gtk4,
libsoup_3,
libxmlb,
libyaml,
Expand Down Expand Up @@ -56,6 +56,8 @@ stdenv.mkDerivation (finalAttrs: {
libadwaita
libdex
libglycin
libglycin-gtk4
glycin-loaders
libsoup_3
libxmlb
libyaml
Expand All @@ -64,15 +66,7 @@ stdenv.mkDerivation (finalAttrs: {
libsecret
];

preFixup = ''
gappsWrapperArgs+=(
--prefix PATH : "$out/bin:${lib.makeBinPath [ bubblewrap ]}"
--prefix XDG_DATA_DIRS : "${glycin-loaders}/share"
)
'';

passthru = {
inherit (libglycin) glycinPathsPatch;
updateScript = nix-update-script { };
};

Expand Down
4 changes: 3 additions & 1 deletion pkgs/by-name/co/constrict/package.nix
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
desktop-file-utils,
libadwaita,
libglycin,
libglycin-gtk4,
libva-utils,
ffmpeg,
gst-thumbnailers,
Expand Down Expand Up @@ -42,6 +43,8 @@ python3Packages.buildPythonApplication (finalAttrs: {
buildInputs = [
libadwaita
libglycin
libglycin-gtk4
glycin-loaders
];

dependencies = [
Expand All @@ -60,7 +63,6 @@ python3Packages.buildPythonApplication (finalAttrs: {
preFixup = ''
makeWrapperArgs+=(
''${gappsWrapperArgs[@]}
--prefix XDG_DATA_DIRS : "${glycin-loaders}/share"
--prefix PATH : ${lib.makeBinPath finalAttrs.runtimeDeps}
)
'';
Expand Down
12 changes: 4 additions & 8 deletions pkgs/by-name/fr/fractal/package.nix
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,10 @@
libshumate,
wrapGAppsHook4,
blueprint-compiler,
bubblewrap,
sqlite,
xdg-desktop-portal,
libseccomp,
libglycin,
glycin-loaders,
libwebp,
}:
Expand Down Expand Up @@ -64,6 +64,7 @@ stdenv.mkDerivation (finalAttrs: {
glib
grass-sass
gtk4
libglycin.patchVendorHook
meson
ninja
pkg-config
Expand All @@ -79,6 +80,8 @@ stdenv.mkDerivation (finalAttrs: {

buildInputs = [
glib
libglycin.setupHook
glycin-loaders
gtk4
gtksourceview5
lcms2
Expand All @@ -99,13 +102,6 @@ stdenv.mkDerivation (finalAttrs: {
gst-plugins-rs
]);

preFixup = ''
gappsWrapperArgs+=(
--prefix XDG_DATA_DIRS : "${glycin-loaders}/share"
--prefix PATH : "${lib.makeBinPath [ bubblewrap ]}"
)
'';

env.CARGO_BUILD_TARGET = stdenv.hostPlatform.rust.rustcTargetSpec;

passthru = {
Expand Down
84 changes: 37 additions & 47 deletions pkgs/by-name/gl/glycin-loaders/package.nix
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
{
stdenv,
lib,
fetchurl,
cairo,
cargo,
gettext,
git,
gnome,
glib,
gtk4,
libglycin,
lcms2,
libheif,
libjxl,
Expand All @@ -17,95 +16,86 @@
meson,
ninja,
pkg-config,
python3,
shared-mime-info,
rustc,
rustPlatform,
common-updater-scripts,
_experimental-update-script-combinators,
}:

stdenv.mkDerivation (finalAttrs: {
pname = "glycin-loaders";
version = "2.0.7";

src = fetchurl {
url = "mirror://gnome/sources/glycin/${lib.versions.majorMinor finalAttrs.version}/glycin-${finalAttrs.version}.tar.xz";
hash = "sha256-xBasKbbT7NxnuQwVU3uhKTzrevlvoQHK5nt9HTflCrA=";
};

cargoDeps = rustPlatform.fetchCargoVendor {
inherit (finalAttrs) src;
name = "glycin-loaders-deps-${finalAttrs.version}";
hash = "sha256-UVVVjMt4vWkLob0H/MxIaW6rkBSFImu+5dezaCnc3Q8=";
dontConfigure = true;
};
inherit (libglycin) version src cargoDeps;

nativeBuildInputs = [
cargo
gettext # for msgfmt
git
meson
ninja
pkg-config
rustc
rustPlatform.cargoSetupHook
]
++ lib.optionals finalAttrs.finalPackage.doCheck [
python3
# Tests use Rust glycin library.
libglycin.patchVendorHook
];

buildInputs = [
gtk4 # for GdkTexture
cairo
lcms2
libheif
libxml2 # for librsvg crate
librsvg
libseccomp
libjxl
];

# Tests in passthru.tests to avoid dependency cycles.
checkInputs = [
glib
gtk4
lcms2
];

mesonFlags = [
"-Dglycin-loaders=true"
"-Dglycin-thumbnailer=false"
"-Dlibglycin=false"
"-Dlibglycin-gtk4=false"
"-Dvapi=false"
(lib.mesonBool "tests" finalAttrs.finalPackage.doCheck)
];

strictDeps = true;

postPatch = ''
substituteInPlace glycin-loaders/meson.build \
--replace-fail "cargo_target_dir / rust_target / loader," "cargo_target_dir / '${stdenv.hostPlatform.rust.cargoShortTarget}' / rust_target / loader,"
''
+ lib.optionalString finalAttrs.finalPackage.doCheck ''
chmod +x build-aux/setup-integration-test.py

patchShebangs \
build-aux/setup-integration-test.py
'';

preCheck = lib.optionalString finalAttrs.finalPackage.doCheck ''
# Fix test files being considered application/octet-stream
export XDG_DATA_DIRS=${shared-mime-info}/share:$XDG_DATA_DIRS

# fonts test will not be able to create cache without this
export XDG_CACHE_HOME=$(mktemp -d)
'';

env.CARGO_BUILD_TARGET = stdenv.hostPlatform.rust.rustcTargetSpec;

passthru = {
updateScript =
let
updateSource = gnome.updateScript {
attrPath = "glycin-loaders";
packageName = "glycin";
};
updateLockfile = {
command = [
"sh"
"-c"
''
PATH=${
lib.makeBinPath [
common-updater-scripts
]
}
update-source-version glycin-loaders --ignore-same-version --source-key=cargoDeps.vendorStaging > /dev/null
''
];
# Experimental feature: do not copy!
supportedFeatures = [ "silent" ];
};
in
_experimental-update-script-combinators.sequence [
updateSource
updateLockfile
];
tests = {
withTests = finalAttrs.finalPackage.overrideAttrs {
doCheck = true;
};
};
};

meta = {
Expand Down
7 changes: 1 addition & 6 deletions pkgs/by-name/gs/gst-thumbnailers/package.nix
Original file line number Diff line number Diff line change
Expand Up @@ -49,14 +49,9 @@ stdenv.mkDerivation (finalAttrs: {
gst_all_1.gst-plugins-ugly
fontconfig
libglycin
glycin-loaders
];

preFixup = ''
gappsWrapperArgs+=(
--prefix XDG_DATA_DIRS : "${glycin-loaders}/share"
)
'';

meta = {
description = "Generate thumbnailer for video and audio files";
homepage = "https://gitlab.gnome.org/GNOME/gst-thumbnailers";
Expand Down
Loading
Loading