# Description: An image loading library for GTK+
# URL: https://www.gtk.org/
# Maintainer: CRUX compat-32 Team, compat-32-ports at crux dot nu
# Depends on: gdk-pixbuf glycin-32 xorg-libx11-32

name=gdk-pixbuf-32
version=2.44.4
release=1
source=(https://download.gnome.org/sources/${name%-*}/${version%.*}/${name%-*}-$version.tar.xz)

build() {
    # Run-time dependency shared-mime-info found
    export PKG_CONFIG_PATH='/usr/lib32/pkgconfig:/usr/share/pkgconfig'

    meson setup build ${name%-*}-$version \
        --prefix=/usr \
        --libdir=/usr/lib32 \
        --buildtype=plain \
        -D glycin=enabled \
        -D builtin_loaders='glycin' \
        -D installed_tests=false \
        -D introspection=disabled \
        -D man=false \
        -D png=disabled \
        -D tiff=disabled \
        -D jpeg=disabled \
        -D gif=disabled \
        -D others=disabled \
        -D thumbnailer=disabled

    meson compile -C build -j ${JOBS:-1}
    DESTDIR=$PKG meson install -C build

    rm -r $PKG/usr/{include,share}
    find $PKG/usr/bin -type f -not -name gdk-pixbuf-query-loaders -printf 'Removing %P\n' -delete
    mv $PKG/usr/bin/gdk-pixbuf-query-loaders{,-32}
}
