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"

makedepends=(libffi pcre python elfutils meson ninja libxslt docbook-xsl)
PKGMK_GROUPS=(man devel doc )

name=glib
version=2.66.2

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

build () {
  cd $name-$version

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

  mkdir build-glib
  cd    build-glib

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

  DESTDIR=$PKG ninja install


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

}
uptodate(){
local latest lastversion url
url="https://download.gnome.org/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"
}
