# Maintainer: Levente Polyak <anthraxx[at]archlinux[dot]org>
# Contributor: Gaetan Bisson <bisson@archlinux.org>
# Contributor: Vesa Kaihlavirta <vesa@archlinux.org>
# Contributor: Roman Cheplyaka <roma@ro-che.info>

pkgname=libedit
pkgver=20251016_3.1
_pkgver=${pkgver/_/-}
pkgrel=1
pkgdesc='Command line editor library providing generic line editing, history, and tokenization functions'
url='https://thrysoee.dk/editline/'
arch=(x86_64 aarch64)
license=(BSD-3-Clause)
depends=(
  glibc
  libncursesw.so
  ncurses
)
source=(${url}/${pkgname}-${_pkgver}.tar.gz)
b2sums=('2ea177f349c2a976e11fed07dcfef78d640f5e44f0524930a9872563dff66b29775c89569491579c4d59f1480711d48c78232e0f5f7538509df28794b6607f4e')

build() {
  cd ${pkgname}-${_pkgver}
  ./configure \
    --prefix=/usr
  make V=1
}

package() {
  provides=(libedit.so)

  cd ${pkgname}-${_pkgver}
  make DESTDIR="${pkgdir}" install

  install -Dm 644 ChangeLog -t "${pkgdir}/usr/share/doc/${pkgname}"
  install -Dm 644 COPYING -t "${pkgdir}/usr/share/licenses/${pkgname}"
}

# vim:set sw=2 sts=-1 et:
