# Maintainer: Balló György <ballogyor+arch at gmail dot com>

pkgname=sugar-toolkit-gtk3
pkgver=0.118
pkgrel=1
pkgdesc="Sugar GTK library"
arch=('x86_64')
url="https://sugarlabs.org/"
license=('LGPL')
depends=('alsa-lib' 'gtk3' 'libsm' 'python-cairo' 'python-dateutil' 'python-decorator'
         'python-six' 'sugar-artwork' 'sugar-datastore' 'telepathy-mission-control' 'unzip')
makedepends=('intltool' 'gobject-introspection')
optdepends=('webkit2gtk: run sugar-activity-web')
source=(https://download.sugarlabs.org/sources/sucrose/glucose/$pkgname/$pkgname-$pkgver.tar.xz)
sha256sums=('94cffb71e5025de0faa388bf9b9f1a24802e9c1c05c81e4a92db704a356adad6')

build() {
  cd $pkgname-$pkgver
  # Disable hardened build until fixed upstream
  # https://bugs.sugarlabs.org/ticket/4886
  export CFLAGS=${CFLAGS/ -fno-plt}
  export LDFLAGS=${LDFLAGS/,-z,now}

  ./configure --prefix=/usr
  sed -i 's/ -shared / -Wl,-O1,--as-needed\0/g' libtool
  make -j1
}

package() {
  cd $pkgname-$pkgver
  make DESTDIR="$pkgdir" install
  rm "$pkgdir/usr/bin/sugar-activity"
}
