summary refs log tree commit diff
path: root/pkgs/development/libraries/gdk-pixbuf/setup-hook.sh
diff options
context:
space:
mode:
Diffstat (limited to 'pkgs/development/libraries/gdk-pixbuf/setup-hook.sh')
-rw-r--r--pkgs/development/libraries/gdk-pixbuf/setup-hook.sh25
1 files changed, 25 insertions, 0 deletions
diff --git a/pkgs/development/libraries/gdk-pixbuf/setup-hook.sh b/pkgs/development/libraries/gdk-pixbuf/setup-hook.sh
new file mode 100644
index 00000000000..06e820633b8
--- /dev/null
+++ b/pkgs/development/libraries/gdk-pixbuf/setup-hook.sh
@@ -0,0 +1,25 @@
+findGdkPixbufLoaders() {
+
+	if [ -n "$out" ] && [ -z "$IN_NIX_SHELL" ]; then
+
+		# set pixbuf loaders.cache for this package
+
+		local loadersDir="$out/lib/gdk-pixbuf-loaders-2.0/$name"
+		mkdir -p "$loadersDir"
+		
+		if [ -f "$1/lib/gdk-pixbuf-2.0/2.10.0/loaders.cache" ]; then
+			cat "$1/lib/gdk-pixbuf-2.0/2.10.0/loaders.cache" >> "$loadersDir/loaders.cache"
+		fi
+	
+		if [ -f "$1/lib/gdk-pixbuf/loaders.cache" ]; then
+			cat "$1/lib/gdk-pixbuf/loaders.cache" >> "$loadersDir/loaders.cache"
+		fi
+		
+		# note, this is not a search path
+		export GDK_PIXBUF_MODULE_FILE=$(readlink -e "$loadersDir/loaders.cache")
+
+	fi
+
+}
+
+envHooks+=(findGdkPixbufLoaders)