x11-terms/tilda: Version bump (v1.5.0)
[gentoo.git] / x11-terms / st / st-0.8.2.ebuild
1 # Copyright 1999-2019 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
3
4 EAPI=7
5 inherit desktop multilib savedconfig toolchain-funcs
6
7 DESCRIPTION="simple terminal implementation for X"
8 HOMEPAGE="https://st.suckless.org/"
9 SRC_URI="https://dl.suckless.org/st/${P}.tar.gz"
10
11 LICENSE="MIT-with-advertising"
12 SLOT="0"
13 KEYWORDS="amd64 ~arm ~arm64 hppa ~ppc64 x86"
14 IUSE="savedconfig"
15
16 RDEPEND="
17         >=sys-libs/ncurses-6.0:0=
18         media-libs/fontconfig
19         x11-libs/libX11
20         x11-libs/libXft
21 "
22 DEPEND="
23         ${RDEPEND}
24         virtual/pkgconfig
25         x11-base/xorg-proto
26 "
27
28 src_prepare() {
29         default
30
31         sed -i \
32                 -e "/^X11LIB/{s:/usr/X11R6/lib:/usr/$(get_libdir)/X11:}" \
33                 -e '/^STLDFLAGS/s|= .*|= $(LDFLAGS) $(LIBS)|g' \
34                 -e '/^X11INC/{s:/usr/X11R6/include:/usr/include/X11:}' \
35                 config.mk || die
36         sed -i \
37                 -e '/tic/d' \
38                 Makefile || die
39
40         restore_config config.h
41 }
42
43 src_configure() {
44         sed -i \
45                 -e "s|pkg-config|$(tc-getPKG_CONFIG)|g" \
46                 config.mk || die
47
48         tc-export CC
49 }
50
51 src_install() {
52         emake DESTDIR="${D}" PREFIX="${EPREFIX}"/usr install
53
54         dodoc TODO
55
56         make_desktop_entry ${PN} simpleterm utilities-terminal 'System;TerminalEmulator;' ''
57
58         save_config config.h
59 }
60
61 pkg_postinst() {
62         if ! [[ "${REPLACING_VERSIONS}" ]]; then
63                 elog "Please ensure a usable font is installed, like"
64                 elog "    media-fonts/corefonts"
65                 elog "    media-fonts/dejavu"
66                 elog "    media-fonts/urw-fonts"
67         fi
68 }