Install this version:
emerge -a =app-admin/loki-3.7.9
If this version is masked, you can unmask it using the autounmask tool or standard emerge options:
autounmask =app-admin/loki-3.7.9
Or alternatively:
emerge --autounmask-write -a =app-admin/loki-3.7.9
| Version | EAPI | Keywords | Slot |
|---|---|---|---|
| 3.7.9 | 8 | ~amd64 | 0 |
# Copyright 1999-2026 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=8
inherit go-module systemd tmpfiles
DESCRIPTION="Like Prometheus, but for logs"
HOMEPAGE="https://grafana.com/loki"
SRC_URI="https://github.com/grafana/loki/archive/v${PV}.tar.gz -> ${P}.tar.gz"
LICENSE="AGPL-3 Apache-2.0"
SLOT="0"
KEYWORDS="~amd64"
IUSE="+server tools systemd"
REQUIRED_USE="|| ( server tools )"
RESTRICT="mirror strip"
RDEPEND="acct-group/grafana
acct-user/${PN}"
DEPEND="${RDEPEND}"
BDEPEND=">=dev-lang/go-1.26.10"
src_prepare() {
default
# Keep the index and the chunks across reboots, in the directory that the
# tmpfiles entry creates for them.
sed -i -e 's|/tmp/loki|/var/lib/loki|g' cmd/${PN}/${PN}-local-config.yaml || die
}
src_configure() {
VPREFIX="github.com/grafana/${PN}/v3/pkg/util/build"
export EGO_LDFLAGS="-s -w -X ${VPREFIX}.Branch=main -X ${VPREFIX}.Version=${PV} -X ${VPREFIX}.Revision=${PR} -X ${VPREFIX}.BuildUser=${PN} -X ${VPREFIX}.BuildDate=$(date -u -d "@${SOURCE_DATE_EPOCH:-$(date +%s)}" +'%Y-%m-%dT%H:%M:%SZ')"
default
}
src_compile() {
if use server; then
einfo "Building cmd/${PN}/${PN}..."
ego build -trimpath -ldflags "${EGO_LDFLAGS}" -tags cgo,linux,netgo -mod vendor -o cmd/${PN}/${PN} ./cmd/${PN} || die
fi
if use tools; then
einfo "Building cmd/logcli/logcli..."
ego build -trimpath -ldflags "${EGO_LDFLAGS}" -tags netgo -mod vendor -o cmd/logcli/logcli ./cmd/logcli || die
einfo "Building cmd/${PN}tool/${PN}tool..."
ego build -trimpath -ldflags "${EGO_LDFLAGS}" -tags netgo -mod vendor \
-o cmd/${PN}tool/${PN}tool ./cmd/${PN}tool || die
einfo "Building cmd/${PN}-canary/${PN}-canary..."
ego build -trimpath -ldflags "${EGO_LDFLAGS}" -tags netgo -mod vendor \
-o cmd/${PN}-canary/${PN}-canary ./cmd/${PN}-canary || die
fi
}
src_install() {
if use server; then
dobin "${S}/cmd/${PN}/${PN}"
newconfd "${FILESDIR}/${PN}.confd" "${PN}"
newinitd "${FILESDIR}/${PN}.initd" "${PN}"
use systemd && systemd_newunit "${FILESDIR}"/${PN}.service ${PN}.service
insinto "/etc/${PN}"
doins "${S}/cmd/${PN}/${PN}-local-config.yaml"
dotmpfiles "${FILESDIR}/${PN}.tmpfiles.conf"
fi
if use tools; then
dobin "${S}/cmd/${PN}tool/${PN}tool"
dobin "${S}/cmd/logcli/logcli"
dobin "${S}/cmd/${PN}-canary/${PN}-canary"
fi
}
pkg_postinst() {
if use server; then
tmpfiles_process loki.tmpfiles.conf
fi
local v
for v in ${REPLACING_VERSIONS}; do
if ver_test "${v}" -lt 3.7; then
ewarn "Upstream removed Promtail in Loki 3.7, so this package no longer installs"
ewarn "it. ${CATEGORY}/${PN}-3.6.7 is the last version that does."
break
fi
done
}
Manage flags for this package:
euse -i <flag> -p app-admin/loki |
euse -E <flag> -p app-admin/loki |
euse -D <flag> -p app-admin/loki
acct-group/grafana acct-user/loki
acct-group/grafana acct-user/loki
>=dev-lang/go-1.26.10
| Type | File | Size | Source URLs |
|---|---|---|---|
| DIST | loki-3.7.9.tar.gz | 109483901 bytes | https://github.com/grafana/loki/archive/v3.7.9.tar.gz |