# Depends on:
name=ncurses
-version=5.9
-release=1
+version=6.0
+release=4
source=(http://ftp.gnu.org/gnu/$name/$name-$version.tar.gz)
build() {
cd $name-$version
- local OPTIONS="\
---build=$CHOST \
---host=$CTARGET \
---with-install-prefix=$PKG \
---prefix=/usr \
---with-normal \
---with-shared \
---without-debug \
---without-ada
-"
-
- ./configure $OPTIONS
+ ./configure --build=$CHOST \
+ --host=$CTARGET \
+ --with-install-prefix=$PKG \
+ --prefix=/usr \
+ --mandir=/usr/share/man \
+ --with-{normal,shared} \
+ --without-{debug,ada,tests} \
+ --enable-pc-files \
+ --enable-widec
+
make
- make install
- make distclean
-
- sed '/^BUILD_CCFLAGS/ s/-DHAVE_CONFIG_H/-DHAVE_CONFIG_H -D_GNU_SOURCE/' -i ncurses/Makefile.in
- ./configure $OPTIONS --enable-widec
- make
- make install
+ make DESTDIR=$PKG install
+
+ install -d $PKG/{lib,usr/include/ncursesw,usr/lib/pkgconfig}
- mkdir $PKG/lib
+ # move library to /lib and create symlinks
+ mv $PKG/usr/lib/libncursesw.so.* $PKG/lib
+ ln -sf ../../lib/libncursesw.so.$version $PKG/usr/lib/libncursesw.so
+ ln -s libncursesw.so.$version $PKG/lib/libncurses.so.${version%%.*}
- for i in w ''; do
- mv $PKG/usr/lib/libncurses$i.so.* $PKG/lib
- ln -sf libncurses$i.so $PKG/usr/lib/libcurses$i.so
- ln -sf ../../lib/libncurses$i.so.$version $PKG/usr/lib/libncurses$i.so
+ # linker scripts and .pc files for non-wide ncurses
+ for LIB in ncurses form panel menu ; do
+ echo "INPUT(-l${LIB}w)" > $PKG/usr/lib/lib${LIB}.so
+ ln -s ${LIB}w.pc $PKG/usr/lib/pkgconfig/${LIB}.pc
done
+
+ # linker script for the curses library
+ echo "INPUT(-lncursesw)" > $PKG/usr/lib/libcursesw.so
+ ln -s libncurses.so $PKG/usr/lib/libcurses.so
}