x11-terms/mlterm: new upstream release
[gentoo.git] / x11-terms / kterm / kterm-6.2.0-r6.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 inherit flag-o-matic toolchain-funcs
7
8 DESCRIPTION="Japanese Kanji X Terminal"
9 #HOMEPAGE="http://www.asahi-net.or.jp/~hc3j-tkg/kterm/"
10 HOMEPAGE="https://wiki.gentoo.org/wiki/No_homepage"
11 SRC_URI="mirror://gentoo/${P}.tar.gz
12         mirror://gentoo/${P}-wpi.patch.gz
13         mirror://gentoo/${P}.ext02.patch.gz"
14
15 LICENSE="MIT HPND XC"
16 SLOT="0"
17 KEYWORDS="-alpha amd64 ~ppc ~sparc x86 ~amd64-linux ~x86-linux ~ppc-macos"
18 IUSE="Xaw3d"
19
20 RDEPEND="app-text/rman
21         sys-libs/ncurses:=
22         x11-libs/libXaw
23         x11-libs/libXmu
24         x11-libs/libXpm
25         x11-libs/libxkbfile
26         Xaw3d? ( x11-libs/libXaw3d )"
27 DEPEND="${RDEPEND}
28         x11-misc/gccmakedep
29         x11-misc/imake"
30
31 PATCHES=(
32         "${WORKDIR}"/${P}-wpi.patch             # wallpaper patch
33         "${WORKDIR}"/${P}.ext02.patch           # JIS 0213 support
34         "${FILESDIR}"/${PN}-openpty.patch
35         "${FILESDIR}"/${PN}-gentoo.patch
36         "${FILESDIR}"/${PN}-ad-gentoo.patch
37         "${FILESDIR}"/${PN}-underline.patch
38 )
39
40 src_prepare() {
41         default
42         use Xaw3d && eapply "${FILESDIR}"/${PN}-Xaw3d.patch
43 }
44
45 src_configure() {
46         xmkmf -a || die
47 }
48
49 src_compile() {
50         emake \
51                 CC="$(tc-getCC)" \
52                 CDEBUGFLAGS="${CFLAGS}" \
53                 LOCAL_LDFLAGS="${LDFLAGS}" \
54                 TERMCAPLIB="$("$(tc-getPKG_CONFIG)" --libs ncurses)" \
55                 XAPPLOADDIR="${EPREFIX}/usr/share/X11/app-defaults"
56 }
57
58 src_install() {
59         emake \
60                 BINDIR="${EPREFIX}/usr/bin" \
61                 XAPPLOADDIR="${EPREFIX}/usr/share/X11/app-defaults" \
62                 DESTDIR="${D}" \
63                 install
64         einstalldocs
65
66         # install man pages
67         newman ${PN}.man ${PN}.1
68         iconv -f ISO-2022-JP -t UTF-8 ${PN}.jman > ${PN}.ja.1
69         doman ${PN}.ja.1
70
71         # Remove link to avoid collision
72         rm -f "${ED}"/usr/lib/X11/app-defaults
73 }
74
75 pkg_postinst() {
76         elog
77         elog "KTerm wallpaper support is enabled."
78         elog "In order to use this feature,"
79         elog "you need specify favourite xpm file with -wp option"
80         elog
81         elog "\t% ${PN} -wp filename.xpm"
82         elog
83         elog "or set it with X resource"
84         elog
85         elog "\tKTerm*wallPaper: /path/to/filename.xpm"
86         elog
87 }