70 lines
1.6 KiB
Bash
70 lines
1.6 KiB
Bash
# Copyright 2026 Gentoo Authors
|
|
# Distributed under the terms of the GNU General Public License v2
|
|
|
|
EAPI=8
|
|
|
|
inherit go-module systemd tmpfiles udev
|
|
|
|
DESCRIPTION="Open source Linux interface for iCUE LINK Hub and Corsair AIOs"
|
|
HOMEPAGE="https://openlinkhub.dev"
|
|
SRC_URI="https://github.com/jurkovic-nikola/OpenLinkHub/archive/refs/tags/${PV}.tar.gz -> ${P}.tar.gz"
|
|
SRC_URI+=" https://git.customdesigns.ca/RHWSI/gentoo-overlay/raw/branch/master/distfiles/${P}-deps.tar.xz"
|
|
|
|
LICENSE="GPL-3"
|
|
LICENSE+=" BSD BSD-2 MIT"
|
|
SLOT="0"
|
|
KEYWORDS="~amd64"
|
|
|
|
DEPEND="media-video/pipewire"
|
|
RDEPEND="
|
|
acct-group/openlinkhub
|
|
acct-user/openlinkhub
|
|
media-video/pipewire
|
|
sys-apps/i2c-tools
|
|
sys-apps/systemd
|
|
"
|
|
|
|
BDEPEND=">=dev-lang/go-1.25"
|
|
|
|
S="${WORKDIR}/OpenLinkHub-${PV}"
|
|
|
|
PATCHES=( "${FILESDIR}/${P}-openrgb-k100air.patch" )
|
|
|
|
src_prepare() {
|
|
default
|
|
eapply "${PATCHES[@]}"
|
|
}
|
|
|
|
src_compile() {
|
|
export CGO_CFLAGS_ALLOW='-fno-strict-overflow'
|
|
ego build -o OpenLinkHub .
|
|
}
|
|
|
|
src_install() {
|
|
newbin OpenLinkHub openlinkhub
|
|
|
|
for dir in database static web api; do
|
|
insinto /var/lib/openlinkhub/${dir}
|
|
doins -r ${dir}/*
|
|
done
|
|
|
|
udev_newrules 99-${PN}.rules 99-${PN}.rules
|
|
systemd_dounit "${FILESDIR}/${PN}.service"
|
|
newinitd "${FILESDIR}/${PN}.initd" ${PN}
|
|
newconfd "${FILESDIR}/${PN}.confd" ${PN}
|
|
newtmpfiles "${FILESDIR}/${PN}.tmpfiles" ${PN}.conf
|
|
|
|
keepdir /var/lib/${PN}
|
|
fowners -R openlinkhub:openlinkhub /var/lib/${PN}
|
|
}
|
|
|
|
pkg_postinst() {
|
|
tmpfiles_process ${PN}.conf
|
|
udev_reload
|
|
|
|
# Ensure runtime data dirs are writable after upgrades from older ebuilds.
|
|
if [[ -d ${ROOT}/var/lib/${PN} ]]; then
|
|
chown -R openlinkhub:openlinkhub "${ROOT}/var/lib/${PN}"
|
|
fi
|
|
}
|