nixpkgs/pkgs/development/libraries/gobject-introspection/setup-hook.sh
Artturin 71cbf3b809 gobject-introspection: use targetOffset to look for libraries for target
fixes it finding the build and target gobject-introspection when it should only find the
target gobject-introspection
2022-07-07 21:18:23 +03:00

34 lines
1.1 KiB
Bash

make_gobject_introspection_find_gir_files() {
# required for .typelib files, eg mypaint git version
if [ -d "$1/lib/girepository-1.0" ]; then
addToSearchPath GI_TYPELIB_PATH $1/lib/girepository-1.0
fi
# XDG_DATA_DIRS: required for finding .gir files
if [ -d "$1/share/gir-1.0" ]; then
addToSearchPath XDG_DATA_DIRS $1/share
fi
}
addEnvHooks "$targetOffset" make_gobject_introspection_find_gir_files
giDiscoverSelf() {
if [ -d "$prefix/lib/girepository-1.0" ]; then
addToSearchPath GI_TYPELIB_PATH $prefix/lib/girepository-1.0
fi
}
# gappsWrapperArgsHook expects GI_TYPELIB_PATH variable to be set by this.
# Until we have dependency mechanism in generic builder, we need to use this ugly hack.
if [[ " ${preFixupPhases:-} " =~ " gappsWrapperArgsHook " ]]; then
preFixupPhases+=" "
preFixupPhases="${preFixupPhases/ gappsWrapperArgsHook / giDiscoverSelf gappsWrapperArgsHook }"
else
preFixupPhases+=" giDiscoverSelf"
fi
_multioutMoveGlibGir() {
moveToOutput share/gir-1.0 "${!outputDev}"
}
preFixupHooks+=(_multioutMoveGlibGir)