# Depends on: libffi pcre python elfutils meson ninja libxslt docbook-xsl

description="The GLib package contains a low-level libraries useful for providing data structure handling"
url="http://www.gtk.org/"
packager="tnut <tnut@nutyx.org>"
contributors="Tnut, Fanch"

PKGMK_GROUPS=(man devel doc )

name=glib
version=2.58.2

source=(http://ftp.gnome.org/pub/gnome/sources/glib/${version:0:4}/$name-$version.tar.xz
	https://download.tuxfamily.org/nutyx/WallPapers/nutyx-10.0.jpg
	glib-$version-skip_warnings-1.patch)

build () {
  cd $name-$version

  patch -Np1 -i ../glib-$version-skip_warnings-1.patch

  mkdir build-glib
  cd    build-glib

  meson --prefix=/usr -Dman=true -Dselinux=false ..
  ninja

  DESTDIR=$PKG ninja install


  # Default NuTyX Wallpaper
  install -D -m644 ../../nutyx-10.0.jpg \
  $PKG/usr/share/backgrounds/nutyx/nutyx.jpg

}
uptodate(){
local latest lastversion url
url="http://ftp.gnome.org/pub/gnome/sources/$name"
latest="`lynx -read_timeout=20 -dump -listonly -nonumbers \
$url/?C=N\;O=D|grep [0-9]/$|head -1`"
lastversion="`lynx -read_timeout=20 -dump -listonly -nonumbers \
$latest/?C=N\;O=D|grep LATEST|grep [0-9]$|cut -d "-" -f3`"

echo "$lastversion"
}
