#!/bin/bash

PKG=/mnt/hda2/gdk-pixbuf2/pkg

tar xvf gdk-pixbuf-2.22.0.tar.xz
cd gdk-pixbuf-2.22.0
./configure --prefix=/usr/local --without-libjasper
make
make install DESTDIR=/mnt/hda2/gdk-pixbuf2/pkg

[ -d "$PKG"/usr/local/etc/gtk-2.0/ ] || mkdir -p "$PKG"/usr/local/etc/gtk-2.0/

"$PKG"/usr/local/bin/gdk-pixbuf-query-loaders > "$PKG"/usr/local/etc/gtk-2.0/gdk-pixbuf.loaders

cd "$PKG"
find . | xargs file | grep "executable" | grep ELF | grep "not stripped" | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null
find . | xargs file | grep "shared object" | grep ELF | grep "not stripped" | cut -f 1 -d : | xargs strip -g 2> /dev/null

