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.
19 pkgversion="$(echo $version | tr - _)"
22 # Set 'outdir' for a nice and well-organized output directory
23 outdir="${outdir}/${arch}/libs"
25 tarname=${program}-${version}.tgz
28 fetch=http://invisible-mirror.net/archives/ncurses/current/$tarname
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
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
47 # Source documentation
48 docs="ANNOUNCE AUTHORS COPYING NEWS README TO-DO VERSION"
49 docsdir="${docdir}/${program}-${pkgversion}"
55 unpack "${tardir}/$tarname"
59 # Set sane permissions
60 chmod -R u+w,go-w,a+rX-s .
63 CFLAGS="$QICFLAGS" CXXFLAGS="$QICXXFLAGS" LDFLAGS="$QILDFLAGS" \
65 --libdir=/usr/lib${libSuffix} \
70 --with-pkg-config-libdir=/usr/lib${libSuffix}/pkgconfig \
76 --build="$(cc -dumpmachine)"
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
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"
93 cd "${destdir}/usr/lib${libSuffix}/pkgconfig" && \
94 ln -sf ${name}w.pc ${name}.pc
97 # Backward compatibility
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
105 ln -sf ncursesw6-config "${destdir}/usr/bin/ncurses6-config"
107 # Compress and link man pages (if needed)
108 if test -d "${destdir}/$mandir"
111 cd "${destdir}/$mandir"
112 find . -type f -exec lzip -9 '{}' +
113 find . -type l | while read -r file
115 ln -sf "$(readlink -- "$file").lz" "${file}.lz"
122 mkdir -p "${destdir}${docsdir}"
123 cp -p $docs "${destdir}${docsdir}/"