Strip libc.so before linking against it
[termux-packages] / packages / ncurses / build.sh
CommitLineData
59f0d218
FF
1TERMUX_PKG_HOMEPAGE=http://invisible-island.net/ncurses/
2TERMUX_PKG_DESCRIPTION="Library for text-based user interfaces in a terminal-independent manner"
469b1042
FF
3_MAJOR_VERSION=6.0
4# This is the patch number used for fetching a patch from ftp://invisible-island.net/ncurses/6.0/
59f0d218 5# in termux_step_post_extract_package below:
a0127004 6_MINOR_VERSION=20160910
59f0d218 7TERMUX_PKG_VERSION=${_MAJOR_VERSION}.${_MINOR_VERSION}
2497d957 8TERMUX_PKG_BUILD_REVISION=1
722ed12d 9TERMUX_PKG_SRCURL=https://mirrors.kernel.org/gnu/ncurses/ncurses-${_MAJOR_VERSION}.tar.gz
59f0d218
FF
10# --without-normal disables static libraries:
11TERMUX_PKG_EXTRA_CONFIGURE_ARGS="--enable-overwrite --enable-const --without-cxx-binding --without-normal --without-static --with-shared --without-debug --enable-widec --enable-ext-colors --enable-ext-mouse --enable-pc-files --with-pkg-config-libdir=$PKG_CONFIG_LIBDIR --without-ada --without-tests --mandir=$TERMUX_PREFIX/share/man ac_cv_header_locale_h=no"
12TERMUX_PKG_RM_AFTER_INSTALL="bin/ncursesw6-config share/man/man1/ncursesw6-config.1 bin/infotocap share/man/man1/infotocap.1m bin/captoinfo share/man/man1/captoinfo.1m"
13
14termux_step_post_extract_package () {
15 cd $TERMUX_PKG_SRCDIR
16 _PATCH_FILENAME=ncurses-${_MAJOR_VERSION}-${_MINOR_VERSION}-patch.sh
17 _PATCHFILE=$TERMUX_PKG_CACHEDIR/$_PATCH_FILENAME
18 test ! -f $_PATCHFILE && curl "ftp://invisible-island.net/ncurses/${_MAJOR_VERSION}/${_PATCH_FILENAME}.bz2" | bunzip2 - > $_PATCHFILE
19 sh $_PATCHFILE
20}
21
22termux_step_post_make_install () {
23 cd $TERMUX_PREFIX/lib
24 for lib in form menu ncurses panel; do
25 for file in lib${lib}w.so*; do
26 ln -s -f $file `echo $file | sed 's/w//'`
27 done
28 (cd pkgconfig && ln -s -f ${lib}w.pc `echo $lib | sed 's/w//'`.pc)
29 done
30
aed0f112
FF
31 # Some packages wants this:
32 cd $TERMUX_PREFIX/include/
33 rm -Rf ncursesw
34 mkdir ncursesw
35 cd ncursesw
36 ln -s ../{ncurses.h,termcap.h,panel.h,unctrl.h,menu.h,form.h,tic.h,nc_tparm.h,term.h,eti.h,term_entry.h,ncurses_dll.h,curses.h} .
37
59f0d218
FF
38 if [ `uname` = Darwin ]; then
39 cd $TERMUX_PREFIX/share/terminfo
40 for l in *; do
41 if [ ${#l} -eq 2 ]; then
ed021630 42 char=`echo 0x$l | /usr/bin/awk '{printf "%c\n", $1}'`
59f0d218
FF
43 rm -Rf $char
44 mv $l $char
45 fi
46 done
47 cd -
48 fi
49}
9ff2bc5d
FF
50
51termux_step_post_massage () {
1370734d 52 cd $TERMUX_PKG_MASSAGEDIR
9ff2bc5d
FF
53 # Strip away 30 years of cruft to decrease size.
54 local TI=./$TERMUX_PREFIX/share/terminfo
55 mv $TI $TERMUX_PKG_TMPDIR/full-terminfo
fc19ac86 56 mkdir -p $TI/{a,d,e,n,l,p,r,s,t,v,x}
9ff2bc5d 57 cp $TERMUX_PKG_TMPDIR/full-terminfo/a/ansi $TI/a/
85fba239
FF
58 cp $TERMUX_PKG_TMPDIR/full-terminfo/d/{dtterm,dumb} $TI/d/
59 cp $TERMUX_PKG_TMPDIR/full-terminfo/e/eterm-color $TI/e/
9ff2bc5d
FF
60 cp $TERMUX_PKG_TMPDIR/full-terminfo/n/nsterm $TI/n/
61 cp $TERMUX_PKG_TMPDIR/full-terminfo/l/linux $TI/l/
62 cp $TERMUX_PKG_TMPDIR/full-terminfo/p/putty{,-256color} $TI/p/
63 cp $TERMUX_PKG_TMPDIR/full-terminfo/r/rxvt{,-256color} $TI/r/
64 cp $TERMUX_PKG_TMPDIR/full-terminfo/s/screen{,2,-256color} $TI/s/
fc19ac86 65 cp $TERMUX_PKG_TMPDIR/full-terminfo/t/tmux{,-256color} $TI/t/
9ff2bc5d
FF
66 cp $TERMUX_PKG_TMPDIR/full-terminfo/v/{vt52,vt100,vt102} $TI/v/
67 cp $TERMUX_PKG_TMPDIR/full-terminfo/x/xterm{,-color,-new,-16color,-256color,+256color} $TI/x/
68}