# Maintainer (aur): <mumei AT airmail DOT cc>
# Contributor: Sergej Pupykin <pupykin.s+arch@gmail.com>
# Contributor: Vesa Kaihlavirta <vegai@iki.fi>
# Contributor: Sebastian Sareyko <public@nooms.de>
# Maintainer: bill-auger <bill-auger@programmer.net>


# build order: (gnustep-base) <- gnustep-gui <- gnustep-back <- gnustep-netclasses


pkgname=gnustep-back
pkgver=0.30.0
pkgrel=1
pkgdesc="The GNUstep GUI Backend"
arch=(armv7h i686 x86_64)
url=http://www.gnustep.org/
license=('LGPL')
depends=(libgl libxmu gcc-libs freetype2 cairo)
depends+=(libgnustep-gui.so)
makedepends=('gnustep-make' 'gnustep-base' 'gnustep-gui>=0.30.0' 'libffi' 'gcc-objc')
makedepends=( ${makedepends[*]/gnustep-base/} ) # this is a run-time dependency (also deps of gnustep-gui)
makedepends=( ${makedepends[*]/gnustep-gui*/} ) # this is a run-time dependency
groups=('gnustep-core')
source=(https://github.com/gnustep/libs-back/releases/download/back-${pkgver//./_}/$pkgname-$pkgver.tar.gz{,.sig})
sha256sums=('60177d44beebd0216be4aa7eea6cf009cf9ff844bc35f0eacd622bf710372cff'
            'SKIP')
validpgpkeys=('83AAE47CE829A4146EF83420CA868D4C99149679')

build() {
  cd "$srcdir"/$pkgname-$pkgver
  . /usr/share/GNUstep/Makefiles/GNUstep.sh
  ./configure --prefix=/usr --sysconfdir=/etc/GNUstep
  make
}

package() {
  cd "$srcdir"/$pkgname-$pkgver
  . /usr/share/GNUstep/Makefiles/GNUstep.sh
  make DESTDIR="$pkgdir" install
  mkdir -p "$pkgdir"/etc/ld.so.conf.d
  cat >"$pkgdir"/etc/ld.so.conf.d/gnustep.conf <<EOF
/opt/GNUstep/System/Library/Libraries
/usr/lib/GNUstep/Libraries
EOF
}
