summaryrefslogtreecommitdiff
path: root/dev-build/guildmaster/guildmaster-0_pre20250712.ebuild
blob: 1fee1ce2c30d7b3bf7337425d047ea57dbbe6e10 (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
# Copyright 2025 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2

EAPI=8

inherit linux-info meson systemd udev

DESCRIPTION="FIFO-like jobserver node via CUSE"
HOMEPAGE="https://codeberg.org/amonakov/guildmaster"

if [[ ${PV} == 9999 ]] ; then
	EGIT_REPO_URI="https://codeberg.org/amonakov/guildmaster.git"
	inherit git-r3
else
	GUILDMASTER_COMMIT="463382ba5b47625a9355832cd792a164c54237f9"
	SRC_URI="https://codeberg.org/amonakov/guildmaster/archive/${GUILDMASTER_COMMIT}.tar.gz -> ${PN}-${GUILDMASTER_COMMIT}.cb.tar.gz"
	S="${WORKDIR}"/${PN}

	KEYWORDS="~amd64"
fi

LICENSE="ISC"
SLOT="0"

DEPEND="sys-fs/fuse:3="
RDEPEND="
	${DEPEND}
"

pkg_pretend() {
	local CONFIG_CHECK="~CUSE"
	check_extra_config
}

src_configure() {
	local emesonargs=(
		-Dopenrc=true
		-Dsystemd=true
		-Dsystemdunitdir="$(systemd_get_systemunitdir)"
		-Dudev=true
		-Dudevrulesdir="$(get_udevdir)"/rules.d
	)

	meson_src_configure
}

src_install() {
	meson_src_install

	insinto /etc/sandbox.d
	newins "${FILESDIR}"/sandbox.conf 90guildmaster
}

pkg_postinst() {
	udev_reload

	if ! grep -q -s -R -- '--jobserver-auth=fifo:/dev/guild' "${EROOT}"/etc/portage/make.conf ; then
		elog "In order to use a system-wide guildmaster instance, enable the service:"
		elog
		elog "  systemctl enable --now guildmaster"
		elog
		elog "Then add to your make.conf:"
		elog
		elog '  MAKEFLAGS="--jobserver-auth=fifo:/dev/guild"'
		elog '  NINJAOPTS=""'
		elog
		elog "You can use -l in NINJAOPTS but *do not* use -j, as it disables"
		elog "jobserver support."
	fi
}