# Maintainer: Alexander F. Rødseth <xyproto@archlinux.org>
# Contributor: Daichi Shinozaki <dsdseg@gmail.com>
# Contributor: Dwight Schauer <dschauer@gmail.com>
# Contributor: Stefan Husmann <stefan-husmann@t-online.de>
# Contributor: Christoph Zeiler <archNOSPAM_at_moonblade.dot.org>
# Contributor: Michael 'manveru' Fellinger <m.fellinger@gmail.com>
# Contributor: Caleb McCombs <erdrick016+aur@gmail.com>
# Contributor: Christian Hesse <arch@eworm.de>

pkgname=neko
pkgver=2.3.0
pkgrel=5
pkgdesc='High-level and dynamically typed programming language'
url='https://nekovm.org/'
license=(LGPL)
arch=(x86_64)
depends=(gc gtk3 mariadb-libs mbedtls sqlite)
makedepends=(apache apr cmake git mbedtls ninja)
optdepends=('apache: for extending Apache with mod_neko')
options=(!strip)
source=("git+https://github.com/HaxeFoundation/neko#tag=v${pkgver//./-}"
        gtk3.patch)
sha256sums=('SKIP'
            'c2e5428fffd5eec737c5ce6f165e2cb38f3943340dd24a06b8f39db7b6b7c544')

prepare() {
  cd $pkgname
  sed -i '/xlocale.h/d' libs/std/sys.c
  patch -p1 -i ../gtk3.patch
}

build() {
  mkdir -p build
  cd build
  cmake ../$pkgname \
    -DCMAKE_INSTALL_PREFIX=/usr \
    -DRUN_LDCONFIG=OFF \
    -GNinja
  ninja
}

package() {
  DESTDIR="$pkgdir" ninja -C build install
}

# getver: nekovm.org/download
