From 344f0b7bba042a63bcdf033e14ebfcf3c24b2dd1 Mon Sep 17 00:00:00 2001 From: Seth Flynn Date: Wed, 20 Aug 2025 18:41:02 -0400 Subject: [PATCH 01/23] authenticator: remove unneeded glycin-loaders dependency Most likely copy-pasta. --- pkgs/by-name/au/authenticator/package.nix | 3 --- 1 file changed, 3 deletions(-) diff --git a/pkgs/by-name/au/authenticator/package.nix b/pkgs/by-name/au/authenticator/package.nix index 082bada63e83..d17ae0756f47 100644 --- a/pkgs/by-name/au/authenticator/package.nix +++ b/pkgs/by-name/au/authenticator/package.nix @@ -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" ) ''; From b8b9586f402a08093999842451b2c9291677bfc5 Mon Sep 17 00:00:00 2001 From: Jan Tojnar Date: Sun, 18 Jan 2026 16:07:44 +0100 Subject: [PATCH 02/23] bazaar: Remove pointless glycin patch passthru This appears to have been accidentally introduced in 9a5911842896bf53d9c7c6687ce85e5358cab922. --- pkgs/by-name/ba/bazaar/package.nix | 1 - 1 file changed, 1 deletion(-) diff --git a/pkgs/by-name/ba/bazaar/package.nix b/pkgs/by-name/ba/bazaar/package.nix index ac2d8b37cb26..25a2e377407e 100644 --- a/pkgs/by-name/ba/bazaar/package.nix +++ b/pkgs/by-name/ba/bazaar/package.nix @@ -72,7 +72,6 @@ stdenv.mkDerivation (finalAttrs: { ''; passthru = { - inherit (libglycin) glycinPathsPatch; updateScript = nix-update-script { }; }; From 0df3f73d70aa75859628e5243372427728a89d74 Mon Sep 17 00:00:00 2001 From: Jan Tojnar Date: Sun, 18 Jan 2026 16:12:13 +0100 Subject: [PATCH 03/23] recordbox: Inline glycin patch We are going to switch to a setup hook and this is the last user of the glycin 2 patch. It probably does not work anyway because it uses glycin 3 loaders. --- pkgs/by-name/li/libglycin/package.nix | 4 ---- .../libglycin => re/recordbox}/fix-glycin-paths.patch | 0 pkgs/by-name/re/recordbox/package.nix | 11 +++++++++-- 3 files changed, 9 insertions(+), 6 deletions(-) rename pkgs/by-name/{li/libglycin => re/recordbox}/fix-glycin-paths.patch (100%) diff --git a/pkgs/by-name/li/libglycin/package.nix b/pkgs/by-name/li/libglycin/package.nix index ff497becdea5..0ee2b5a82b9b 100644 --- a/pkgs/by-name/li/libglycin/package.nix +++ b/pkgs/by-name/li/libglycin/package.nix @@ -113,10 +113,6 @@ stdenv.mkDerivation (finalAttrs: { updateLockfile ]; - glycinPathsPatch = replaceVars ./fix-glycin-paths.patch { - bwrap = "${bubblewrap}/bin/bwrap"; - }; - glycin3PathsPatch = replaceVars ./fix-glycin-3-paths.patch { bwrap = "${bubblewrap}/bin/bwrap"; }; diff --git a/pkgs/by-name/li/libglycin/fix-glycin-paths.patch b/pkgs/by-name/re/recordbox/fix-glycin-paths.patch similarity index 100% rename from pkgs/by-name/li/libglycin/fix-glycin-paths.patch rename to pkgs/by-name/re/recordbox/fix-glycin-paths.patch diff --git a/pkgs/by-name/re/recordbox/package.nix b/pkgs/by-name/re/recordbox/package.nix index 0678773dacd5..7f6a77a9b37f 100644 --- a/pkgs/by-name/re/recordbox/package.nix +++ b/pkgs/by-name/re/recordbox/package.nix @@ -3,12 +3,12 @@ stdenv, appstream-glib, blueprint-compiler, + bubblewrap, cargo, dbus, desktop-file-utils, fetchFromGitea, glib, - libglycin, glycin-loaders, gst_all_1, gtk4, @@ -21,12 +21,19 @@ ninja, nix-update-script, pkg-config, + replaceVars, rustPlatform, rustc, sqlite, wrapGAppsHook4, }: +let + glycinPathsPatch = replaceVars ./fix-glycin-paths.patch { + bwrap = "${bubblewrap}/bin/bwrap"; + }; +in + stdenv.mkDerivation (finalAttrs: { pname = "recordbox"; version = "0.10.4"; @@ -91,7 +98,7 @@ stdenv.mkDerivation (finalAttrs: { # Dirty approach to add patches after cargoSetupPostUnpackHook # We should eventually use a cargo vendor patch hook instead pushd ../$(stripHash $cargoDeps)/glycin-2.* - patch -p3 < ${libglycin.passthru.glycinPathsPatch} + patch -p3 < ${glycinPathsPatch} popd ''; preFixup = '' From 20db24b45f576b5ed8c64fb8da3f6f88ea72d060 Mon Sep 17 00:00:00 2001 From: Jan Tojnar Date: Sun, 18 Jan 2026 17:24:10 +0100 Subject: [PATCH 04/23] libglycin: Split outputs Avoid pulling in headers, and prepare for setup hook. --- pkgs/by-name/li/libglycin/package.nix | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/pkgs/by-name/li/libglycin/package.nix b/pkgs/by-name/li/libglycin/package.nix index 0ee2b5a82b9b..85036a505e75 100644 --- a/pkgs/by-name/li/libglycin/package.nix +++ b/pkgs/by-name/li/libglycin/package.nix @@ -29,6 +29,12 @@ stdenv.mkDerivation (finalAttrs: { pname = "libglycin"; version = "2.0.7"; + outputs = [ + "out" + "dev" + "devdoc" + ]; + src = fetchFromGitLab { domain = "gitlab.gnome.org"; owner = "GNOME"; @@ -84,6 +90,11 @@ stdenv.mkDerivation (finalAttrs: { build-aux/crates-version.py ''; + postFixup = '' + # Cannot be in postInstall, otherwise _multioutDocs hook in preFixup will move right back. + moveToOutput "share/doc" "$devdoc" + ''; + passthru = { updateScript = let From c68c6af86cd171134c4014f0f5554890c585c6f3 Mon Sep 17 00:00:00 2001 From: Leah Amelia Chen Date: Thu, 12 Dec 2024 12:41:58 +0100 Subject: [PATCH 05/23] libglycin: Add setup hook for patching Rust vendor directory Glycin rust library searches `bwrap` on path. This would require every reverse dependency to add `bubblewrap` to its `PATH`, which would be quite annoying to ensure. Especially when libraries start using glycin. We provide `passthru.glycinPathsPatch` to perform source-level hardcoding but that doesn't work with apps that use `rustPlatform.cargoSetupHook` since it assumes a setup where snapshots of GNOME sources already contain vendored Rust dependencies under `vendor/`. The setup hook instead provides a much more flexible approach that uses the `$cargoDepsCopy` variable provided by `cargoSetupHook`, which points to the local, modifiable copy of Cargo dependencies, to patch `src/sandbox.rs` just like `glycinPathsPatch`. If `$cargoDepsCopy` is not found, then the old behavior is used where Cargo dependencies are assumed to be under `vendor/`. Additionally, the patch requires modifying `Cargo.lock` when using `rustPlatform.fetchCargoVendor`. The setup hook fixes that as well. Rust programs just need to add `libglycin.patchVendorHook` and it should take care of this. Co-authored-by: Seth Flynn Co-authored-by: Jan Tojnar --- doc/hooks/index.md | 1 + doc/hooks/libglycin.section.md | 44 +++++++++++++++++++ doc/redirects.json | 15 +++++++ pkgs/by-name/li/libglycin/package.nix | 16 +++++++ .../by-name/li/libglycin/patch-vendor-hook.sh | 38 ++++++++++++++++ 5 files changed, 114 insertions(+) create mode 100644 doc/hooks/libglycin.section.md create mode 100644 pkgs/by-name/li/libglycin/patch-vendor-hook.sh diff --git a/doc/hooks/index.md b/doc/hooks/index.md index cd769cec0373..e7b5972c84d7 100644 --- a/doc/hooks/index.md +++ b/doc/hooks/index.md @@ -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 diff --git a/doc/hooks/libglycin.section.md b/doc/hooks/libglycin.section.md new file mode 100644 index 000000000000..a758c1f08d7f --- /dev/null +++ b/doc/hooks/libglycin.section.md @@ -0,0 +1,44 @@ +# libglycin {#libglycin-hooks} + +[Glycin](https://gitlab.gnome.org/GNOME/glycin) is a library for sandboxed and extendable image loading. + +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-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 + ]; + + preFixup = '' + gappsWrapperArgs+=( + --prefix XDG_DATA_DIRS : "${glycin-loaders}/share" + ) + ''; + + # ... +} +``` + +## 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/`. diff --git a/doc/redirects.json b/doc/redirects.json index cbff4ea2f226..31896397c31f 100644 --- a/doc/redirects.json +++ b/doc/redirects.json @@ -2468,6 +2468,21 @@ "setup-hook-gdk-pixbuf": [ "index.html#setup-hook-gdk-pixbuf" ], + "libglycin-hooks": [ + "index.html#libglycin-hooks" + ], + "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" + ], "ghc": [ "index.html#ghc" ], diff --git a/pkgs/by-name/li/libglycin/package.nix b/pkgs/by-name/li/libglycin/package.nix index 85036a505e75..137e8aa9eaff 100644 --- a/pkgs/by-name/li/libglycin/package.nix +++ b/pkgs/by-name/li/libglycin/package.nix @@ -2,6 +2,7 @@ lib, stdenv, fetchFromGitLab, + makeSetupHook, meson, ninja, pkg-config, @@ -18,6 +19,8 @@ gnome, replaceVars, bubblewrap, + jq, + moreutils, common-updater-scripts, _experimental-update-script-combinators, buildPackages, @@ -127,6 +130,19 @@ stdenv.mkDerivation (finalAttrs: { glycin3PathsPatch = replaceVars ./fix-glycin-3-paths.patch { bwrap = "${bubblewrap}/bin/bwrap"; }; + + patchVendorHook = + makeSetupHook + { + name = "glycinPatchVendorHook"; + } + ( + replaceVars ./patch-vendor-hook.sh { + bwrap = "${bubblewrap}/bin/bwrap"; + jq = "${jq}/bin/jq"; + sponge = "${moreutils}/bin/sponge"; + } + ); }; meta = { diff --git a/pkgs/by-name/li/libglycin/patch-vendor-hook.sh b/pkgs/by-name/li/libglycin/patch-vendor-hook.sh new file mode 100644 index 000000000000..1ba389614f2e --- /dev/null +++ b/pkgs/by-name/li/libglycin/patch-vendor-hook.sh @@ -0,0 +1,38 @@ +libglycinPatchVendorHook() { + echo "executing libglycinPatchVendorHook" + + local glycinPath + + if [[ -z ${glycinCargoDepsPath:-} ]]; then + # When cargoSetupHook is used, `cargoDepsCopy` would be set and preferred. + # Otherwise, fallback to vendor/ + local cargoDepsPath=${cargoDepsCopy:-vendor} + fi + + while read -r path; do + # Ensure the paths we're patching exist (and that this crate probably isn't something like glycin-utils) + if [[ -f $path/src/sandbox.rs ]]; then + glycinPath="$path" + break + fi + done < <(find "$cargoDepsPath" -type d -name 'glycin*') + + if [[ -z ${glycinPath:-} ]]; then + echo >&2 "error: glycin was not found within the cargo dependencies at '$cargoDepsPath'." + echo >&2 "are you sure libglycin.patchVendorHook is still required?" + exit 1 + fi + echo "patching glycin crate at '$glycinPath'" + + substituteInPlace "$glycinPath/src/sandbox.rs" \ + --replace-fail '"bwrap"' '"@bwrap@"' + + # Replace hash of file we patch in vendored glycin. + @jq@ \ + --arg hash "$(sha256sum "$glycinPath/src/sandbox.rs" | cut -d' ' -f 1)" \ + '.files."src/sandbox.rs" = $hash' \ + "$glycinPath/.cargo-checksum.json" | + @sponge@ "$glycinPath/.cargo-checksum.json" +} + +prePatchHooks+=(libglycinPatchVendorHook) From 1def69720c0ca26c3f3238622f8c535a2ba764a7 Mon Sep 17 00:00:00 2001 From: Leah Amelia Chen Date: Thu, 12 Dec 2024 12:41:58 +0100 Subject: [PATCH 06/23] libglycin: Introduce setup hook for adding loader paths to wrapper MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This setup hook discovers glycin loaders in the inputs list it is placed into, and adds them to `gappsWrapperArgs`. This should simplify glycin-dependent programs’ expressions. Just add `libglycin.setupHook` (for Rust programs) or `libglycin` (for other languages) to `buildInputs`. The latter will also pull in the setup hook. Note, the setup hook needs to go to the `buildInputs` since we cannot have a different offset when used as standalone hook instead of propagated from `libglycin`. We chose `hostOffset` to make it work with the proper placement of `libglycin` in `buildInputs`. Co-authored-by: Seth Flynn Co-authored-by: Jan Tojnar --- doc/hooks/libglycin.section.md | 15 +++++++++------ doc/languages-frameworks/gnome.section.md | 2 ++ doc/redirects.json | 9 +++++++++ pkgs/by-name/li/libglycin/package.nix | 2 ++ pkgs/by-name/li/libglycin/path-hook.sh | 18 ++++++++++++++++++ 5 files changed, 40 insertions(+), 6 deletions(-) create mode 100644 pkgs/by-name/li/libglycin/path-hook.sh diff --git a/doc/hooks/libglycin.section.md b/doc/hooks/libglycin.section.md index a758c1f08d7f..48c52e1b4036 100644 --- a/doc/hooks/libglycin.section.md +++ b/doc/hooks/libglycin.section.md @@ -2,7 +2,7 @@ [Glycin](https://gitlab.gnome.org/GNOME/glycin) is a library for sandboxed and extendable image loading. -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-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. @@ -27,11 +27,10 @@ rustPlatform.buildRustPackage { libglycin.patchVendorHook ]; - preFixup = '' - gappsWrapperArgs+=( - --prefix XDG_DATA_DIRS : "${glycin-loaders}/share" - ) - ''; + buildInputs = [ + libglycin.setupHook + glycin-loaders + ]; # ... } @@ -42,3 +41,7 @@ rustPlatform.buildRustPackage { ### `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`. diff --git a/doc/languages-frameworks/gnome.section.md b/doc/languages-frameworks/gnome.section.md index 252f7ea3dea7..ecfda62b5700 100644 --- a/doc/languages-frameworks/gnome.section.md +++ b/doc/languages-frameworks/gnome.section.md @@ -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 diff --git a/doc/redirects.json b/doc/redirects.json index 31896397c31f..4bb444117189 100644 --- a/doc/redirects.json +++ b/doc/redirects.json @@ -2471,6 +2471,9 @@ "libglycin-hooks": [ "index.html#libglycin-hooks" ], + "libglycin-setup-hook": [ + "index.html#libglycin-setup-hook" + ], "libglycin-patch-vendor-hook": [ "index.html#libglycin-patch-vendor-hook" ], @@ -2483,6 +2486,9 @@ "glycin-cargo-deps-path": [ "index.html#glycin-cargo-deps-path" ], + "glycin-dont-wrap": [ + "index.html#glycin-dont-wrap" + ], "ghc": [ "index.html#ghc" ], @@ -3173,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" ], diff --git a/pkgs/by-name/li/libglycin/package.nix b/pkgs/by-name/li/libglycin/package.nix index 137e8aa9eaff..ca0310b0a27f 100644 --- a/pkgs/by-name/li/libglycin/package.nix +++ b/pkgs/by-name/li/libglycin/package.nix @@ -38,6 +38,8 @@ stdenv.mkDerivation (finalAttrs: { "devdoc" ]; + setupHook = ./path-hook.sh; + src = fetchFromGitLab { domain = "gitlab.gnome.org"; owner = "GNOME"; diff --git a/pkgs/by-name/li/libglycin/path-hook.sh b/pkgs/by-name/li/libglycin/path-hook.sh new file mode 100644 index 000000000000..19de8ecfbec2 --- /dev/null +++ b/pkgs/by-name/li/libglycin/path-hook.sh @@ -0,0 +1,18 @@ +find_glycin_loader_paths() { + if [ -d "$1/share/glycin-loaders" ]; then + addToSearchPath NIX_GLYCIN_LOADER_PATHS $1/share + fi +} + +addEnvHooks "$hostOffset" find_glycin_loader_paths + +glycinLoadersWrapperArgsHook() { + echo "executing glycinLoadersWrapperArgsHook" + if [[ -n "$NIX_GLYCIN_LOADER_PATHS" ]]; then + gappsWrapperArgs+=(--prefix XDG_DATA_DIRS : "$NIX_GLYCIN_LOADER_PATHS") + fi +} + +if [[ -z ${dontWrapGlycinLoaders:-} ]]; then + preFixupPhases+=(glycinLoadersWrapperArgsHook) +fi From 7ea919b7bee21eae8f64271297f91d43f4d845a0 Mon Sep 17 00:00:00 2001 From: Jan Tojnar Date: Sun, 18 Jan 2026 18:26:23 +0100 Subject: [PATCH 07/23] libglycin: Use our setup hook for patching vendor directory Prepare for the imminent removal of the patch. --- pkgs/by-name/li/libglycin/package.nix | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/pkgs/by-name/li/libglycin/package.nix b/pkgs/by-name/li/libglycin/package.nix index ca0310b0a27f..fb58547f0b5c 100644 --- a/pkgs/by-name/li/libglycin/package.nix +++ b/pkgs/by-name/li/libglycin/package.nix @@ -56,6 +56,7 @@ stdenv.mkDerivation (finalAttrs: { cargo python3 rustPlatform.cargoSetupHook + finalAttrs.passthru.patchVendorHook ] ++ lib.optionals withIntrospection [ vala @@ -89,8 +90,6 @@ stdenv.mkDerivation (finalAttrs: { ]; postPatch = '' - patch -p2 < ${finalAttrs.passthru.glycin3PathsPatch} - patchShebangs \ build-aux/crates-version.py ''; From 0d016baaa72028568acb4cccf7959af17bf9dcc7 Mon Sep 17 00:00:00 2001 From: Leah Amelia Chen Date: Thu, 12 Dec 2024 12:41:58 +0100 Subject: [PATCH 08/23] fractal: Use glycin setup hooks Instead of manually setting wrapper variables. The `patchVendorHook` ensures the library has bubblewrap properly set. --- pkgs/by-name/fr/fractal/package.nix | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/pkgs/by-name/fr/fractal/package.nix b/pkgs/by-name/fr/fractal/package.nix index 57e2d580238e..2aae752c96e6 100644 --- a/pkgs/by-name/fr/fractal/package.nix +++ b/pkgs/by-name/fr/fractal/package.nix @@ -23,10 +23,10 @@ libshumate, wrapGAppsHook4, blueprint-compiler, - bubblewrap, sqlite, xdg-desktop-portal, libseccomp, + libglycin, glycin-loaders, libwebp, }: @@ -64,6 +64,7 @@ stdenv.mkDerivation (finalAttrs: { glib grass-sass gtk4 + libglycin.patchVendorHook meson ninja pkg-config @@ -79,6 +80,8 @@ stdenv.mkDerivation (finalAttrs: { buildInputs = [ glib + libglycin.setupHook + glycin-loaders gtk4 gtksourceview5 lcms2 @@ -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 = { From 7549757c8f09774dbc92b4f39dacb890ebb2cf1c Mon Sep 17 00:00:00 2001 From: Leah Amelia Chen Date: Thu, 12 Dec 2024 12:41:58 +0100 Subject: [PATCH 09/23] loupe: Switch to new glycin setup hook --- pkgs/by-name/lo/loupe/package.nix | 19 +++---------------- 1 file changed, 3 insertions(+), 16 deletions(-) diff --git a/pkgs/by-name/lo/loupe/package.nix b/pkgs/by-name/lo/loupe/package.nix index 8b08bc09e80f..d441f1708c7f 100644 --- a/pkgs/by-name/lo/loupe/package.nix +++ b/pkgs/by-name/lo/loupe/package.nix @@ -48,6 +48,7 @@ stdenv.mkDerivation (finalAttrs: { cargo desktop-file-utils itstool + libglycin.patchVendorHook meson ninja pkg-config @@ -57,6 +58,8 @@ stdenv.mkDerivation (finalAttrs: { ]; buildInputs = [ + libglycin.setupHook + glycin-loaders gtk4 lcms2 libadwaita @@ -64,22 +67,6 @@ stdenv.mkDerivation (finalAttrs: { libseccomp ]; - preConfigure = '' - # Dirty approach to add patches after cargoSetupPostUnpackHook - # We should eventually use a cargo vendor patch hook instead - pushd ../$(stripHash $cargoDeps)/glycin-3.* - patch -p3 < ${libglycin.passthru.glycin3PathsPatch} - popd - ''; - - preFixup = '' - # Needed for the glycin crate to find loaders. - # https://gitlab.gnome.org/sophie-h/glycin/-/blob/0.1.beta.2/glycin/src/config.rs#L44 - gappsWrapperArgs+=( - --prefix XDG_DATA_DIRS : "${glycin-loaders}/share" - ) - ''; - # For https://gitlab.gnome.org/GNOME/loupe/-/blob/0e6ddb0227ac4f1c55907f8b43eaef4bb1d3ce70/src/meson.build#L34-35 env.CARGO_BUILD_TARGET = stdenv.hostPlatform.rust.rustcTargetSpec; From 9d5515710bd292541c5a274a56bef2cc8f2905df Mon Sep 17 00:00:00 2001 From: Leah Amelia Chen Date: Thu, 12 Dec 2024 12:41:58 +0100 Subject: [PATCH 10/23] snapshot: Switch to new glycin setup hook --- pkgs/by-name/sn/snapshot/package.nix | 21 +++------------------ 1 file changed, 3 insertions(+), 18 deletions(-) diff --git a/pkgs/by-name/sn/snapshot/package.nix b/pkgs/by-name/sn/snapshot/package.nix index 27f72987a679..449fe3e4e350 100644 --- a/pkgs/by-name/sn/snapshot/package.nix +++ b/pkgs/by-name/sn/snapshot/package.nix @@ -6,9 +6,7 @@ glycin-loaders, cargo, desktop-file-utils, - jq, meson, - moreutils, ninja, pkg-config, rustc, @@ -34,19 +32,13 @@ stdenv.mkDerivation (finalAttrs: { hash = "sha256-NVj2+ODTiylQtrrZue7COCSb7f7c5w+1iijK1pRebOk="; }; - patches = [ - # Fix paths in glycin library - libglycin.passthru.glycin3PathsPatch - ]; - cargoVendorDir = "vendor"; nativeBuildInputs = [ cargo desktop-file-utils - jq + libglycin.patchVendorHook meson - moreutils # sponge is used in postPatch ninja pkg-config rustc @@ -56,6 +48,8 @@ stdenv.mkDerivation (finalAttrs: { buildInputs = [ glib + libglycin.setupHook + glycin-loaders gst_all_1.gst-plugins-bad gst_all_1.gst-plugins-base gst_all_1.gst-plugins-good @@ -70,13 +64,6 @@ stdenv.mkDerivation (finalAttrs: { ]; postPatch = '' - # Replace hash of file we patch in vendored glycin. - jq \ - --arg hash "$(sha256sum vendor/glycin/src/sandbox.rs | cut -d' ' -f 1)" \ - '.files."src/sandbox.rs" = $hash' \ - vendor/glycin/.cargo-checksum.json \ - | sponge vendor/glycin/.cargo-checksum.json - substituteInPlace src/meson.build --replace-fail \ "'src' / rust_target / meson.project_name()" \ "'src' / '${stdenv.hostPlatform.rust.cargoShortTarget}' / rust_target / meson.project_name()" @@ -86,8 +73,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" ) ''; From 30bd0581fc1197692c72d71866f2258b62692d2e Mon Sep 17 00:00:00 2001 From: Jan Tojnar Date: Sun, 18 Jan 2026 17:50:44 +0100 Subject: [PATCH 11/23] libglycin: Remove glycin3PathsPatch It is now unused as it has been superseded by the setup hook. --- pkgs/by-name/li/libglycin/fix-glycin-3-paths.patch | 13 ------------- pkgs/by-name/li/libglycin/package.nix | 4 ---- 2 files changed, 17 deletions(-) delete mode 100644 pkgs/by-name/li/libglycin/fix-glycin-3-paths.patch diff --git a/pkgs/by-name/li/libglycin/fix-glycin-3-paths.patch b/pkgs/by-name/li/libglycin/fix-glycin-3-paths.patch deleted file mode 100644 index 35b22f06fa36..000000000000 --- a/pkgs/by-name/li/libglycin/fix-glycin-3-paths.patch +++ /dev/null @@ -1,13 +0,0 @@ -diff --git a/vendor/glycin/src/sandbox.rs b/vendor/glycin/src/sandbox.rs -index 90cd5f6..17a6469 100644 ---- a/vendor/glycin/src/sandbox.rs -+++ b/vendor/glycin/src/sandbox.rs -@@ -251,7 +251,7 @@ impl Sandbox { - } - - async fn bwrap_command(&self, seccomp_memfd: &Memfd) -> Result { -- let mut command = Command::new("bwrap"); -+ let mut command = Command::new("@bwrap@"); - - command.args([ - "--unshare-all", diff --git a/pkgs/by-name/li/libglycin/package.nix b/pkgs/by-name/li/libglycin/package.nix index fb58547f0b5c..8429f754c17d 100644 --- a/pkgs/by-name/li/libglycin/package.nix +++ b/pkgs/by-name/li/libglycin/package.nix @@ -128,10 +128,6 @@ stdenv.mkDerivation (finalAttrs: { updateLockfile ]; - glycin3PathsPatch = replaceVars ./fix-glycin-3-paths.patch { - bwrap = "${bubblewrap}/bin/bwrap"; - }; - patchVendorHook = makeSetupHook { From df85a0ca0208cde603ecca36e26a57ff27d541b7 Mon Sep 17 00:00:00 2001 From: Jan Tojnar Date: Sat, 17 Jan 2026 17:32:32 +0100 Subject: [PATCH 12/23] libglycin: Use GNOME tarball as a source Unify with glycin-loaders. --- pkgs/by-name/li/libglycin/package.nix | 21 +++++++++------------ 1 file changed, 9 insertions(+), 12 deletions(-) diff --git a/pkgs/by-name/li/libglycin/package.nix b/pkgs/by-name/li/libglycin/package.nix index 8429f754c17d..68f3acadeacd 100644 --- a/pkgs/by-name/li/libglycin/package.nix +++ b/pkgs/by-name/li/libglycin/package.nix @@ -1,7 +1,7 @@ { lib, stdenv, - fetchFromGitLab, + fetchurl, makeSetupHook, meson, ninja, @@ -40,12 +40,14 @@ stdenv.mkDerivation (finalAttrs: { setupHook = ./path-hook.sh; - src = fetchFromGitLab { - domain = "gitlab.gnome.org"; - owner = "GNOME"; - repo = "glycin"; - tag = finalAttrs.version; - hash = "sha256-17ebdiLMuDJuuw8TBYWamyyDM4aZgtWRWEQhWGb/2mw="; + 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) pname version src; + hash = "sha256-UVVVjMt4vWkLob0H/MxIaW6rkBSFImu+5dezaCnc3Q8="; }; nativeBuildInputs = [ @@ -64,11 +66,6 @@ stdenv.mkDerivation (finalAttrs: { gobject-introspection ]; - cargoDeps = rustPlatform.fetchCargoVendor { - inherit (finalAttrs) pname version src; - hash = "sha256-7x4Ts0wRFoxZ2u3AHVEey8g6+XWDpxM/hFZeomkojKU="; - }; - buildInputs = [ libseccomp lcms2 From 1fc6c695f3065901d1519d618cc1c1d9441f4bcd Mon Sep 17 00:00:00 2001 From: Jan Tojnar Date: Sun, 18 Jan 2026 20:10:55 +0100 Subject: [PATCH 13/23] glycin-loaders: Remove unused git It is only used in dev profile. --- pkgs/by-name/gl/glycin-loaders/package.nix | 2 -- 1 file changed, 2 deletions(-) diff --git a/pkgs/by-name/gl/glycin-loaders/package.nix b/pkgs/by-name/gl/glycin-loaders/package.nix index ea0eb152f4d4..8f696d952faa 100644 --- a/pkgs/by-name/gl/glycin-loaders/package.nix +++ b/pkgs/by-name/gl/glycin-loaders/package.nix @@ -5,7 +5,6 @@ cairo, cargo, gettext, - git, gnome, gtk4, lcms2, @@ -42,7 +41,6 @@ stdenv.mkDerivation (finalAttrs: { nativeBuildInputs = [ cargo gettext # for msgfmt - git meson ninja pkg-config From 00725370ded3ea5254784d5d4c8673ceb79e2cda Mon Sep 17 00:00:00 2001 From: Jan Tojnar Date: Sat, 17 Jan 2026 17:33:40 +0100 Subject: [PATCH 14/23] glycin-loaders: Use source from libglycin MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit These should be updated in lockstep. Also remove update script – we will consider libglycin the main package. --- pkgs/by-name/gl/glycin-loaders/package.nix | 49 ++-------------------- pkgs/by-name/li/libglycin/package.nix | 5 +++ 2 files changed, 8 insertions(+), 46 deletions(-) diff --git a/pkgs/by-name/gl/glycin-loaders/package.nix b/pkgs/by-name/gl/glycin-loaders/package.nix index 8f696d952faa..ee760ac707d6 100644 --- a/pkgs/by-name/gl/glycin-loaders/package.nix +++ b/pkgs/by-name/gl/glycin-loaders/package.nix @@ -1,12 +1,12 @@ { stdenv, lib, - fetchurl, cairo, cargo, gettext, - gnome, + glib, gtk4, + libglycin, lcms2, libheif, libjxl, @@ -18,25 +18,12 @@ pkg-config, 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 @@ -76,36 +63,6 @@ stdenv.mkDerivation (finalAttrs: { 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 - ]; - }; - meta = { description = "Glycin loaders for several formats"; homepage = "https://gitlab.gnome.org/GNOME/glycin"; diff --git a/pkgs/by-name/li/libglycin/package.nix b/pkgs/by-name/li/libglycin/package.nix index 68f3acadeacd..d9aa9c5bb467 100644 --- a/pkgs/by-name/li/libglycin/package.nix +++ b/pkgs/by-name/li/libglycin/package.nix @@ -13,6 +13,7 @@ vala, gi-docgen, gobject-introspection, + glycin-loaders, libseccomp, lcms2, gtk4, @@ -137,6 +138,10 @@ stdenv.mkDerivation (finalAttrs: { sponge = "${moreutils}/bin/sponge"; } ); + + tests = { + inherit glycin-loaders; + }; }; meta = { From 98302542994bbe0ecc14828a42277b1654ef1744 Mon Sep 17 00:00:00 2001 From: Jan Tojnar Date: Sun, 18 Jan 2026 18:54:23 +0100 Subject: [PATCH 15/23] libglycin: Correct dependencies MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit fontconfig is propagated by cairo propagated by gtk4 but it is a direct dependency of libglycin. Similarly with glib. Though the pkg-config `Requires` are overly broad – only glib is required by the headers. This should be addressed upstream. --- pkgs/by-name/li/libglycin/package.nix | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/pkgs/by-name/li/libglycin/package.nix b/pkgs/by-name/li/libglycin/package.nix index d9aa9c5bb467..e585b4c3c916 100644 --- a/pkgs/by-name/li/libglycin/package.nix +++ b/pkgs/by-name/li/libglycin/package.nix @@ -12,8 +12,10 @@ rustPlatform, vala, gi-docgen, + glib, gobject-introspection, glycin-loaders, + fontconfig, libseccomp, lcms2, gtk4, @@ -68,12 +70,16 @@ stdenv.mkDerivation (finalAttrs: { ]; buildInputs = [ + fontconfig libseccomp lcms2 gtk4 ]; propagatedBuildInputs = [ + glib + # TODO: these should not be required by .pc file + fontconfig libseccomp lcms2 ]; From 67d6a2388bba8f680ea7370fd70d933749b69240 Mon Sep 17 00:00:00 2001 From: Jan Tojnar Date: Sun, 18 Jan 2026 23:31:18 +0100 Subject: [PATCH 16/23] libglycin: Do not require /usr MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit When we try to run `glycin-loaders` tests in Nix build sandbox, they would fail because the build sandbox lacks `/usr`. Let’s update our setup hook to patch the crate to have mounting `/usr` fail gracefully. This was proposed upstream and rejected: https://gitlab.gnome.org/GNOME/glycin/-/merge_requests/348 --- pkgs/by-name/li/libglycin/patch-vendor-hook.sh | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/pkgs/by-name/li/libglycin/patch-vendor-hook.sh b/pkgs/by-name/li/libglycin/patch-vendor-hook.sh index 1ba389614f2e..9cc9f2b172e5 100644 --- a/pkgs/by-name/li/libglycin/patch-vendor-hook.sh +++ b/pkgs/by-name/li/libglycin/patch-vendor-hook.sh @@ -24,6 +24,11 @@ libglycinPatchVendorHook() { fi echo "patching glycin crate at '$glycinPath'" + # Allow use in non-FHS environments like tests in Nix build sandbox. + substituteInPlace "$glycinPath/src/sandbox.rs" \ + --replace-fail '"--ro-bind", + "/usr",' '"--ro-bind-try", "/usr",' + substituteInPlace "$glycinPath/src/sandbox.rs" \ --replace-fail '"bwrap"' '"@bwrap@"' From 7be95de14b22915975fc979b9796227208f5132b Mon Sep 17 00:00:00 2001 From: Jan Tojnar Date: Sun, 18 Jan 2026 19:21:47 +0100 Subject: [PATCH 17/23] glycin-loaders: Move tests dependencies to `checkInputs` MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit gtk4 is only needed for tests, let’s not pull it in unless tests are actually run. And make tests meson feature conditional on `doCheck`. Keep not running tests by default since we will want to add glycin to gdk-pixbuf, which is a dependency of gtk4. Co-authored-by: Max --- pkgs/by-name/gl/glycin-loaders/package.nix | 39 ++++++++++++++++++++-- 1 file changed, 37 insertions(+), 2 deletions(-) diff --git a/pkgs/by-name/gl/glycin-loaders/package.nix b/pkgs/by-name/gl/glycin-loaders/package.nix index ee760ac707d6..f9b97462d915 100644 --- a/pkgs/by-name/gl/glycin-loaders/package.nix +++ b/pkgs/by-name/gl/glycin-loaders/package.nix @@ -16,6 +16,8 @@ meson, ninja, pkg-config, + python3, + shared-mime-info, rustc, rustPlatform, }: @@ -33,12 +35,15 @@ stdenv.mkDerivation (finalAttrs: { 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 @@ -46,12 +51,20 @@ stdenv.mkDerivation (finalAttrs: { 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; @@ -59,10 +72,32 @@ stdenv.mkDerivation (finalAttrs: { 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 = { + tests = { + withTests = finalAttrs.finalPackage.overrideAttrs { + doCheck = true; + }; + }; + }; + meta = { description = "Glycin loaders for several formats"; homepage = "https://gitlab.gnome.org/GNOME/glycin"; From b55a11020bbf30f6d5fb4ffd78f06b3954d5216c Mon Sep 17 00:00:00 2001 From: Jan Tojnar Date: Sun, 18 Jan 2026 18:37:01 +0100 Subject: [PATCH 18/23] libglycin-gtk4: init (split out of libglycin) In preparation for gdk-pixbuf switching to glycin. --- pkgs/by-name/ba/bazaar/package.nix | 2 + pkgs/by-name/co/constrict/package.nix | 2 + .../hi/highscore-unwrapped/package.nix | 2 + pkgs/by-name/li/libglycin-gtk4/package.nix | 102 ++++++++++++++++++ pkgs/by-name/li/libglycin/package.nix | 10 +- pkgs/by-name/tu/turntable/package.nix | 2 + 6 files changed, 116 insertions(+), 4 deletions(-) create mode 100644 pkgs/by-name/li/libglycin-gtk4/package.nix diff --git a/pkgs/by-name/ba/bazaar/package.nix b/pkgs/by-name/ba/bazaar/package.nix index 25a2e377407e..7d3b806ad9a5 100644 --- a/pkgs/by-name/ba/bazaar/package.nix +++ b/pkgs/by-name/ba/bazaar/package.nix @@ -18,6 +18,7 @@ libadwaita, libdex, libglycin, + libglycin-gtk4, libsoup_3, libxmlb, libyaml, @@ -56,6 +57,7 @@ stdenv.mkDerivation (finalAttrs: { libadwaita libdex libglycin + libglycin-gtk4 libsoup_3 libxmlb libyaml diff --git a/pkgs/by-name/co/constrict/package.nix b/pkgs/by-name/co/constrict/package.nix index 8df59d9f2d9c..1b67ad4e28c3 100644 --- a/pkgs/by-name/co/constrict/package.nix +++ b/pkgs/by-name/co/constrict/package.nix @@ -11,6 +11,7 @@ desktop-file-utils, libadwaita, libglycin, + libglycin-gtk4, libva-utils, ffmpeg, gst-thumbnailers, @@ -42,6 +43,7 @@ python3Packages.buildPythonApplication (finalAttrs: { buildInputs = [ libadwaita libglycin + libglycin-gtk4 ]; dependencies = [ diff --git a/pkgs/by-name/hi/highscore-unwrapped/package.nix b/pkgs/by-name/hi/highscore-unwrapped/package.nix index 1a309c758d21..e4d44e8ed8da 100644 --- a/pkgs/by-name/hi/highscore-unwrapped/package.nix +++ b/pkgs/by-name/hi/highscore-unwrapped/package.nix @@ -17,6 +17,7 @@ libadwaita, libarchive, libglycin, + libglycin-gtk4, libhighscore, libmanette, sqlite, @@ -92,6 +93,7 @@ stdenv.mkDerivation (finalAttrs: { libadwaita libarchive libglycin + libglycin-gtk4 libhighscore libmanette-1-alpha sqlite diff --git a/pkgs/by-name/li/libglycin-gtk4/package.nix b/pkgs/by-name/li/libglycin-gtk4/package.nix new file mode 100644 index 000000000000..bc1b85315bd2 --- /dev/null +++ b/pkgs/by-name/li/libglycin-gtk4/package.nix @@ -0,0 +1,102 @@ +{ + lib, + stdenv, + cargo, + fontconfig, + gi-docgen, + glib, + gobject-introspection, + gtk4, + lcms2, + libglycin, + libseccomp, + meson, + ninja, + pkg-config, + python3, + rustPlatform, + rustc, + vala, + buildPackages, + withIntrospection ? + lib.meta.availableOn stdenv.hostPlatform gobject-introspection + && stdenv.hostPlatform.emulatorAvailable buildPackages, +}: + +stdenv.mkDerivation (finalAttrs: { + pname = "libglycin-gtk4"; + + outputs = [ + "out" + "dev" + "devdoc" + ]; + + inherit (libglycin) version src cargoDeps; + + nativeBuildInputs = [ + meson + ninja + pkg-config + rustc + cargo + python3 + rustPlatform.cargoSetupHook + ] + ++ lib.optionals withIntrospection [ + vala + gi-docgen + gobject-introspection + ]; + + buildInputs = [ + fontconfig + glib + libseccomp + lcms2 + gtk4 + ]; + + propagatedBuildInputs = [ + libglycin + gtk4 + # TODO: these should not be required by .pc file + fontconfig + libseccomp + lcms2 + ]; + + mesonFlags = [ + (lib.mesonBool "glycin-loaders" false) + (lib.mesonBool "glycin-thumbnailer" false) + (lib.mesonBool "libglycin" false) + (lib.mesonBool "libglycin-gtk4" true) + (lib.mesonBool "introspection" withIntrospection) + (lib.mesonBool "vapi" withIntrospection) + (lib.mesonBool "capi_docs" withIntrospection) + ]; + + postPatch = '' + patchShebangs \ + build-aux/crates-version.py + ''; + + postFixup = '' + # Cannot be in postInstall, otherwise _multioutDocs hook in preFixup will move right back. + moveToOutput "share/doc" "$devdoc" + ''; + + meta = { + description = "C-Bindings to convert glycin frames to GDK Textures"; + homepage = "https://gitlab.gnome.org/GNOME/glycin"; + license = with lib.licenses; [ + mpl20 # or + lgpl21Plus + ]; + teams = [ lib.teams.gnome ]; + platforms = lib.platforms.linux; + pkgConfigModules = [ + "glycin-gtk4-1" + ]; + }; +}) diff --git a/pkgs/by-name/li/libglycin/package.nix b/pkgs/by-name/li/libglycin/package.nix index e585b4c3c916..15ea7bb02d7b 100644 --- a/pkgs/by-name/li/libglycin/package.nix +++ b/pkgs/by-name/li/libglycin/package.nix @@ -15,10 +15,10 @@ glib, gobject-introspection, glycin-loaders, + libglycin-gtk4, fontconfig, libseccomp, lcms2, - gtk4, gnome, replaceVars, bubblewrap, @@ -73,7 +73,6 @@ stdenv.mkDerivation (finalAttrs: { fontconfig libseccomp lcms2 - gtk4 ]; propagatedBuildInputs = [ @@ -88,6 +87,7 @@ stdenv.mkDerivation (finalAttrs: { (lib.mesonBool "glycin-loaders" false) (lib.mesonBool "glycin-thumbnailer" false) (lib.mesonBool "libglycin" true) + (lib.mesonBool "libglycin-gtk4" false) (lib.mesonBool "introspection" withIntrospection) (lib.mesonBool "vapi" withIntrospection) (lib.mesonBool "capi_docs" withIntrospection) @@ -146,7 +146,10 @@ stdenv.mkDerivation (finalAttrs: { ); tests = { - inherit glycin-loaders; + inherit + glycin-loaders + libglycin-gtk4 + ; }; }; @@ -163,7 +166,6 @@ stdenv.mkDerivation (finalAttrs: { platforms = lib.platforms.linux; pkgConfigModules = [ "glycin-1" - "glycin-gtk4-1" ]; }; }) diff --git a/pkgs/by-name/tu/turntable/package.nix b/pkgs/by-name/tu/turntable/package.nix index 078190806a3c..21adc60d0958 100644 --- a/pkgs/by-name/tu/turntable/package.nix +++ b/pkgs/by-name/tu/turntable/package.nix @@ -13,6 +13,7 @@ json-glib, libsecret, libglycin, + libglycin-gtk4, glib-networking, glycin-loaders, @@ -48,6 +49,7 @@ stdenv.mkDerivation (finalAttrs: { json-glib libsecret libglycin + libglycin-gtk4 glib-networking ]; From 737475137dae73433d3762eb27f782fc99455250 Mon Sep 17 00:00:00 2001 From: Jan Tojnar Date: Mon, 19 Jan 2026 01:35:42 +0100 Subject: [PATCH 19/23] gst-thumbnailers: Rely on libglycin setup hook for loaders discovery. --- pkgs/by-name/gs/gst-thumbnailers/package.nix | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/pkgs/by-name/gs/gst-thumbnailers/package.nix b/pkgs/by-name/gs/gst-thumbnailers/package.nix index 3b84499f8a7c..2ae9a3cd9b18 100644 --- a/pkgs/by-name/gs/gst-thumbnailers/package.nix +++ b/pkgs/by-name/gs/gst-thumbnailers/package.nix @@ -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"; From 53f2f740f42052c42f11880e64f4d06f4a472c49 Mon Sep 17 00:00:00 2001 From: Jan Tojnar Date: Mon, 19 Jan 2026 01:42:14 +0100 Subject: [PATCH 20/23] bazaar: Rely on libglycin setup hook for loaders discovery. Also drop `bubblewrap`, which is already being hardcoded in `libglycin` package since bb77c25073ff97d8a60c530e7c52fdfc2a493f26. --- pkgs/by-name/ba/bazaar/package.nix | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/pkgs/by-name/ba/bazaar/package.nix b/pkgs/by-name/ba/bazaar/package.nix index 7d3b806ad9a5..a274e9968ac4 100644 --- a/pkgs/by-name/ba/bazaar/package.nix +++ b/pkgs/by-name/ba/bazaar/package.nix @@ -9,7 +9,6 @@ pkg-config, wrapGAppsHook4, appstream, - bubblewrap, flatpak, glib-networking, glycin-loaders, @@ -58,6 +57,7 @@ stdenv.mkDerivation (finalAttrs: { libdex libglycin libglycin-gtk4 + glycin-loaders libsoup_3 libxmlb libyaml @@ -66,13 +66,6 @@ stdenv.mkDerivation (finalAttrs: { libsecret ]; - preFixup = '' - gappsWrapperArgs+=( - --prefix PATH : "$out/bin:${lib.makeBinPath [ bubblewrap ]}" - --prefix XDG_DATA_DIRS : "${glycin-loaders}/share" - ) - ''; - passthru = { updateScript = nix-update-script { }; }; From 93f86d1c5bbab2bc51c1e4d4ab052e04f2ce6932 Mon Sep 17 00:00:00 2001 From: Jan Tojnar Date: Mon, 19 Jan 2026 01:49:53 +0100 Subject: [PATCH 21/23] turntable: Rely on libglycin setup hook for loaders discovery. --- pkgs/by-name/tu/turntable/package.nix | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/pkgs/by-name/tu/turntable/package.nix b/pkgs/by-name/tu/turntable/package.nix index 21adc60d0958..7cb19fec3855 100644 --- a/pkgs/by-name/tu/turntable/package.nix +++ b/pkgs/by-name/tu/turntable/package.nix @@ -50,6 +50,7 @@ stdenv.mkDerivation (finalAttrs: { libsecret libglycin libglycin-gtk4 + glycin-loaders glib-networking ]; @@ -60,12 +61,6 @@ stdenv.mkDerivation (finalAttrs: { strictDeps = true; - preFixup = '' - gappsWrapperArgs+=( - --prefix XDG_DATA_DIRS : "${glycin-loaders}/share" - ) - ''; - meta = { description = "Scrobbles your music to multiple services with playback controls for MPRIS players"; longDescription = '' From f0b96b94946494458945a7690f4722d2976cdb0b Mon Sep 17 00:00:00 2001 From: Jan Tojnar Date: Mon, 19 Jan 2026 01:50:11 +0100 Subject: [PATCH 22/23] valent: Rely on libglycin setup hook for loaders discovery. --- pkgs/by-name/va/valent/package.nix | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/pkgs/by-name/va/valent/package.nix b/pkgs/by-name/va/valent/package.nix index a59479fe7267..4e8fee88a9cf 100644 --- a/pkgs/by-name/va/valent/package.nix +++ b/pkgs/by-name/va/valent/package.nix @@ -61,6 +61,7 @@ stdenv.mkDerivation (finalAttrs: { json-glib libadwaita libglycin + glycin-loaders libpeas2 libphonenumber libportal-gtk4 @@ -69,12 +70,6 @@ stdenv.mkDerivation (finalAttrs: { tinysparql ]; - preFixup = '' - gappsWrapperArgs+=( - --prefix XDG_DATA_DIRS : "${glycin-loaders}/share" - ) - ''; - passthru.updateScript = nix-update-script { }; meta = { From 8f65f5245db43d135a65b5db5cd649f205ad9ed0 Mon Sep 17 00:00:00 2001 From: Jan Tojnar Date: Mon, 19 Jan 2026 01:45:12 +0100 Subject: [PATCH 23/23] constrict: Rely on libglycin setup hook for loaders discovery. --- pkgs/by-name/co/constrict/package.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/by-name/co/constrict/package.nix b/pkgs/by-name/co/constrict/package.nix index 1b67ad4e28c3..caf6b88dbe7b 100644 --- a/pkgs/by-name/co/constrict/package.nix +++ b/pkgs/by-name/co/constrict/package.nix @@ -44,6 +44,7 @@ python3Packages.buildPythonApplication (finalAttrs: { libadwaita libglycin libglycin-gtk4 + glycin-loaders ]; dependencies = [ @@ -62,7 +63,6 @@ python3Packages.buildPythonApplication (finalAttrs: { preFixup = '' makeWrapperArgs+=( ''${gappsWrapperArgs[@]} - --prefix XDG_DATA_DIRS : "${glycin-loaders}/share" --prefix PATH : ${lib.makeBinPath finalAttrs.runtimeDeps} ) '';