# Description: A fast image manipulation library
# URL: http://freshmeat.net/projects/imlib2/
# Packager: Matt Housh jaeger at morpheus dot net
# Maintainer: Jose V Beneyto sepen at users dot sourceforge dot net
# Arch Maintainer: CRUX-ARM System Team, crux-arm at mikeux dot dyndns dot org
# Depends on: freetype libpng libtiff libungif xorg-libsm xorg-libxext

name=imlib2
version=1.4.2
release=1
source=(http://dl.sourceforge.net/sourceforge/enlightenment/$name-$version.tar.bz2)

build() {
  cd $name-$version

  export DEFAULT_LIBS="-L$CLFS/usr/lib"
  export DEFAULT_CFLAGS="-I$CLFS/usr/include"
  export PNG_LIBS="$DEFAULT_LIBS -lpng12"
  export PNG_CFLAGS="$DEFAULT_CFLAGS -I$CLFS/usr/include/libpng12"
  export TIFFLIBS="$DEFAULT_LIBS"
  export GIFLIBS="$DEFAULT_LIBS"
  export JPEGLIBS="$DEFAULT_LIBS"
  export BZ2LIBS="$DEFAULT_LIBS"
  export ZLIBLIBS="$DEFAULT_LIBS"
  export X_LIBS="$DEFAULT_LIBS -lX11 -lXext -lSM"

  ./configure --build=$CHOST \
              --host=$CTARGET \
              --prefix=/usr \
              --with-png \
              --with-tiff \
              --with-gif \
              --with-jpeg \
              --with-bzip2 \
              --with-zlib \
              --with-x \
              --without-id3

  make
  make DESTDIR=$PKG install
}