mirror of
https://github.com/gentoo-mirror/guru.git
synced 2026-07-22 21:43:03 -04:00
sys-power/system76-power: sync live changes to version 1.2.4
No revbump because version 1.2.4 hasn't been merged to master yet. Signed-off-by: Lucio Sauer <watermanpaint@posteo.net>
This commit is contained in:
@@ -1,5 +1,6 @@
|
|||||||
# Copyright 2022-2024 Gentoo Authors
|
# Copyright 2022-2025 Gentoo Authors
|
||||||
# Distributed under the terms of the GNU General Public License v2
|
# Distributed under the terms of the GNU General Public License v2
|
||||||
|
|
||||||
EAPI=8
|
EAPI=8
|
||||||
|
|
||||||
CRATES="
|
CRATES="
|
||||||
@@ -145,7 +146,6 @@ CRATES="
|
|||||||
strsim@0.11.1
|
strsim@0.11.1
|
||||||
syn@1.0.109
|
syn@1.0.109
|
||||||
syn@2.0.100
|
syn@2.0.100
|
||||||
sysfs-class@0.1.3
|
|
||||||
tempfile@3.13.0
|
tempfile@3.13.0
|
||||||
thiserror-impl@1.0.65
|
thiserror-impl@1.0.65
|
||||||
thiserror@1.0.65
|
thiserror@1.0.65
|
||||||
@@ -199,15 +199,27 @@ CRATES="
|
|||||||
zvariant_utils@1.0.1
|
zvariant_utils@1.0.1
|
||||||
"
|
"
|
||||||
|
|
||||||
|
declare -A GIT_CRATES=(
|
||||||
|
[sysfs-class]='https://github.com/pop-os/sysfs-class;ab63e7f638aadfaf896a02e53cf330343d331337;sysfs-class-%commit%'
|
||||||
|
)
|
||||||
|
|
||||||
inherit cargo
|
inherit cargo
|
||||||
|
|
||||||
DESCRIPTION="System76 Power Management Tool"
|
DESCRIPTION="System76 Power Management Tool"
|
||||||
HOMEPAGE="https://github.com/pop-os/system76-power"
|
HOMEPAGE="https://github.com/pop-os/system76-power"
|
||||||
|
|
||||||
SRC_URI="
|
if [[ ${PV} == *9999* ]]; then
|
||||||
https://github.com/pop-os/system76-power/archive/refs/tags/${PV}.tar.gz -> ${P}.tar.gz
|
inherit git-r3
|
||||||
${CARGO_CRATE_URIS}
|
|
||||||
"
|
EGIT_REPO_URI="https://github.com/pop-os/system76-power"
|
||||||
|
else
|
||||||
|
SRC_URI="
|
||||||
|
https://github.com/pop-os/system76-power/archive/refs/tags/${PV}.tar.gz
|
||||||
|
-> ${P}.tar.gz
|
||||||
|
${CARGO_CRATE_URIS}
|
||||||
|
"
|
||||||
|
KEYWORDS="~amd64"
|
||||||
|
fi
|
||||||
|
|
||||||
LICENSE="GPL-3"
|
LICENSE="GPL-3"
|
||||||
# Dependent crate licenses
|
# Dependent crate licenses
|
||||||
@@ -216,24 +228,42 @@ LICENSE+="
|
|||||||
|| ( Apache-2.0 Boost-1.0 )
|
|| ( Apache-2.0 Boost-1.0 )
|
||||||
"
|
"
|
||||||
SLOT="0"
|
SLOT="0"
|
||||||
KEYWORDS="~amd64"
|
|
||||||
|
|
||||||
DEPEND="
|
DEPEND="virtual/libusb:1"
|
||||||
dev-libs/libusb:1
|
|
||||||
"
|
|
||||||
RDEPEND="
|
RDEPEND="
|
||||||
${DEPEND}
|
${DEPEND}
|
||||||
|
sys-apps/dbus
|
||||||
|
sys-auth/polkit
|
||||||
"
|
"
|
||||||
|
BDEPEND="virtual/pkgconfig"
|
||||||
|
|
||||||
src_prepare() {
|
src_unpack(){
|
||||||
default
|
if [[ ${PV} == *9999* ]]; then
|
||||||
# Replace dynamic git dependency of 'sysfs-class' with a static one
|
git-r3_src_unpack
|
||||||
sed -i 's|sysfs-class = { git = "https://github.com/pop-os/sysfs-class" }|sysfs-class = "0.1.3"|' Cargo.toml
|
cargo_live_src_unpack
|
||||||
cargo_gen_config
|
else
|
||||||
|
cargo_src_unpack
|
||||||
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
src_install() {
|
src_prepare() {
|
||||||
|
# Install the Rust binary using the cargo eclass as the Makefile hardcodes the release path
|
||||||
|
sed -i '/\s*install -D -m 0755/d' Makefile || die
|
||||||
default
|
default
|
||||||
|
}
|
||||||
|
|
||||||
|
src_configure() {
|
||||||
|
if [[ ${PV} == *9999* ]]; then
|
||||||
|
# prevent network access during src_install due to git crate sysfs-class
|
||||||
|
cargo_src_configure --frozen
|
||||||
|
else
|
||||||
|
cargo_src_configure
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
src_install(){
|
||||||
|
cargo_src_install
|
||||||
|
emake DESTDIR="${D}" prefix="${EPREFIX}/usr" install
|
||||||
elog "Enable the service: 'systemctl enable --now com.system76.PowerDaemon.service'"
|
elog "Enable the service: 'systemctl enable --now com.system76.PowerDaemon.service'"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user