915523df803a9f1003c3f69fcfc3185613ac784c
[gentoo.git] / x11-terms / mlterm / mlterm-3.8.8-r1.ebuild
1 # Copyright 1999-2020 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
3
4 EAPI="7"
5
6 inherit desktop
7
8 DESCRIPTION="A multi-lingual terminal emulator"
9 HOMEPAGE="http://mlterm.sourceforge.net/"
10 SRC_URI="mirror://sourceforge/${PN}/${P}.tar.gz"
11
12 LICENSE="BSD"
13 SLOT="0"
14 KEYWORDS="~amd64 ~ppc ~ppc64 ~x86"
15 IUSE="bidi brltty cairo canna debug fbcon fcitx freewnn gtk gtk2 harfbuzz ibus libssh2 m17n-lib nls regis scim skk static-libs uim utempter wayland xft"
16 REQUIRED_USE="gtk2? ( gtk )"
17
18 RDEPEND="x11-libs/libICE
19         x11-libs/libSM
20         x11-libs/libX11
21         bidi? ( dev-libs/fribidi )
22         brltty? ( app-accessibility/brltty )
23         cairo? ( x11-libs/cairo[X(+)] )
24         canna? ( app-i18n/canna )
25         fbcon? ( media-fonts/unifont )
26         fcitx? ( app-i18n/fcitx )
27         freewnn? ( app-i18n/freewnn )
28         gtk? (
29                 gtk2? ( x11-libs/gtk+:2 )
30                 !gtk2? ( x11-libs/gtk+:3 )
31         )
32         harfbuzz? ( media-libs/harfbuzz[truetype(+)] )
33         ibus? ( app-i18n/ibus )
34         libssh2? ( net-libs/libssh2 )
35         m17n-lib? ( dev-libs/m17n-lib )
36         nls? ( virtual/libintl )
37         regis? (
38                 || (
39                         media-libs/sdl-ttf
40                         media-libs/sdl2-ttf
41                 )
42         )
43         scim? ( app-i18n/scim )
44         skk? (
45                 || (
46                         virtual/skkserv
47                         app-i18n/skk-jisyo
48                 )
49         )
50         uim? ( app-i18n/uim )
51         utempter? ( sys-libs/libutempter )
52         wayland? ( dev-libs/wayland )
53         xft? ( x11-libs/libXft )"
54 DEPEND="${RDEPEND}
55         virtual/pkgconfig
56         nls? ( sys-devel/gettext )"
57
58 PATCHES=( "${FILESDIR}"/${PN}-font.patch )
59 DOCS=( doc/{en,ja} )
60
61 src_prepare() {
62         # default config
63         sed -i \
64                 -e "/ icon_path =/aicon_path = ${EPREFIX}/usr/share/pixmaps/${PN}-icon.svg" \
65                 -e "/ scrollbar_view_name =/ascrollbar_view_name = sample" \
66                 etc/main
67
68         default
69 }
70
71 src_configure() {
72         local myconf=(
73                 $(use_enable bidi fribidi)
74                 $(use_enable brltty brlapi)
75                 $(use_enable canna)
76                 $(use_enable debug)
77                 $(use_enable fcitx)
78                 $(use_enable freewnn wnn)
79                 $(use_enable harfbuzz otl)
80                 $(use_enable ibus)
81                 $(use_enable libssh2 ssh2)
82                 $(use_enable m17n-lib m17nlib)
83                 $(use_enable nls)
84                 $(use_enable scim)
85                 $(use_enable skk)
86                 $(use_enable uim)
87                 $(use_enable utempter utmp)
88                 --with-gui=xlib$(usex fbcon ",fb" "")$(usex wayland ",wayland" "")
89                 --with-type-engines=xcore$(usex xft ",xft" "")$(usex cairo ",cairo" "")
90                 --enable-optimize-redrawing
91                 --enable-vt52
92                 --disable-static
93         )
94
95         local scrollbars="sample,extra"
96         local tools="mlclient,mlcc,mlfc,mlmenu,${PN}-zoom"
97         if use gtk; then
98                 myconf+=(
99                         $(use_with gtk gtk $(usex gtk2 2.0 3.0))
100                         --with-imagelib=gdk-pixbuf
101                 )
102                 scrollbars+=",pixmap_engine"
103                 tools+=",mlconfig,mlimgloader"
104         fi
105         if use regis; then
106                 tools+=",registobmp"
107         fi
108         myconf+=( --with-scrollbars="${scrollbars}" )
109         myconf+=( --with-tools="${tools}" )
110
111         addpredict /dev/ptmx
112         econf "${myconf[@]}"
113 }
114
115 src_test() {
116         :
117 }
118
119 src_install() {
120         default
121         find "${ED}" -name '*.la' -delete || die
122
123         docinto contrib/icon
124         dodoc contrib/icon/README
125
126         doicon contrib/icon/${PN}*
127         make_desktop_entry ${PN} ${PN} ${PN}-icon "System;TerminalEmulator"
128 }