nixpkgs/pkgs/development/libraries/gdk-pixbuf/setup-hook.sh
Matthew Bauer 6c5983a291 gdk-pixbuf: make target env hook
Unfortunately, we need to emulate the system to get a real cache.
Native version doesn’t know the right paths.
2020-04-06 16:36:22 -04:00

18 lines
481 B
Bash

findGdkPixbufLoaders() {
# choose the longest loaders.cache
local loadersCache="$1/lib/gdk-pixbuf-2.0/2.10.0/loaders.cache"
if [[ -f "$loadersCache" ]]; then
if [[ -f "${GDK_PIXBUF_MODULE_FILE-}" ]]; then
if (( "$(cat "$loadersCache" | wc -l)" > "$(cat "$GDK_PIXBUF_MODULE_FILE" | wc -l)" )); then
export GDK_PIXBUF_MODULE_FILE="$loadersCache"
fi
else
export GDK_PIXBUF_MODULE_FILE="$loadersCache"
fi
fi
}
addEnvHooks "$targetOffset" findGdkPixbufLoaders