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

pkgname=cdecl
pkgver=14.4
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"
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=('093449995ea286c47a45b330ea6f3b4ab7ff47d0f11ba1d4f0a400d3cd174f4d')

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

  autoreconf -vfi
}

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

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

  make
}

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

  make DESTDIR="${pkgdir}" install
}
