*/*: Drop stable ia64 keywords
[gentoo.git] / dev-libs / newt / newt-0.52.21.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         eapply_user
58         eautoreconf
59 }
60
61 src_configure() {
62         configuring() {
63                 econf \
64                         PYTHONVERS="${PYTHON}" \
65                         $(use_with gpm gpm-support) \
66                         $(use_with tcl) \
67                         $(use_enable nls)
68         }
69         python_foreach_impl configuring
70 }
71
72 src_compile() {
73         building() {
74                 emake PYTHONVERS="${EPYTHON}"
75         }
76         python_foreach_impl building
77 }
78
79 src_install() {
80         installit() {
81                 emake \
82                         DESTDIR="${D}" \
83                         PYTHONVERS="${EPYTHON}" \
84                         install
85                 python_optimize
86         }
87         python_foreach_impl installit
88         dodoc peanuts.py popcorn.py tutorial.sgml
89         doman whiptail.1
90         einstalldocs
91 }