# Contributor: Jakub Jirutka # Maintainer: Jakub Jirutka pkgname=wluma pkgver=4.2.0 pkgrel=0 pkgdesc="Automatic brightness adjustment based on screen contents and ALS" url="https://github.com/maximbaz/wluma" # riscv64, s390x: blocked by rust/cargo # arm*, x86: fails to build due to crappy v4l crate arch="aarch64 ppc64le x86_64" license="ISC" makedepends=" cargo cargo-auditable clang15-dev eudev-dev v4l-utils-dev vulkan-loader-dev wayland-dev " install="$pkgname.post-install" subpackages="$pkgname-wlroots" source="https://github.com/maximbaz/wluma/archive/$pkgver/wluma-$pkgver.tar.gz cargo.patch link-vulkan-at-runtime.patch default-config.patch " prepare() { default_prepare # Optimize binary for size. cat >> Cargo.toml <<-EOF [profile.release] codegen-units = 1 lto = true opt-level = "s" panic = "abort" EOF mv config.toml config.toml.example # Create a default empty config that will be embedded in the executable. echo '[als.none]' > config.toml cargo fetch --target="$CTARGET" --locked } build() { cargo auditable build --frozen --release } check() { cargo test --frozen } package() { install -D -m755 target/release/wluma -t "$pkgdir"/usr/bin/ install -D -m644 90-wluma-backlight.rules -t "$pkgdir"/lib/udev/rules.d/ install -D -m644 config.toml.example "$pkgdir"/etc/xdg/wluma/config.toml } wlroots() { pkgdesc="$pkgdesc (wlroots capturer)" depends="$pkgname=$pkgver-r$pkgrel vulkan-loader wlroots" install_if="$pkgname=$pkgver-r$pkgrel wlroots" mkdir -p "$subpkgdir" } sha512sums=" 001a64a69fe7cbac14d7ffc02138793ee34d9778112c096e7b06175dc62a793cc6e6fac203635dda6e690241a7e1d09df94f7c07160c1652d38fda7a7b497c15 wluma-4.2.0.tar.gz b334c41c944c6a8460f1103c3acc8bb4c541bb68ea0d241bd379819a9fe29bafd03e1edf2f9152d0d025f7d735ca86a4f1d8f4378169077e60464659518dc64b cargo.patch 9e6d773e41fa40b9f565d98929a7c561e37e641fcb1ffdfd4295cdf94e324be467e82016d002b86132b0c4293e265703ee0f05d1f061929c17bf08e34f4bedfc link-vulkan-at-runtime.patch d6d864b048b711699d612aa3d658ada8c1e7094271885dccddec0064bebe4380bb014a74ef0cd3f9700d6964b20b268b2c6966000a6cb98c63110729a133f041 default-config.patch "