2022-12-17 10:02:37 +00:00
|
|
|
{ lib
|
|
|
|
, rustPlatform
|
|
|
|
, fetchFromGitLab
|
|
|
|
, e2fsprogs
|
|
|
|
, systemd
|
|
|
|
, coreutils
|
|
|
|
, pkg-config
|
|
|
|
, cmake
|
|
|
|
, fontconfig
|
|
|
|
, gtk3
|
|
|
|
, libappindicator
|
|
|
|
}:
|
|
|
|
|
|
|
|
rustPlatform.buildRustPackage rec {
|
|
|
|
pname = "asusctl";
|
2023-08-22 20:05:09 +00:00
|
|
|
version = "4.7.0";
|
2022-12-17 10:02:37 +00:00
|
|
|
|
|
|
|
src = fetchFromGitLab {
|
|
|
|
owner = "asus-linux";
|
|
|
|
repo = "asusctl";
|
|
|
|
rev = version;
|
2023-08-22 20:05:09 +00:00
|
|
|
hash = "sha256-SZijR9PotN0O72laj+FBSCVMXLXadmLRhCSD4XqobD0=";
|
2022-12-17 10:02:37 +00:00
|
|
|
};
|
|
|
|
|
2023-05-24 13:37:59 +00:00
|
|
|
cargoHash = "";
|
2023-03-27 19:17:25 +00:00
|
|
|
cargoLock = {
|
|
|
|
lockFile = ./Cargo.lock;
|
|
|
|
outputHashes = {
|
2023-05-24 13:37:59 +00:00
|
|
|
"ecolor-0.21.0" = "sha256-m7eHX6flwO21umtx3dnIuVUnNsEs3ZCyOk5Vvp/lVfI=";
|
2023-03-27 19:17:25 +00:00
|
|
|
"notify-rust-4.6.0" = "sha256-jhCgisA9f6AI9e9JQUYRtEt47gQnDv5WsdRKFoKvHJs=";
|
2023-08-22 20:05:09 +00:00
|
|
|
"supergfxctl-5.1.1" = "sha256-H00QHNILEjOtavXdj4Jd+rdLprJpVSlSVV3qkTeknzQ=";
|
2023-03-27 19:17:25 +00:00
|
|
|
};
|
|
|
|
};
|
2022-12-17 10:02:37 +00:00
|
|
|
|
|
|
|
postPatch = ''
|
|
|
|
files="
|
2023-08-22 20:05:09 +00:00
|
|
|
asusd-user/src/config.rs
|
|
|
|
asusd-user/src/daemon.rs
|
|
|
|
asusd/src/ctrl_anime/config.rs
|
2023-05-24 13:37:59 +00:00
|
|
|
rog-aura/src/aura_detection.rs
|
2023-08-22 20:05:09 +00:00
|
|
|
rog-control-center/src/main.rs
|
2022-12-17 10:02:37 +00:00
|
|
|
"
|
|
|
|
for file in $files; do
|
|
|
|
substituteInPlace $file --replace /usr/share $out/share
|
|
|
|
done
|
|
|
|
|
2023-08-22 20:05:09 +00:00
|
|
|
substituteInPlace asusd/src/ctrl_platform.rs --replace /usr/bin/chattr ${e2fsprogs}/bin/chattr
|
2022-12-17 10:02:37 +00:00
|
|
|
|
|
|
|
substituteInPlace data/asusd.rules --replace systemctl ${systemd}/bin/systemctl
|
|
|
|
substituteInPlace data/asusd.service \
|
|
|
|
--replace /usr/bin/asusd $out/bin/asusd \
|
|
|
|
--replace /bin/sleep ${coreutils}/bin/sleep
|
|
|
|
substituteInPlace data/asusd-user.service \
|
|
|
|
--replace /usr/bin/asusd-user $out/bin/asusd-user \
|
|
|
|
--replace /usr/bin/sleep ${coreutils}/bin/sleep
|
|
|
|
'';
|
|
|
|
|
2023-03-08 16:32:21 +00:00
|
|
|
nativeBuildInputs = [ pkg-config cmake rustPlatform.bindgenHook ];
|
2022-12-17 10:02:37 +00:00
|
|
|
|
|
|
|
buildInputs = [ systemd fontconfig gtk3 ];
|
|
|
|
|
|
|
|
# upstream has minimal tests, so don't rebuild twice
|
|
|
|
doCheck = false;
|
|
|
|
|
|
|
|
postInstall = ''
|
2023-05-24 13:37:59 +00:00
|
|
|
make prefix=$out install-data
|
2022-12-17 10:02:37 +00:00
|
|
|
'';
|
|
|
|
|
|
|
|
postFixup = ''
|
|
|
|
patchelf --add-rpath "${libappindicator}/lib" "$out/bin/rog-control-center"
|
|
|
|
'';
|
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
description = "A control daemon, CLI tools, and a collection of crates for interacting with ASUS ROG laptops";
|
|
|
|
homepage = "https://gitlab.com/asus-linux/asusctl";
|
|
|
|
license = licenses.mpl20;
|
|
|
|
platforms = [ "x86_64-linux" ];
|
|
|
|
maintainers = with maintainers; [ k900 aacebedo ];
|
|
|
|
};
|
|
|
|
}
|