qi: doc: added 'Order files' section to the manual
[dragora.git] / recipes / libs / ncurses / recipe
blob09e4fde85e1b9516d8e0697e317dcd6ec30c5f2a
1 # Build recipe for ncurses.
3 # Copyright (c) 2016-2019 Matias Fonzo, <selk@dragora.org>.
5 # Licensed under the Apache License, Version 2.0 (the "License");
6 # you may not use this file except in compliance with the License.
7 # You may obtain a copy of the License at
9 #    http://www.apache.org/licenses/LICENSE-2.0
11 # Unless required by applicable law or agreed to in writing, software
12 # distributed under the License is distributed on an "AS IS" BASIS,
13 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 # See the License for the specific language governing permissions and
15 # limitations under the License.
17 program=ncurses
18 version=6.1-20190202
19 pkgversion="$(echo $version | tr - _)"
20 release=1
22 # Set 'outdir' for a nice and well-organized output directory
23 outdir="${outdir}/${arch}/libs"
25 tarname=${program}-${version}.tgz
27 # Remote source(s)
28 fetch=http://invisible-mirror.net/archives/ncurses/current/$tarname
30 description="
31 Emulation library of Curses.
33 The Ncurses (new curses) library is a free software emulation of
34 curses in System V Release 4.0.  The ncurses code was developed
35 under GNU/Linux.  It has been in use for some time with OpenBSD
36 as the system curses library, and on FreeBSD and NetBSD as an
37 external package.
39 The distribution includes the library and support utilities,
40 including a terminfo compiler \"tic\", a decompiler \"infocmp\",
41 clear, tput, tset, and a termcap conversion tool \"captoinfo\".
44 homepage=http://www.gnu.org/software/ncurses
45 license=Custom
47 # Source documentation
48 docs="ANNOUNCE AUTHORS COPYING NEWS README TO-DO VERSION"
49 docsdir="${docdir}/${program}-${pkgversion}"
51 build()
53     set -e
55     unpack "${tardir}/$tarname"
57     cd "$srcdir"
59     # Set sane permissions
60     chmod -R u+w,go-w,a+rX-s .
62     ./configure \
63     CFLAGS="$QICFLAGS" CXXFLAGS="$QICXXFLAGS" LDFLAGS="$QILDFLAGS" \
64      $configure_args \
65      --libdir=/usr/lib${libSuffix} \
66      --mandir=$mandir \
67      --enable-widec \
68      --enable-symlinks \
69      --enable-pc-files \
70      --with-pkg-config-libdir=/usr/lib${libSuffix}/pkgconfig \
71      --with-shared \
72      --with-normal \
73      --with-gpm \
74      --without-debug \
75      --without-ada \
76      --build="$(cc -dumpmachine)"
78     make -j${jobs} V=1
80     mkdir -p "${destdir}/usr/lib${libSuffix}/pkgconfig"
82     make -j${jobs} DESTDIR="$destdir" install
84     # Provide non-widec compatibility
86     for name in ncurses form panel menu
87     do
88         echo "INPUT(-l${name}w)" > \
89          "${destdir}/usr/lib${libSuffix}/lib${name}.so"
90         echo "INPUT(-l${name}w)" > \
91          "${destdir}/usr/lib${libSuffix}/lib${name}.a"
92         (
93             cd "${destdir}/usr/lib${libSuffix}/pkgconfig" && \
94              ln -sf ${name}w.pc ${name}.pc
95         )
96     done
97     # Backward compatibility
98     (
99         cd "${destdir}/usr/lib${libSuffix}" || exit 2
100         echo "INPUT(-lncursesw)" > libcursesw.so
101         ln -sf libncurses.so libcurses.so
102         ln -sf libncurses++w.a libncurses++.a
103     )
104     # Just in case
105     ln -sf ncursesw6-config "${destdir}/usr/bin/ncurses6-config"
107     # Compress and link man pages (if needed)
108     if test -d "${destdir}/$mandir"
109     then
110         (
111             cd "${destdir}/$mandir"
112             find . -type f -exec lzip -9 '{}' +
113             find . -type l | while read -r file
114             do
115                 ln -sf "$(readlink -- "$file").lz" "${file}.lz"
116                 rm -- "$file"
117             done
118         )
119     fi
121     # Copy documentation
122     mkdir -p "${destdir}${docsdir}"
123     cp -p $docs "${destdir}${docsdir}/"