# Maintainer: Christoph Reiter <reiter.christoph@gmail.com>

pkgname=cdecl
pkgver=18.7.2
pkgrel=1
pkgdesc="Composing and deciphering C (or C++) declarations or casts, aka 'gibberish.'"
arch=('i686' 'x86_64')
url="https://github.com/paul-j-lucas/cdecl"
msys2_repository_url='https://github.com/paul-j-lucas/cdecl'
license=('spdx:GPL-3.0-or-later')
depends=('ncurses' 'libreadline')
makedepends=('gcc' 'make' 'ncurses-devel' 'libreadline-devel' 'flex' 'bison' 'autotools')
source=("https://github.com/paul-j-lucas/cdecl/releases/download/cdecl-${pkgver}/cdecl-${pkgver}.tar.gz")
sha256sums=('e91cc201c79456b923b45cfa779da62f5ca91824d11c545167ee7bb33a9fb810')

prepare() {
  cd "${pkgname}-${pkgver}"

  autoreconf -vfi
}

build() {
  cd "${pkgname}-${pkgver}"

  ./configure \
    --build=${CHOST} \
    --prefix=/usr

  make
}

package() {
  cd "${pkgname}-${pkgver}"

  make DESTDIR="${pkgdir}" install
}
