mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-19 00:08:32 +01:00
glib: Add helpers for finding schema datadir
It is commonly needed for test environments.
This commit is contained in:
parent
a10675f43d
commit
7e95149bdb
4 changed files with 8 additions and 4 deletions
|
@ -73,7 +73,7 @@ stdenv.mkDerivation rec {
|
||||||
# Add “org.gnome.crypto.pgp” GSettings schema to path
|
# Add “org.gnome.crypto.pgp” GSettings schema to path
|
||||||
# to make it available for “gpgme-backend” test.
|
# to make it available for “gpgme-backend” test.
|
||||||
# It is used by Seahorse’s internal “common” library.
|
# It is used by Seahorse’s internal “common” library.
|
||||||
addToSearchPath XDG_DATA_DIRS "${glib.getSchemaPath gcr}/../.."
|
addToSearchPath XDG_DATA_DIRS "${glib.getSchemaDataDirPath gcr}"
|
||||||
# The same test also requires home directory so that it can store settings.
|
# The same test also requires home directory so that it can store settings.
|
||||||
export HOME=$TMPDIR
|
export HOME=$TMPDIR
|
||||||
'';
|
'';
|
||||||
|
|
|
@ -191,8 +191,12 @@ stdenv.mkDerivation rec {
|
||||||
|
|
||||||
passthru = rec {
|
passthru = rec {
|
||||||
gioModuleDir = "lib/gio/modules";
|
gioModuleDir = "lib/gio/modules";
|
||||||
makeSchemaPath = dir: name: "${dir}/share/gsettings-schemas/${name}/glib-2.0/schemas";
|
|
||||||
|
makeSchemaDataDirPath = dir: name: "${dir}/share/gsettings-schemas/${name}";
|
||||||
|
makeSchemaPath = dir: name: "${makeSchemaDataDirPath dir name}/glib-2.0/schemas";
|
||||||
getSchemaPath = pkg: makeSchemaPath pkg pkg.name;
|
getSchemaPath = pkg: makeSchemaPath pkg pkg.name;
|
||||||
|
getSchemaDataDirPath = pkg: makeSchemaDataDirPath pkg pkg.name;
|
||||||
|
|
||||||
inherit flattenInclude;
|
inherit flattenInclude;
|
||||||
updateScript = gnome.updateScript { packageName = "glib"; };
|
updateScript = gnome.updateScript { packageName = "glib"; };
|
||||||
};
|
};
|
||||||
|
|
|
@ -73,7 +73,7 @@ stdenv.mkDerivation rec {
|
||||||
# AdwSettings needs to be initialized from “org.gnome.desktop.interface” GSettings schema when portal is not used for color scheme.
|
# AdwSettings needs to be initialized from “org.gnome.desktop.interface” GSettings schema when portal is not used for color scheme.
|
||||||
# It will not actually be used since the “color-scheme” key will only have been introduced in GNOME 42, falling back to detecting theme name.
|
# It will not actually be used since the “color-scheme” key will only have been introduced in GNOME 42, falling back to detecting theme name.
|
||||||
# See adw_settings_constructed function in https://gitlab.gnome.org/GNOME/libadwaita/commit/60ec69f0a5d49cad8a6d79e4ecefd06dc6e3db12
|
# See adw_settings_constructed function in https://gitlab.gnome.org/GNOME/libadwaita/commit/60ec69f0a5d49cad8a6d79e4ecefd06dc6e3db12
|
||||||
"XDG_DATA_DIRS=${glib.getSchemaPath gsettings-desktop-schemas}/../.."
|
"XDG_DATA_DIRS=${glib.getSchemaDataDirPath gsettings-desktop-schemas}"
|
||||||
|
|
||||||
# Tests need a cache directory
|
# Tests need a cache directory
|
||||||
"HOME=$TMPDIR"
|
"HOME=$TMPDIR"
|
||||||
|
|
|
@ -94,7 +94,7 @@ stdenv.mkDerivation rec {
|
||||||
# HdySettings needs to be initialized from “org.gnome.desktop.interface” GSettings schema when portal is not used for color scheme.
|
# HdySettings needs to be initialized from “org.gnome.desktop.interface” GSettings schema when portal is not used for color scheme.
|
||||||
# It will not actually be used since the “color-scheme” key will only have been introduced in GNOME 42, falling back to detecting theme name.
|
# It will not actually be used since the “color-scheme” key will only have been introduced in GNOME 42, falling back to detecting theme name.
|
||||||
# See hdy_settings_constructed function in https://gitlab.gnome.org/GNOME/libhandy/-/commit/bb68249b005c445947bfb2bee66c91d0fe9c41a4
|
# See hdy_settings_constructed function in https://gitlab.gnome.org/GNOME/libhandy/-/commit/bb68249b005c445947bfb2bee66c91d0fe9c41a4
|
||||||
"${glib.getSchemaPath gsettings-desktop-schemas}/../.."
|
(glib.getSchemaDataDirPath gsettings-desktop-schemas)
|
||||||
|
|
||||||
# Some tests require icons
|
# Some tests require icons
|
||||||
"${hicolor-icon-theme}/share"
|
"${hicolor-icon-theme}/share"
|
||||||
|
|
Loading…
Reference in a new issue