nixpkgs/pkgs/applications/system/asusctl/default.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

78 lines
2.0 KiB
Nix
Raw Normal View History

2022-09-16 17:23:46 +00:00
{ lib
, rustPlatform
, fetchFromGitLab
, systemd
, coreutils
, pkg-config
, cmake
, fontconfig
, gtk3
, libappindicator
2023-12-12 18:47:42 +00:00
, libGL
2022-09-16 17:23:46 +00:00
}:
rustPlatform.buildRustPackage rec {
pname = "asusctl";
2024-04-09 09:38:19 +00:00
version = "5.0.10";
2022-09-16 17:23:46 +00:00
src = fetchFromGitLab {
owner = "asus-linux";
repo = "asusctl";
rev = version;
2024-04-09 09:38:19 +00:00
hash = "sha256-H8x3nfOFRv9DkbDkFw+LO1tdHiVyU3SzetqED4twPSk=";
2022-09-16 17:23:46 +00:00
};
cargoLock = {
lockFile = ./Cargo.lock;
outputHashes = {
2023-04-29 17:00:55 +00:00
"ecolor-0.21.0" = "sha256-m7eHX6flwO21umtx3dnIuVUnNsEs3ZCyOk5Vvp/lVfI=";
"notify-rust-4.6.0" = "sha256-jhCgisA9f6AI9e9JQUYRtEt47gQnDv5WsdRKFoKvHJs=";
2024-04-09 09:38:19 +00:00
"supergfxctl-5.1.2" = "sha256-WDbUgvWExk5cs2cpjo88CiROdEbc01o2DELhRi9gju4=";
};
};
2022-09-16 17:23:46 +00:00
postPatch = ''
files="
2023-08-11 06:27:08 +00:00
asusd-user/src/config.rs
asusd-user/src/daemon.rs
asusd/src/ctrl_anime/config.rs
2023-04-29 17:00:55 +00:00
rog-aura/src/aura_detection.rs
2023-08-11 06:27:08 +00:00
rog-control-center/src/main.rs
2022-09-16 17:23:46 +00:00
"
for file in $files; do
substituteInPlace $file --replace /usr/share $out/share
done
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 14:52:10 +00:00
nativeBuildInputs = [ pkg-config cmake rustPlatform.bindgenHook ];
2022-09-16 17:23:46 +00:00
buildInputs = [ systemd fontconfig gtk3 ];
# upstream has minimal tests, so don't rebuild twice
doCheck = false;
postInstall = ''
2023-04-29 17:00:55 +00:00
make prefix=$out install-data
2022-09-16 17:23:46 +00:00
'';
postFixup = ''
2023-12-12 18:47:42 +00:00
patchelf --add-rpath "${libappindicator}/lib:${libGL}/lib" "$out/bin/rog-control-center"
2022-09-16 17:23:46 +00:00
'';
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 ];
};
}