comparison gnu/ncurses/ncurses.sh @ 1114:6de02aa035d2

gnu: move GNU packages to this category
author David Demelier <markand@malikania.fr>
date Thu, 19 Sep 2019 15:09:24 +0200
parents lib/ncurses/ncurses.sh@ddab65a5b3f5
children 297b5eef115e
comparison
equal deleted inserted replaced
1113:5c0dfe68c5a8 1114:6de02aa035d2
1 #!/bin/busybox sh
2 #
3 # Copyright (c) 2019 David Demelier <markand@malikania.fr>
4 #
5 # Permission to use, copy, modify, and/or distribute this software for any
6 # purpose with or without fee is hereby granted, provided that the above
7 # copyright notice and this permission notice appear in all copies.
8 #
9 # THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
10 # WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
11 # MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
12 # ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
13 # WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
14 # ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
15 # OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
16 #
17
18 PKGNAME=ncurses
19 PKGVERSION=6.1
20 PKGREVISION=1
21 PKGLICENSE="MIT"
22 PKGSUMMARY="curses library"
23 PKGDOWNLOAD="https://ftp.gnu.org/pub/gnu/$PKGNAME/$PKGNAME-$PKGVERSION.tar.gz"
24
25 : ${CHOST:=$(uname -m)-linux-musl}
26 : ${CBUILD:=$(uname -m)-linux-musl}
27 : ${CC:=clang}
28 : ${CFLAGS:=-O2}
29 : ${LDFLAGS:=}
30 : ${LIBS:=}
31
32 build()
33 {
34 rm -rf $PKGNAME-$PKGVERSION
35 tar xvf $PKGNAME-$PKGVERSION.tar.gz
36 cd $PKGNAME-$PKGVERSION
37
38 # --enable-overwrite: required when prefix is not /usr.
39 # --enable-pc-files: lots of packages require this.
40 # --enable-widec: some packages require this it (e.g. neomutt).
41 # --with-manpage-format=normal: vpk compress by itself.
42 CC="$CC" \
43 CFLAGS="$CFLAGS" \
44 LDFLAGS="$LDFLAGS" \
45 LIBS="$LIBS" \
46 ./configure \
47 --build=$CBUILD \
48 --host=$CHOST \
49 --enable-overwrite \
50 --enable-pc-files \
51 --enable-widec \
52 --prefix= \
53 --with-manpage-format=normal \
54 --with-pkg-config-libdir=/lib/pkgconfig \
55 --with-shared \
56 --without-debug
57 make
58 make install DESTDIR=$DESTDIR
59
60 # For each wide library, create a input link.
61 for lib in ncurses ncurses++ form panel menu; do
62 echo "INPUT(-l${lib}w)" > $DESTDIR/lib/lib${lib}.so
63 ln -s ${lib}w.pc $DESTDIR/lib/pkgconfig/${lib}.pc
64 done
65
66 # Create a legacy libcurses library.
67 echo "INPUT(-lncursesw)" > $DESTDIR/lib/libcursesw.so
68 ln -s libncurses.so $DESTDIR/lib/libcurses.so
69
70 cd ..
71 rm -rf $PKGNAME-$PKGVERSION
72 }