# Maintainers: 
# Eric Schulte <eschulte@grammatech.com>
# Xiaowen Hu <xihu5895@uni.sydney.edu.au>

#
# This PKGBUILD is automatically generated and always points to the 
# latest release from the souffle official repository.
# Source: .github/images/arch-linux/PKGBUILD.in
#

pkgname=souffle
pkgver=${RELEASE_TAG}
pkgrel=1
pkgdesc="Soufflé is a translator of declarative Datalog programs into the C++ language"
arch=('any')
url="https://github.com/souffle-lang/souffle"
license=('UPL')
groups=()
depends=('mcpp' 'gcc>=8' 'openmp' 'sqlite' 'python3')
makedepends=('git' 'cmake>=3.15' 'bison>=3.6' 'flex' 'libffi' 'ncurses' 'zlib' 'python3')
optdepends=('bash-completion')
provides=('souffle')
conflicts=('souffle-git')
source=(souffle-${RELEASE_TAG}.tar.gz::https://github.com/${REPO_OWNER}/souffle/archive/${RELEASE_TAG}.tar.gz)
md5sums=('SKIP')

build() {
  cd souffle-${pkgver}
  cmake -S . -B ./build \
    -DCMAKE_INSTALL_PREFIX=/usr \
    -DSOUFFLE_GIT=OFF \
    -DPACKAGE_VERSION=${pkgver} \
    -DGIT_PACKAGE_VERSION=${pkgver}

  cmake --build ./build --parallel "$(nproc)"
}

package() {
  cd souffle-${pkgver}/build
  make DESTDIR="$pkgdir/" install
}
