# Maintainer: Natanael Copa pkgname=readline pkgver=8.2.1 pkgrel=2 _myver=${pkgver%.*} pkgdesc="GNU readline library" url="https://tiswww.cwru.edu/php/chet/readline/rltop.html" arch="all" options="!check" license="GPL-2.0-or-later" makedepends_host="ncurses-dev chrpath" subpackages="$pkgname-static $pkgname-dev $pkgname-doc libhistory" source="https://ftp.gnu.org/gnu/readline/readline-$_myver.tar.gz fix-ncurses-underlinking.patch inputrc " patch_args="-p0" # patchlevel used by upstream patches _i=1 while [ $_i -le ${pkgver##*.} ]; do _patch=$(printf "%03d" $_i) _name=$pkgname${_myver//./}-$_patch source="$source $_name.patch::https://ftp.gnu.org/gnu/readline/readline-$_myver-patches/$_name" _i=$((_i+1)) done builddir="$srcdir/$pkgname-$_myver" build() { ./configure \ --build=$CBUILD \ --host=$CHOST \ --prefix=/usr \ --mandir=/usr/share/man \ --infodir=/usr/share/info \ --enable-static \ --enable-shared make } package() { make -C "$builddir" DESTDIR="$pkgdir" install # verfy that its not underlinked as upstream designed it if ! readelf -d "$pkgdir"/usr/lib/libreadline.so | grep -q 'NEEDED.*ncurses'; then error "readline needs to be linked against ncurses" return 1 fi rmdir "$pkgdir"/usr/bin install -Dm644 "$srcdir"/inputrc "$pkgdir"/etc/inputrc chrpath -d "$pkgdir"/usr/lib/*.so.* } libhistory() { pkgdesc="GNU History Library" amove usr/lib/libhistory.so.* } sha512sums=" 0a451d459146bfdeecc9cdd94bda6a6416d3e93abd80885a40b334312f16eb890f8618a27ca26868cebbddf1224983e631b1cbc002c1a4d1cd0d65fba9fea49a readline-8.2.tar.gz b8e2f9a5c9294b49d35c2e1bbde523f01390dd3c8729f3a78e79799a236515ec723af795ba91b0a662a30e8c31df0f63bc80771e82cd31b4673f41428a5049ae fix-ncurses-underlinking.patch 5dbe872e94166aaed7ca2edec5a34ef9b13b254381e252cc6d851877b461579903cbb5b5dc588eabececcf1ebe636f6cb4da406cd01b64757f8c7e7f62e9a276 inputrc ea3800a62e992b3e594d78e77b6c4b662fb8c501b81010277e478656bb3b56db7747ba40c6c3d68c3ec5ab8e9e41be104788ec52268135d7e642ff40dea421a8 readline82-001.patch "