From 4a3508ad1a5f1fa4a1795ba9896b1a5d9ee043e6 Mon Sep 17 00:00:00 2001 From: Luca Bruno Date: Tue, 22 Apr 2014 17:48:15 +0200 Subject: [PATCH] gdk-pixbuf: check for writable $out/.., closes #2115 --- .../libraries/gdk-pixbuf/setup-hook.sh | 32 +++++++++++-------- 1 file changed, 19 insertions(+), 13 deletions(-) diff --git a/pkgs/development/libraries/gdk-pixbuf/setup-hook.sh b/pkgs/development/libraries/gdk-pixbuf/setup-hook.sh index 280d9aa4f1ba..c983f9f6a612 100644 --- a/pkgs/development/libraries/gdk-pixbuf/setup-hook.sh +++ b/pkgs/development/libraries/gdk-pixbuf/setup-hook.sh @@ -1,19 +1,25 @@ -make_gtk_applications_find_pixbuf_loaders() { +findGdkPixbufLoaders() { - # set pixbuf loaders.cache for this package - mkdir -p "$out/lib/$name/gdk-pixbuf" - - 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" >> "$out/lib/$name/gdk-pixbuf/loaders.cache" - fi + if [ -z "$IN_NIX_SHELL" ]; then - if [ -f "$1/lib/gdk-pixbuf/loaders.cache" ]; then - cat "$1/lib/gdk-pixbuf/loaders.cache" >> "$out/lib/$name/gdk-pixbuf/loaders.cache" - fi + # 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 - # note, this is not a search path - export GDK_PIXBUF_MODULE_FILE=$(readlink -e "$out/lib/$name/gdk-pixbuf/loaders.cache") + 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+=(make_gtk_applications_find_pixbuf_loaders) +envHooks+=(findGdkPixbufLoaders)