# Maintainer: LoveSy <shana@zju.edu.cn>

pkgbase=flexcpp
pkgname=flexc++
pkgver=2.15.00
pkgrel=1
pkgdesc="C++ scanner generator"
arch=('i686' 'x86_64')
url="https://fbb-git.gitlab.io/flexcpp/"
license=('GPL')
# Versions taken from the 'required' file in sources
depends=('libbobcat>=4.01.00')
makedepends=('icmake>=8.00.04' 'yodl>=3.06.00' 'libbobcat-devel>=4.01.00' 'gcc' 'git')
optdepends=()
source=("${pkgbase}"::git+https://gitlab.com/fbb-git/flexcpp.git#tag=${pkgver})
sha256sums=('SKIP')

build() {
  cd "${srcdir}/${pkgbase}/flexc++"

  CXXFLAGS="$CXXFLAGS --std=c++17"
  # Add the -P option not to use precompiled headers, which can be useful since
  # they require a lot of free space, compared to a normal compilation:
  # ./build -P program
  ./build program
  ./build man
  ./build manual
}

package() {
  cd "${srcdir}/${pkgbase}/flexc++"

  # Since 2.03.02, first argument to install is <what to install> (x = all),
  # and second is the base directory
  ./build install x "${pkgdir}"
}
