pkgs/ncurses/PKGBUILD

60 lines
1.9 KiB
Bash

# Maintainer: Daryl Ronningen <relms@relms.dev>
pkgname=ncurses
pkgver=6.4_20231202
pkgrel=1
pkgdesc='System V Release 4.0 curses emulation library'
arch=(x86_64)
url='https://invisible-island.net/ncurses/ncurses.html'
license=(MIT)
source=(https://invisible-mirror.net/archives/$pkgname/current/$pkgname-${pkgver/_/-}.tgz)
sha256sums=('f3f42e800eb8af42dddfb2e44ed9c91a7e5f51cf529e0cd91450e0b4db8cc471')
build() {
local configure_options=(
--prefix=/usr
--disable-root-access
--disable-root-environ
--disable-setuid-environ
--enable-widec
--enable-pc-files
--mandir=/usr/share/man
--with-cxx-binding
--with-cxx-shared
--with-manpage-format=normal
--with-pkg-config-libdir=/usr/lib/pkgconfig
--with-shared
--with-versioned-syms
--with-xterm-kbs=del
--without-ada
)
cd $pkgname-${pkgver/_/-}
./configure "${configure_options[@]}"
make
}
package() {
local _pkgver=${pkgver/_*/}
make DESTDIR="$pkgdir" install -C $pkgname-${pkgver/_/-}
install -vDm 644 $pkgname-${pkgver/_/-}/COPYING -t "$pkgdir/usr/share/licenses/$pkgname/"
# fool packages looking to link to non-wide-character ncurses libraries
for lib in ncurses ncurses++ form panel menu; do
printf "INPUT(-l%sw)\n" "${lib}" > "$pkgdir/usr/lib/lib${lib}.so"
ln -sv ${lib}w.pc "$pkgdir/usr/lib/pkgconfig/${lib}.pc"
done
# some packages look for -lcurses during build
printf 'INPUT(-lncursesw)\n' > "$pkgdir/usr/lib/libcursesw.so"
ln -sv libncurses.so "$pkgdir/usr/lib/libcurses.so"
# tic and ticinfo functionality is built in by default
# make sure that anything linking against it links against libncursesw.so instead
for lib in tic tinfo; do
printf "INPUT(libncursesw.so.%s)\n" "${_pkgver:0:1}" > "$pkgdir/usr/lib/lib${lib}.so"
ln -sv libncursesw.so.${pkgver:0:1} "$pkgdir/usr/lib/lib${lib}.so.${_pkgver:0:1}"
ln -sv ncursesw.pc "$pkgdir/usr/lib/pkgconfig/${lib}.pc"
done
}