3
0
Fork 0
forked from mirrors/nixpkgs
nixpkgs/pkgs/tools/wayland/wluma/default.nix

61 lines
1.5 KiB
Nix
Raw Normal View History

2021-12-14 15:06:13 +00:00
{ lib
2022-01-15 03:28:51 +00:00
, stdenv
2021-12-14 15:06:13 +00:00
, fetchFromGitHub
, makeWrapper
, rustPlatform
, vulkan-loader
2022-01-15 03:28:51 +00:00
, pkg-config
, udev
, v4l-utils
, llvmPackages
2021-12-14 15:06:13 +00:00
}:
rustPlatform.buildRustPackage rec {
pname = "wluma";
2022-01-22 00:39:14 +00:00
version = "4.1.0";
2021-12-14 15:06:13 +00:00
src = fetchFromGitHub {
owner = "maximbaz";
repo = "wluma";
rev = version;
2022-01-22 00:39:14 +00:00
sha256 = "sha256-kUYh4RmD4zRI3ZNZWl2oWcO0Ze5czLBXUgPMl/cLW/I=";
2021-12-14 15:06:13 +00:00
};
2022-01-15 03:28:51 +00:00
nativeBuildInputs = [
makeWrapper
pkg-config
];
buildInputs = [
udev
v4l-utils.lib
];
LIBCLANG_PATH="${llvmPackages.libclang.lib}/lib";
# Works around the issue with rust-bindgen and the Nix gcc wrapper:
# https://hoverbear.org/blog/rust-bindgen-in-nix/
preBuild = ''
export BINDGEN_EXTRA_CLANG_ARGS="$(< ${stdenv.cc}/nix-support/libc-cflags) \
$(< ${stdenv.cc}/nix-support/cc-cflags) \
-isystem ${llvmPackages.libclang.lib}/lib/clang/${lib.getVersion llvmPackages.clang}/include \
-idirafter ${stdenv.cc.cc}/lib/gcc/${stdenv.hostPlatform.config}/${lib.getVersion stdenv.cc.cc}/include \
-idirafter ${v4l-utils.dev}/include"
'';
2021-12-14 15:06:13 +00:00
postInstall = ''
wrapProgram $out/bin/wluma \
--prefix LD_LIBRARY_PATH : "${lib.makeLibraryPath [ vulkan-loader ]}"
'';
2022-01-22 00:39:14 +00:00
cargoSha256 = "sha256-oOIL18gij7DdvgNOuaHtuyFemNBUB85Ouh/sdhKas+s=";
2021-12-14 15:06:13 +00:00
meta = with lib; {
description = "Automatic brightness adjustment based on screen contents and ALS";
homepage = "https://github.com/maximbaz/wluma";
license = licenses.isc;
2022-01-22 00:39:14 +00:00
maintainers = with maintainers; [ yevhenshymotiuk jmc-figueira ];
2021-12-14 15:06:13 +00:00
platforms = platforms.linux;
};
}