mirror of
https://gitlab.com/asus-linux/asusctl.git
synced 2026-01-23 01:43:19 +01:00
Compare commits
6 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
a08ca3af98 | ||
|
|
efa379e778 | ||
|
|
5cbf0816fe | ||
|
|
2951d3926c | ||
|
|
eb19d59d52 | ||
|
|
3e4d594b05 |
53
.cargo-husky/hooks/post-commit
Executable file
53
.cargo-husky/hooks/post-commit
Executable file
@@ -0,0 +1,53 @@
|
||||
#!/bin/sh
|
||||
set -e
|
||||
|
||||
ROOT_DIR=$(git rev-parse --show-toplevel)
|
||||
AURA_DATA="${ROOT_DIR}/rog-aura/data/aura_support.ron"
|
||||
SPEC_FILE="${ROOT_DIR}/distro-packaging/fedora/asusctl.spec"
|
||||
TRANSLATION="${ROOT_DIR}/rog-control-center/translations/en/rog-control-center.po"
|
||||
VERSION=$(grep -Pm1 'version = "(\d+.\d+.\d+.*)"' "${ROOT_DIR}/Cargo.toml" | cut -d'"' -f2)
|
||||
|
||||
if [ -z "$VERSION" ]; then
|
||||
echo "Error: Could not extract version from Cargo.toml"
|
||||
exit 1
|
||||
fi
|
||||
if [ ! -f "$SPEC_FILE" ]; then
|
||||
echo "Error: Spec file not found at ${SPEC_FILE}"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Update spec file
|
||||
sed -i "s/^%define version.*/%define version ${VERSION}/" "$SPEC_FILE"
|
||||
if git diff --quiet "$SPEC_FILE"; then
|
||||
echo "No changes to spec file"
|
||||
else
|
||||
git add "$SPEC_FILE"
|
||||
git commit --no-verify -m "chore: update spec file version to ${VERSION}"
|
||||
echo "Updated spec file version to ${VERSION}"
|
||||
fi
|
||||
|
||||
# Update translations only if UI files changed
|
||||
if git diff-tree -r HEAD@{1} HEAD --name-only | grep -q "^rog-control-center/ui/"; then
|
||||
echo 'find -name \*.slint | xargs slint-tr-extractor -o ${TRANSLATION}'
|
||||
find -name \*.slint | xargs slint-tr-extractor -o $TRANSLATION
|
||||
if git diff --quiet "$TRANSLATION"; then
|
||||
echo "No changes to translation file"
|
||||
else
|
||||
git add "$TRANSLATION"
|
||||
git commit --no-verify -m "chore: update translations"
|
||||
echo "Updated ${TRANSLATION}"
|
||||
fi
|
||||
else
|
||||
echo "No changes in rog-control-center/ui/, skipping translation update"
|
||||
fi
|
||||
|
||||
# Update aura data
|
||||
cargo test --package rog_aura --lib -- aura_detection::tests::check_data_file_parse --exact
|
||||
cargo test --package rog_aura --lib -- aura_detection::tests::find_data_file_groups --exact
|
||||
if git diff --quiet "$AURA_DATA"; then
|
||||
echo "No changes to aura data file"
|
||||
else
|
||||
git add "$AURA_DATA"
|
||||
git commit --no-verify -m "chore: update aura data"
|
||||
echo "Updated $AURA_DATA"
|
||||
fi
|
||||
@@ -1,18 +1,6 @@
|
||||
#!/bin/sh
|
||||
|
||||
set -e
|
||||
|
||||
echo 'find -name \*.slint | xargs slint-tr-extractor -o rog-control-center/translations/en/rog-control-center.po'
|
||||
find -name \*.slint | xargs slint-tr-extractor -o rog-control-center/translations/en/rog-control-center.po
|
||||
|
||||
echo '+cargo +nightly fmt --all -- --check'
|
||||
cargo +nightly fmt --all -- --check
|
||||
|
||||
echo '+cargo clippy --all -- -D warnings'
|
||||
cargo clippy --all -- -D warnings
|
||||
|
||||
echo '+cargo test --all'
|
||||
cargo test --all -- --test-threads=1
|
||||
|
||||
echo '+cargo cranky'
|
||||
cargo cranky
|
||||
git add -u
|
||||
|
||||
@@ -2,6 +2,11 @@
|
||||
|
||||
## [Unreleased]
|
||||
|
||||
## [v6.1.8]
|
||||
|
||||
### Changed
|
||||
- Testing CI for opensuse RPM build
|
||||
|
||||
## [v6.1.7]
|
||||
|
||||
### Changed
|
||||
|
||||
28
Cargo.lock
generated
28
Cargo.lock
generated
@@ -250,7 +250,7 @@ checksum = "175571dd1d178ced59193a6fc02dde1b972eb0bc56c892cde9beeceac5bf0f6b"
|
||||
|
||||
[[package]]
|
||||
name = "asusctl"
|
||||
version = "6.1.7"
|
||||
version = "6.1.8"
|
||||
dependencies = [
|
||||
"dmi_id",
|
||||
"env_logger",
|
||||
@@ -269,7 +269,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "asusd"
|
||||
version = "6.1.7"
|
||||
version = "6.1.8"
|
||||
dependencies = [
|
||||
"cargo-husky",
|
||||
"concat-idents",
|
||||
@@ -296,7 +296,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "asusd-user"
|
||||
version = "6.1.7"
|
||||
version = "6.1.8"
|
||||
dependencies = [
|
||||
"config-traits",
|
||||
"dirs",
|
||||
@@ -1084,7 +1084,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "config-traits"
|
||||
version = "6.1.7"
|
||||
version = "6.1.8"
|
||||
dependencies = [
|
||||
"log",
|
||||
"ron",
|
||||
@@ -1476,7 +1476,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "dmi_id"
|
||||
version = "6.1.7"
|
||||
version = "6.1.8"
|
||||
dependencies = [
|
||||
"log",
|
||||
"udev 0.8.0",
|
||||
@@ -4743,7 +4743,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "rog-control-center"
|
||||
version = "6.1.7"
|
||||
version = "6.1.8"
|
||||
dependencies = [
|
||||
"asusd",
|
||||
"concat-idents",
|
||||
@@ -4774,7 +4774,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "rog_anime"
|
||||
version = "6.1.7"
|
||||
version = "6.1.8"
|
||||
dependencies = [
|
||||
"dmi_id",
|
||||
"gif 0.12.0",
|
||||
@@ -4788,7 +4788,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "rog_aura"
|
||||
version = "6.1.7"
|
||||
version = "6.1.8"
|
||||
dependencies = [
|
||||
"dmi_id",
|
||||
"log",
|
||||
@@ -4799,7 +4799,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "rog_dbus"
|
||||
version = "6.1.7"
|
||||
version = "6.1.8"
|
||||
dependencies = [
|
||||
"asusd",
|
||||
"rog_anime",
|
||||
@@ -4813,7 +4813,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "rog_platform"
|
||||
version = "6.1.7"
|
||||
version = "6.1.8"
|
||||
dependencies = [
|
||||
"concat-idents",
|
||||
"inotify",
|
||||
@@ -4826,7 +4826,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "rog_profiles"
|
||||
version = "6.1.7"
|
||||
version = "6.1.8"
|
||||
dependencies = [
|
||||
"log",
|
||||
"rog_platform",
|
||||
@@ -4837,7 +4837,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "rog_scsi"
|
||||
version = "6.1.7"
|
||||
version = "6.1.8"
|
||||
dependencies = [
|
||||
"ron",
|
||||
"serde",
|
||||
@@ -4847,7 +4847,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "rog_simulators"
|
||||
version = "6.1.7"
|
||||
version = "6.1.8"
|
||||
dependencies = [
|
||||
"log",
|
||||
"rog_anime",
|
||||
@@ -4857,7 +4857,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "rog_slash"
|
||||
version = "6.1.7"
|
||||
version = "6.1.8"
|
||||
dependencies = [
|
||||
"dmi_id",
|
||||
"serde",
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
[workspace.package]
|
||||
version = "6.1.7"
|
||||
version = "6.1.8"
|
||||
rust-version = "1.82"
|
||||
license = "MPL-2.0"
|
||||
readme = "README.md"
|
||||
|
||||
@@ -74,22 +74,36 @@ fn main() {
|
||||
println!("\nError: {e}\n");
|
||||
print_info();
|
||||
}) {
|
||||
let asusd_version = platform_proxy
|
||||
.version()
|
||||
.map_err(|e| {
|
||||
let asusd_version = match platform_proxy.version() {
|
||||
Ok(version) => version,
|
||||
Err(e) => {
|
||||
error!(
|
||||
"Could not get asusd version: {e:?}\nIs asusd.service running? {}",
|
||||
check_service("asusd")
|
||||
);
|
||||
})
|
||||
.unwrap();
|
||||
return;
|
||||
}
|
||||
};
|
||||
|
||||
if asusd_version != self_version {
|
||||
println!("Version mismatch: asusctl = {self_version}, asusd = {asusd_version}");
|
||||
return;
|
||||
}
|
||||
|
||||
let supported_properties = platform_proxy.supported_properties().unwrap();
|
||||
let supported_interfaces = list_iface_blocking().unwrap();
|
||||
let supported_properties = match platform_proxy.supported_properties() {
|
||||
Ok(props) => props,
|
||||
Err(e) => {
|
||||
error!("Could not get supported properties: {e:?}");
|
||||
return;
|
||||
}
|
||||
};
|
||||
let supported_interfaces = match list_iface_blocking() {
|
||||
Ok(ifaces) => ifaces,
|
||||
Err(e) => {
|
||||
error!("Could not get supported interfaces: {e:?}");
|
||||
return;
|
||||
}
|
||||
};
|
||||
|
||||
if parsed.version {
|
||||
println!("asusctl v{}", env!("CARGO_PKG_VERSION"));
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
#
|
||||
# spec file for package asus-nb-ctrl
|
||||
#
|
||||
# Copyright (c) 2020-2021 Luke Jones <luke@ljones.dev>
|
||||
# Copyright (c) 2020-2025 Luke Jones <luke@ljones.dev>
|
||||
#
|
||||
# All modifications and additions to the file contributed by third parties
|
||||
# remain the property of their copyright owners, unless otherwise agreed
|
||||
@@ -20,42 +20,43 @@
|
||||
%global debug_package %{nil}
|
||||
%endif
|
||||
|
||||
%define version 6.1.8
|
||||
%define specrelease %{?dist}
|
||||
%define pkg_release 3%{specrelease}
|
||||
%define pkg_release 8%{specrelease}
|
||||
|
||||
# Use hardening ldflags.
|
||||
%global rustflags -Clink-arg=-Wl,-z,relro,-z,now
|
||||
Name: asusctl
|
||||
Version: 6.0.7
|
||||
Name: asusctl
|
||||
Version: %{version}
|
||||
Release: %{pkg_release}
|
||||
Summary: Control fan speeds, LEDs, graphics modes, and charge levels for ASUS notebooks
|
||||
License: MPLv2
|
||||
Summary: Control fan speeds, LEDs, graphics modes, and charge levels for ASUS notebooks
|
||||
License: MPLv2
|
||||
|
||||
Group: System Environment/Kernel
|
||||
Group: System Environment/Kernel
|
||||
|
||||
URL: https://gitlab.com/asus-linux/asusctl
|
||||
Source: %{name}-%{version}.tar.gz
|
||||
Source1: vendor_%{name}_%{version}.tar.xz
|
||||
Source2: cargo-config
|
||||
URL: https://gitlab.com/asus-linux/asusctl
|
||||
Source: https://gitlab.com/asus-linux/asusctl/-/archive/%{version}/%{name}-%{version}.tar.gz
|
||||
|
||||
BuildRequires: cargo
|
||||
%if %{defined fedora}
|
||||
BuildRequires: rust-packaging
|
||||
BuildRequires: systemd-rpm-macros
|
||||
%else
|
||||
BuildRequires: cargo-packaging
|
||||
%endif
|
||||
BuildRequires: git
|
||||
BuildRequires: clang-devel
|
||||
BuildRequires: cargo
|
||||
BuildRequires: cmake
|
||||
BuildRequires: rust
|
||||
BuildRequires: rust-std-static
|
||||
BuildRequires: pkgconfig(expat)
|
||||
BuildRequires: pkgconfig(dbus-1)
|
||||
BuildRequires: pkgconfig(gbm)
|
||||
BuildRequires: pkgconfig(libinput)
|
||||
BuildRequires: pkgconfig(libseat)
|
||||
BuildRequires: pkgconfig(libudev)
|
||||
BuildRequires: pkgconfig(xkbcommon)
|
||||
BuildRequires: pkgconfig(libzstd)
|
||||
BuildRequires: pkgconfig(gtk+-3.0)
|
||||
BuildRequires: pkgconfig(gdk-3.0)
|
||||
BuildRequires: desktop-file-utils
|
||||
|
||||
# expat-devel pcre2-devel
|
||||
|
||||
%description
|
||||
asus-nb-ctrl is a utility for Linux to control many aspects of various
|
||||
ASUS laptops but can also be used with non-Asus laptops with reduced features.
|
||||
@@ -72,21 +73,28 @@ A one-stop-shop GUI tool for asusd/asusctl. It aims to provide most controls,
|
||||
a notification service, and ability to run in the background.
|
||||
|
||||
%prep
|
||||
# %setup -D -T -a 1 -c -n %{name}-%{version}/vendor
|
||||
# %setup -D -T -a 0 -c
|
||||
%autosetup
|
||||
%setup -D -T -a 1
|
||||
|
||||
mv Cargo.lock{,.bak}
|
||||
%if %{defined fedora}
|
||||
%cargo_prep
|
||||
mv Cargo.lock{.bak,}
|
||||
sed -i 's|replace-with = "local-registry"|replace-with = "vendored-sources"|' .cargo/config
|
||||
cat %{SOURCE2} >> .cargo/config
|
||||
sed -i 's|offline = true|offline = false|' .cargo/config.toml
|
||||
sed -i 's|source.crates-io|source.ignore_this|' .cargo/config.toml
|
||||
%else
|
||||
mkdir -p .cargo
|
||||
cat > .cargo/config.toml << 'EOF'
|
||||
[term]
|
||||
verbose = true
|
||||
[net]
|
||||
offline = false
|
||||
EOF
|
||||
%endif
|
||||
|
||||
%build
|
||||
export RUSTFLAGS="%{rustflags}"
|
||||
%if %{defined fedora}
|
||||
%cargo_build
|
||||
#cargo build --release --frozen --offline --config .cargo/config.toml
|
||||
%else
|
||||
/usr/bin/cargo auditable build --release
|
||||
%endif
|
||||
|
||||
%install
|
||||
export RUSTFLAGS="%{rustflags}"
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: PACKAGE VERSION\n"
|
||||
"POT-Creation-Date: 2025-02-15 22:50+0000\n"
|
||||
"POT-Creation-Date: 2025-02-18 09:08+0000\n"
|
||||
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
|
||||
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
|
||||
"Language-Team: LANGUAGE <LL@li.org>\n"
|
||||
|
||||
Reference in New Issue
Block a user