linux_xanmod: 5.11.14 -> 5.11.15
[NixPkgs.git] / pkgs / development / libraries / glib / setup-hook.sh
blob8ead5510ec4f0692887816a3b2ab5e3cb26391ea
1 make_glib_find_gsettings_schemas() {
2 # For packages that need gschemas of other packages (e.g. empathy)
3 for maybe_dir in "$1"/share/gsettings-schemas/*; do
4 if [[ -d "$maybe_dir/glib-2.0/schemas" ]]; then
5 addToSearchPath GSETTINGS_SCHEMAS_PATH "$maybe_dir"
6 fi
7 done
9 addEnvHooks "$targetOffset" make_glib_find_gsettings_schemas
11 # Install gschemas, if any, in a package-specific directory
12 glibPreInstallPhase() {
13 makeFlagsArray+=("gsettingsschemadir=${!outputLib}/share/gsettings-schemas/$name/glib-2.0/schemas/")
15 preInstallPhases+=" glibPreInstallPhase"
17 glibPreFixupPhase() {
18 # Move gschemas in case the install flag didn't help
19 if [ -d "$prefix/share/glib-2.0/schemas" ]; then
20 mkdir -p "${!outputLib}/share/gsettings-schemas/$name/glib-2.0"
21 mv "$prefix/share/glib-2.0/schemas" "${!outputLib}/share/gsettings-schemas/$name/glib-2.0/"
24 addToSearchPath GSETTINGS_SCHEMAS_PATH "${!outputLib}/share/gsettings-schemas/$name"
27 # gappsWrapperArgsHook expects GSETTINGS_SCHEMAS_PATH variable to be set by this.
28 # Until we have dependency mechanism in generic builder, we need to use this ugly hack.
29 if [[ " ${preFixupPhases:-} " =~ " gappsWrapperArgsHook " ]]; then
30 preFixupPhases+=" "
31 preFixupPhases="${preFixupPhases/ gappsWrapperArgsHook / glibPreFixupPhase gappsWrapperArgsHook }"
32 else
33 preFixupPhases+=" glibPreFixupPhase"