summaryrefslogtreecommitdiff
path: root/gui-apps/oledsaver/oledsaver-1.0.10.ebuild
blob: 5ec323e900608280a9936eccacae382192f395fc (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
77
78
79
80
81
82
83
84
85
# Copyright 2024 Gentoo Authors
# Distributed under the terms of the MIT License

EAPI=8

inherit toolchain-funcs

DESCRIPTION="OLED-friendly Matrix rain screensaver for wlroots Wayland compositors"
HOMEPAGE=""
SRC_URI=""

LICENSE="MIT"
SLOT="0"
KEYWORDS="~amd64"

BDEPEND="
	dev-libs/wayland
	dev-libs/wayland-protocols
	virtual/pkgconfig
"

DEPEND="
	dev-libs/json-c:=
	dev-libs/wayland
	gui-wm/wayfire:=
	media-libs/freetype:2
	media-libs/mesa[egl(+),gles2(+)]
"

RDEPEND="
	${DEPEND}
	media-libs/fontconfig
	!gui-apps/oledsaver-cursor
"

S="${WORKDIR}/${P}"

src_unpack() {
	mkdir -p "${S}" || die
	cp "${FILESDIR}"/Makefile \
		"${FILESDIR}"/oledsaver.c \
		"${FILESDIR}"/oledsaver.conf.default \
		"${FILESDIR}"/oledsaver-cursor.cpp \
		"${FILESDIR}"/oledsaver-cursor.xml \
		"${FILESDIR}"/oledsaver-idle.cpp \
		"${FILESDIR}"/oledsaver-idle.xml \
		"${FILESDIR}"/wlr-layer-shell-unstable-v1.xml \
		"${S}"/ || die
}

src_compile() {
	emake \
		CC="$(tc-getCC)" \
		CXX="$(tc-getCXX)" \
		CFLAGS="${CPPFLAGS} ${CFLAGS} -std=c11" \
		CXXFLAGS="${CPPFLAGS} ${CXXFLAGS} -std=c++17" \
		LDFLAGS="${LDFLAGS}" \
		PREFIX="${EPREFIX}/usr" \
		WLR_LAYER_SHELL_XML="${S}/wlr-layer-shell-unstable-v1.xml"
}

src_install() {
	emake \
		CC="$(tc-getCC)" \
		CXX="$(tc-getCXX)" \
		CFLAGS="${CPPFLAGS} ${CFLAGS} -std=c11" \
		CXXFLAGS="${CPPFLAGS} ${CXXFLAGS} -std=c++17" \
		DESTDIR="${D}" \
		LDFLAGS="${LDFLAGS}" \
		PREFIX="${EPREFIX}/usr" \
		WLR_LAYER_SHELL_XML="${S}/wlr-layer-shell-unstable-v1.xml" \
		install

	insinto /etc
	newins oledsaver.conf.default oledsaver.conf
}

pkg_postinst() {
	elog "Configuration file installed to ${EROOT}/etc/oledsaver.conf"
	elog "Set OLEDSAVER_CONFIG to use a different config file."
	elog "Without OLEDSAVER_CONFIG, per-user configs are preferred over /etc/oledsaver.conf."
	elog "Manager mode uses the Wayland output registry for outputs and Wayfire IPC for focus."
	elog "Wayfire must load ipc, ipc-rules, oledsaver-idle, and oledsaver-cursor for cursor hiding on blanked outputs."
	elog "Renderer mode requires wlr-layer-shell and xdg-output. Manager idle events require ext-idle-notify-v1."
}