x11-terms/mlterm: amd64 stable wrt bug #722068
[gentoo.git] / x11-terms / mrxvt / mrxvt-0.5.4.ebuild
1 # Copyright 1999-2020 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
3
4 EAPI=7
5 inherit autotools eutils
6
7 DESCRIPTION="Multi-tabbed rxvt clone with XFT, transparent background and CJK support"
8 HOMEPAGE="http://materm.sourceforge.net/"
9 SRC_URI="mirror://sourceforge/materm/${P}.tar.gz"
10
11 LICENSE="GPL-2"
12 SLOT="0"
13 KEYWORDS="~alpha amd64 ~mips ppc x86 ~amd64-linux ~x86-linux ~ppc-macos"
14
15 L10N_IUSE="l10n_el l10n_ja l10n_ko l10n_th l10n_zh-CN l10n_zh-TW"
16 IUSE="debug png jpeg session truetype menubar utempter xpm ${L10N_IUSE}"
17
18 RDEPEND="png? ( media-libs/libpng )
19         utempter? ( sys-libs/libutempter )
20         jpeg? ( virtual/jpeg )
21         truetype? ( x11-libs/libXft
22                 media-libs/fontconfig
23                 media-libs/freetype
24                 elibc_uclibc? ( dev-libs/libiconv ) )
25         x11-libs/libX11
26         x11-libs/libXt
27         xpm? ( x11-libs/libXpm )
28         x11-libs/libXrender"
29
30 DEPEND="${RDEPEND}
31         x11-base/xorg-proto"
32
33 src_prepare() {
34         eapply "${FILESDIR}"/${P}-001-fix-segfault-when-wd-empty.patch
35         eapply "${FILESDIR}"/${P}-libpng14.patch
36         eapply_user
37
38         eautoreconf
39
40         if use elibc_uclibc && use truetype; then
41                 # It is stated in the README "Multichar support under XFT requires GNU iconv"
42                 sed -i -e 's/LIBS = @LIBS@/LIBS = @LIBS@ -liconv/' "${S}/src/Makefile.in"
43         fi
44 }
45
46 src_configure() {
47         local myconf
48
49         # if you want to pass any other flags, use EXTRA_ECONF.
50         if use l10n_el ; then
51                 myconf="${myconf} --enable-greek"
52         fi
53         if use l10n_ja ; then
54                 # --with-encoding=sjis
55                 myconf="${myconf} --enable-kanji --with-encoding=eucj"
56         fi
57         if use l10n_ko ; then
58                 myconf="${myconf} --enable-kr --with-encoding=kr"
59         fi
60         if use l10n_th ; then
61                 myconf="${myconf} --enable-thai"
62         fi
63         if use l10n_zh-CN ; then
64                 # --with-encoding=gbk
65                 myconf="${myconf} --enable-gb --with-encoding=gb"
66         fi
67         if use l10n_zh-TW ; then
68                 myconf="${myconf} --enable-big5 --with-encoding=big5"
69         fi
70
71         # 2006-03-13 gi1242: mrxvt works best with TERM=rxvt AND correctly set
72         # termcap / terminfo entries. If the rxvt termcap / terminfo entries are
73         # messed up then then it's better to set TERM=xterm.
74         #
75         # Provide support for this by setting the or RXVT_TERM environment variables
76         # before emerging, as done in the rxvt ebuild.
77
78         if [[ -n ${RXVT_TERM} ]]; then
79                 myconf="${myconf} --with-term=${RXVT_TERM}"
80         fi
81
82         econf \
83                 --enable-everything \
84                 --with-atab-extra=25 \
85                 $(use_enable debug) \
86                 $(use_enable jpeg) \
87                 $(use_enable png) \
88                 $(use_enable xpm) \
89                 $(use_enable session sessionmgr) \
90                 $(use_enable truetype xft) \
91                 $(use_enable utempter) \
92                 $(use_enable menubar) \
93                 ${myconf}
94 }
95
96 src_install() {
97         emake DESTDIR="${D}" docdir="${EPREFIX}"/usr/share/doc/${PF} install
98         # Give mrxvt perms to update utmp
99         fowners root:utmp /usr/bin/mrxvt
100         fperms g+s /usr/bin/mrxvt
101         dodoc AUTHORS CREDITS ChangeLog FAQ NEWS README* TODO
102 }
103
104 pkg_postinst() {
105         if [[ -z $RXVT_TERM ]]; then
106                 einfo
107                 einfo "If you experience problems with curses programs, then this is"
108                 einfo "most likely because of incorrectly set termcap / terminfo"
109                 einfo "entries. To fix this you can dry and run (as user)"
110                 einfo " tic /usr/share/doc/${P}/etc/mrxvt.terminfo"
111                 einfo "Alternately, run the offending programs with TERM=xterm."
112                 einfo
113                 einfo "To emerge mrxvt with TERM=xterm by default, set the RXVT_TERM"
114                 einfo "environment variable to 'xterm', or your desired default"
115                 einfo "terminal name. Alternately you can put 'Mrxvt.termName: xterm'"
116                 einfo "in your ~/.mrxvtrc, or /etc/mrxvt/mrxvtrc."
117                 einfo
118         fi
119 }