forked from mirrors/nixpkgs
gdkpixbuf: simplify setup hook, don't create per-package loaders.cache
This commit is contained in:
parent
aa800fa0fe
commit
4982143324
|
@ -1,23 +1,15 @@
|
|||
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"
|
||||
# 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) -gt $(cat "$GDK_PIXBUF_MODULE_FILE"|wc -l) ]; then
|
||||
export GDK_PIXBUF_MODULE_FILE="$loadersCache"
|
||||
fi
|
||||
else
|
||||
export GDK_PIXBUF_MODULE_FILE="$loadersCache"
|
||||
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
|
||||
|
||||
}
|
||||
|
|
|
@ -34,7 +34,7 @@ stdenv.mkDerivation rec {
|
|||
# The loaders.cache can be used by setting GDK_PIXBUF_MODULE_FILE to
|
||||
# point to this file in a wrapper.
|
||||
postConfigure = ''
|
||||
GDK_PIXBUF=$out/lib/gdk-pixbuf
|
||||
GDK_PIXBUF=$out/lib/gdk-pixbuf-2.0/2.10.0
|
||||
mkdir -p $GDK_PIXBUF/loaders
|
||||
sed -e "s#gdk_pixbuf_moduledir = .*#gdk_pixbuf_moduledir = $GDK_PIXBUF/loaders#" \
|
||||
-i gdk-pixbuf-loader/Makefile
|
||||
|
@ -43,4 +43,11 @@ stdenv.mkDerivation rec {
|
|||
sed -e "s#\$(GDK_PIXBUF_QUERYLOADERS)#GDK_PIXBUF_MODULEDIR=$GDK_PIXBUF/loaders \$(GDK_PIXBUF_QUERYLOADERS)#" \
|
||||
-i gdk-pixbuf-loader/Makefile
|
||||
'';
|
||||
|
||||
# Merge gdkpixbuf and librsvg loaders
|
||||
postInstall = ''
|
||||
mv $GDK_PIXBUF/loaders.cache $GDK_PIXBUF/loaders.cache.tmp
|
||||
cat ${gdk_pixbuf}/lib/gdk-pixbuf-2.0/2.10.0/loaders.cache $GDK_PIXBUF/loaders.cache.tmp > $GDK_PIXBUF/loaders.cache
|
||||
rm $GDK_PIXBUF/loaders.cache.tmp
|
||||
'';
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue