create libcurses as a symlink (#2291)
[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"
4a54cf3b
FF
3TERMUX_PKG_VERSION=6.1.20180317
4TERMUX_PKG_SHA256=d332ea3bf7c1c1c1cbd86542d22c93ff7c85566c6e41d3ded109adf14b421d3c
68e1ebd6 5TERMUX_PKG_SRCURL=https://dl.bintray.com/termux/upstream/ncurses-${TERMUX_PKG_VERSION:0:3}-${TERMUX_PKG_VERSION:4}.tgz
59f0d218 6# --without-normal disables static libraries:
707ee7e7 7# --disable-stripping to disable -s argument to install which does not work when cross compiling:
aaff9cad
FF
8TERMUX_PKG_EXTRA_CONFIGURE_ARGS="
9ac_cv_header_locale_h=no
707ee7e7 10--disable-stripping
aaff9cad
FF
11--enable-const
12--enable-ext-colors
13--enable-ext-mouse
14--enable-overwrite
15--enable-pc-files
16--enable-widec
17--mandir=$TERMUX_PREFIX/share/man
18--without-ada
19--without-cxx-binding
20--without-debug
21--without-normal
22--without-static
23--without-tests
24--with-shared
25"
0411bce9 26TERMUX_PKG_INCLUDE_IN_DEVPACKAGE="
1a580cee 27share/man/man1/ncursesw6-config.1*
0411bce9
S
28bin/ncursesw6-config
29"
2e27b20c
FF
30TERMUX_PKG_RM_AFTER_INSTALL="
31bin/captoinfo
32bin/infotocap
1a580cee
FF
33share/man/man1/captoinfo.1*
34share/man/man1/infotocap.1*
35share/man/man5
36share/man/man7
2e27b20c
FF
37"
38
39termux_step_pre_configure() {
40 TERMUX_PKG_EXTRA_CONFIGURE_ARGS+=" --with-pkg-config-libdir=$PKG_CONFIG_LIBDIR"
41}
59f0d218 42
59f0d218
FF
43termux_step_post_make_install () {
44 cd $TERMUX_PREFIX/lib
45 for lib in form menu ncurses panel; do
de357946 46 for file in lib${lib}w.so*; do
59f0d218
FF
47 ln -s -f $file `echo $file | sed 's/w//'`
48 done
49 (cd pkgconfig && ln -s -f ${lib}w.pc `echo $lib | sed 's/w//'`.pc)
50 done
5eae9c36
H
51 # some packages wants libcurses while building/compiling
52 ln -sf libncurses.so libcurses.so
59f0d218 53
aed0f112
FF
54 # Some packages wants this:
55 cd $TERMUX_PREFIX/include/
56 rm -Rf ncursesw
57 mkdir ncursesw
58 cd ncursesw
59 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} .
59f0d218 60}
9ff2bc5d
FF
61
62termux_step_post_massage () {
63 # Strip away 30 years of cruft to decrease size.
86cb8449 64 local TI=$TERMUX_PKG_MASSAGEDIR/$TERMUX_PREFIX/share/terminfo
9ff2bc5d 65 mv $TI $TERMUX_PKG_TMPDIR/full-terminfo
fc19ac86 66 mkdir -p $TI/{a,d,e,n,l,p,r,s,t,v,x}
9ff2bc5d 67 cp $TERMUX_PKG_TMPDIR/full-terminfo/a/ansi $TI/a/
85fba239
FF
68 cp $TERMUX_PKG_TMPDIR/full-terminfo/d/{dtterm,dumb} $TI/d/
69 cp $TERMUX_PKG_TMPDIR/full-terminfo/e/eterm-color $TI/e/
9ff2bc5d
FF
70 cp $TERMUX_PKG_TMPDIR/full-terminfo/n/nsterm $TI/n/
71 cp $TERMUX_PKG_TMPDIR/full-terminfo/l/linux $TI/l/
72 cp $TERMUX_PKG_TMPDIR/full-terminfo/p/putty{,-256color} $TI/p/
73 cp $TERMUX_PKG_TMPDIR/full-terminfo/r/rxvt{,-256color} $TI/r/
74 cp $TERMUX_PKG_TMPDIR/full-terminfo/s/screen{,2,-256color} $TI/s/
fc19ac86 75 cp $TERMUX_PKG_TMPDIR/full-terminfo/t/tmux{,-256color} $TI/t/
9ff2bc5d
FF
76 cp $TERMUX_PKG_TMPDIR/full-terminfo/v/{vt52,vt100,vt102} $TI/v/
77 cp $TERMUX_PKG_TMPDIR/full-terminfo/x/xterm{,-color,-new,-16color,-256color,+256color} $TI/x/
86cb8449
FF
78
79 local RXVT_TAR=$TERMUX_PKG_CACHEDIR/rxvt-unicode-9.22.tar.bz2
9c644283 80 termux_download https://fossies.org/linux/misc/rxvt-unicode-9.22.tar.bz2 \
86cb8449
FF
81 $RXVT_TAR \
82 e94628e9bcfa0adb1115d83649f898d6edb4baced44f5d5b769c2eeb8b95addd
83 cd $TERMUX_PKG_TMPDIR
84 local TI_FILE=rxvt-unicode-9.22/doc/etc/rxvt-unicode.terminfo
85 tar xf $RXVT_TAR $TI_FILE
86 tic -x -o $TI $TI_FILE
9ff2bc5d 87}