# Maintainer: John Butera <john@jbutera.net>

_realname=cdecl-blocks
pkgname=cdecl
pkgver=2.5
pkgrel=1
pkgdesc="A program for encoding and decoding C (or C++) type declarations"
arch=('i686' 'x86_64')
url="https://cdecl.org/"
options=('strip' 'staticlibs' '!makeflags')
license=('public-domain')
depends=("libedit")
makedepends=("gcc" 'make' 'libedit-devel' 'flex' 'bison')
source=("https://cdecl.org/files/cdecl-blocks-2.5.tar.gz"
        "build.patch")
sha256sums=('9ee6402be7e4f5bb5e6ee60c6b9ea3862935bf070e6cecd0ab0842305406f3ac'
            'a69609f569dd332879d803f60ef400e9243dc7b91ee9842b9c149151fbd49066')

prepare() {
  cd "${srcdir}/${_realname}-${pkgver}"
  patch -p1 -i "${srcdir}/build.patch"
}

build() {
  cd ${srcdir}/${_realname}-${pkgver}
  make
}

package() {
  cd ${srcdir}/${_realname}-${pkgver}
  make PREFIX="${pkgdir}" install
}
