summaryrefslogtreecommitdiff
path: root/gui-apps/oledsaver/oledsaver-1.0.5.ebuild
blob: 6d1d818af57cf336e815392717083db80ae67fec (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
# Copyright 2024 Gentoo Authors
# Distributed under the terms of the MIT License

EAPI=8

inherit toolchain-funcs

DESCRIPTION="OLED-friendly Matrix rain screensaver for Sway/Wayland"
HOMEPAGE=""
SRC_URI="${P}.tar.gz"
RESTRICT="fetch"

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

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

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

RDEPEND="
	${DEPEND}
	gui-apps/swayidle
	media-libs/fontconfig
"

src_compile() {
	emake \
		CC="$(tc-getCC)" \
		CFLAGS="${CFLAGS} -std=c11" \
		LDFLAGS="${LDFLAGS}" \
		PREFIX="${EPREFIX}/usr"
}

src_install() {
	emake \
		DESTDIR="${D}" \
		PREFIX="${EPREFIX}/usr" \
		install

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

pkg_preinst() {
	if [[ -f "${EROOT}/etc/oledsaver.conf" ]]; then
		rm "${ED}/etc/oledsaver.conf" || die
	fi
}

pkg_postinst() {
	elog "Configuration file installed to ${EROOT}/etc/oledsaver.conf"
	elog "Run 'oledsaver' in your Sway session to start the screensaver manager."
	elog "Requires SWAYSOCK to be set (automatic in Sway sessions)."
}