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

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

100 lines
2.4 KiB
Nix
Raw Normal View History

2022-09-16 17:23:46 +00:00
{ lib
, rustPlatform
, fetchFromGitLab
, systemd
, coreutils
2024-05-09 07:36:17 +00:00
, gnugrep
2022-09-16 17:23:46 +00:00
, pkg-config
, fontconfig
2023-12-12 18:47:42 +00:00
, libGL
2024-05-09 07:36:17 +00:00
, libinput
, libxkbcommon
, mesa
, seatd
, wayland
2022-09-16 17:23:46 +00:00
}:
rustPlatform.buildRustPackage rec {
pname = "asusctl";
version = "6.0.9";
2022-09-16 17:23:46 +00:00
src = fetchFromGitLab {
owner = "asus-linux";
repo = "asusctl";
rev = version;
hash = "sha256-mml+nj+Z6267QtejTkWiR3SdNAdZCNz4M8r6LzvhALw=";
2022-09-16 17:23:46 +00:00
};
cargoLock = {
lockFile = ./Cargo.lock;
outputHashes = {
"const-field-offset-0.1.5" = "sha256-0MaNu6cUXislY+wDFuxZptXeJRkOuXGRJwZWm6AvcZ8=";
2024-05-09 07:36:17 +00:00
"notify-rust-4.7.0" = "sha256-A7edUorty5GpGXCUQPszZuXtLdEmbmrDSU9JcoDaiaI=";
"supergfxctl-5.2.3" = "sha256-wKcHoMukdUXZrdbE1xsylq7ySJpxny3+0dGUQ40BVH8=";
};
};
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
2024-05-09 07:36:17 +00:00
rog-control-center/src/lib.rs
2023-08-11 06:27:08 +00:00
rog-control-center/src/main.rs
2024-05-09 07:36:17 +00:00
rog-control-center/src/tray.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
2024-05-09 07:36:17 +00:00
substituteInPlace Makefile \
--replace /usr/bin/grep ${lib.getExe gnugrep}
2022-09-16 17:23:46 +00:00
'';
2024-05-09 07:36:17 +00:00
nativeBuildInputs = [ pkg-config ];
buildInputs = [
fontconfig
libGL
libinput
libxkbcommon
mesa
seatd
systemd
wayland
];
2022-09-16 17:23:46 +00:00
2024-05-09 07:36:17 +00:00
# force linking to all the dlopen()ed dependencies
RUSTFLAGS = map (a: "-C link-arg=${a}") [
"-Wl,--push-state,--no-as-needed"
"-lEGL"
"-lfontconfig"
"-lwayland-client"
"-Wl,--pop-state"
];
2022-09-16 17:23:46 +00:00
# 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
'';
meta = with lib; {
description = "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 ];
};
}