#!/bin/bash -e

. ../env/env

brief="An image loading library used with GNOME"
intro="
 The Gdk Pixbuf package is a toolkit for image loading and pixel buffer
 manipulation. It is used by GTK+ 2 and GTK+ 3 to load and manipulate images.
 In the past it was distributed as part of GTK+ 2 but it was split off into a
 separate package in preparation for the change to GTK+ 3.
"
depends="glib (>= 2.60.6), libjpeg-turbo (>= 2.0.2), libpng (>= 1.6.37),\
 shared-mime-info (>= 1.12), libtiff (>= 4.0.10), xorg-lib (>= 9.0),\
 gobject-introspection (>= 1.60.2)"
depends_for_compile=""
depends_for_runtime="librsvg (>= 2.44.14)"

version=2.38.1
srcfil=gdk-pixbuf-$version.tar.xz
srcdir=gdk-pixbuf-$version

srcurl=http://ftp.gnome.org/pub/gnome/sources/gdk-pixbuf/2.38/$srcfil
srcmd5=f6ba2195acd18c5c9555421f30c31cc1

build_src() {
    tar -xf $srcfil && cd $srcdir

    mkdir -pv build && cd build
    meson --prefix=/usr \
        -Ddocs=false \
        -Dman=false \
        ..
    ninja
    DESTDIR=$OUTPUTDIR ninja install

    cleanup_src
}

postinst_action='
    ldconfig
    gdk-pixbuf-query-loaders --update-cache
'
postrm_action='
    gdk-pixbuf-query-loaders --update-cache
    ldconfig
'

build
