summaryrefslogtreecommitdiff
blob: 98718f10a5c6860178e9f1e20cec7e75cc20d133 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
# Copyright 1999-2023 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2

EAPI=7

SRC_URI="https://github.com/Aetf/kmscon/releases/download/v${PV}/${P}.tar.xz"
KEYWORDS="~amd64 ~x86"

inherit meson flag-o-matic toolchain-funcs

DESCRIPTION="KMS/DRM based virtual Console Emulator"
HOMEPAGE="https://github.com/Aetf/kmscon"

LICENSE="MIT LGPL-2.1 BSD-2"
SLOT="0"
IUSE="debug doc +drm +fbdev +gles2 +pango pixman systemd test"
RESTRICT="!test? ( test )"

COMMON_DEPEND="
	>=virtual/udev-172
	x11-libs/libxkbcommon
	>=dev-libs/libtsm-4.0.0:=
	media-libs/libglvnd[X(+)]
	drm? ( x11-libs/libdrm
		>=media-libs/mesa-8.0.3[egl(+),gbm(+)] )
	systemd? ( sys-apps/systemd )
	pango? ( x11-libs/pango dev-libs/glib:2 )
	pixman? ( x11-libs/pixman )"
RDEPEND="${COMMON_DEPEND}
	x11-misc/xkeyboard-config"
DEPEND="${COMMON_DEPEND}
	x11-base/xorg-proto"
BDEPEND="virtual/pkgconfig
	doc? ( dev-util/gtk-doc )"

REQUIRED_USE="drm? ( gles2 )"

PATCHES=( "${FILESDIR}"/kmscon-9.0.0-systemd-path-fix.patch )

src_prepare() {
	default
	export CC_FOR_BUILD="$(tc-getBUILD_CC)"
}

src_configure() {

	# kmscon sets -ffast-math unconditionally
	strip-flags

	local emesonargs=(
		$(meson_feature doc docs)
		$(meson_use debug)
		$(meson_feature systemd multi_seat)
		$(meson_feature fbdev video_fbdev)
		$(meson_feature drm video_drm2d)
		$(meson_feature drm video_drm3d)
		-Dfont_unifont=enabled
		$(meson_feature pango font_pango)
		-Drenderer_bbulk=enabled
		$(meson_feature gles2 renderer_gltex)
		$(meson_feature pixman renderer_pixman)
		$(meson_use test tests)
		-Dsession_dummy=enabled
		-Dsession_terminal=enabled
	)

	meson_src_configure
}

pkg_postinst() {
	grep -e "^ERASECHAR" "${EROOT}"/etc/login.defs && \
	ewarn "It is recommended that you comment out the ERASECHAR line in" && \
	ewarn " /etc/login.defs for proper backspace functionality at the" && \
	ewarn " kmscon login prompt.  For details see:" && \
	ewarn "https://github.com/dvdhrm/kmscon/issues/69#issuecomment-13827797"
}