sys-process/glances: 3.1.4.1-r1 amd64 stable, bug #720368
[gentoo.git] / dev-libs / newt / newt-0.52.20.ebuild
1 # Copyright 1999-2020 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
3
4 EAPI=6
5
6 PYTHON_COMPAT=( python{2_7,3_6} )
7
8 inherit python-r1 multilib autotools toolchain-funcs
9
10 DESCRIPTION="Redhat's Newt windowing toolkit development files"
11 HOMEPAGE="https://pagure.io/newt"
12 SRC_URI="https://releases.pagure.org/newt/${P}.tar.gz"
13
14 LICENSE="LGPL-2"
15 SLOT="0"
16 KEYWORDS="~alpha amd64 arm arm64 hppa ~ia64 ~mips ppc ppc64 sparc x86"
17 IUSE="gpm nls tcl"
18
19 REQUIRED_USE="${PYTHON_REQUIRED_USE}"
20
21 RDEPEND="${PYTHON_DEPS}
22         >=dev-libs/popt-1.6
23         =sys-libs/slang-2*
24         elibc_uclibc? ( sys-libs/ncurses:0= )
25         gpm? ( sys-libs/gpm )
26         tcl? ( >=dev-lang/tcl-8.5:0 )
27         "
28 DEPEND="${RDEPEND}"
29
30 src_prepare() {
31         # bug 73850
32         if use elibc_uclibc; then
33                 sed -i -e 's:-lslang:-lslang -lncurses:g' Makefile.in || die
34         fi
35
36         sed -i Makefile.in \
37                 -e 's|$(SHCFLAGS) -o|$(LDFLAGS) &|g' \
38                 -e 's|-g -o|$(CFLAGS) $(LDFLAGS) -o|g' \
39                 -e 's|-shared -o|$(CFLAGS) $(LDFLAGS) &|g' \
40                 -e 's|instroot|DESTDIR|g' \
41                 -e 's|  make |  $(MAKE) |g' \
42                 -e "s|  ar |    $(tc-getAR) |g" \
43                 || die "sed Makefile.in"
44
45         local langs=""
46         if [ -n "${LINGUAS}" ]; then
47                 for lang in ${LINGUAS}; do
48                         test -r po/${lang}.po && langs="${langs} ${lang}.po"
49                 done
50                 sed -i po/Makefile \
51                         -e "/^CATALOGS = /cCATALOGS = ${langs}" \
52                         || die "sed po/Makefile"
53         fi
54
55         eapply "${FILESDIR}"/${PN}-0.52.13-gold.patch \
56                 "${FILESDIR}"/${PN}-0.52.14-tcl.patch \
57                 "${FILESDIR}"/${PN}-0.52.15-makefile.patch
58         eapply_user
59         eautoreconf
60 }
61
62 src_configure() {
63         configuring() {
64                 econf \
65                         PYTHONVERS="${PYTHON}" \
66                         $(use_with gpm gpm-support) \
67                         $(use_with tcl) \
68                         $(use_enable nls)
69         }
70         python_foreach_impl configuring
71 }
72
73 src_compile() {
74         building() {
75                 emake PYTHONVERS="${EPYTHON}"
76         }
77         python_foreach_impl building
78 }
79
80 src_install() {
81         installit() {
82                 emake \
83                         DESTDIR="${D}" \
84                         PYTHONVERS="${EPYTHON}" \
85                         install
86                 python_optimize
87         }
88         python_foreach_impl installit
89         dodoc peanuts.py popcorn.py tutorial.sgml
90         doman whiptail.1
91         einstalldocs
92 }