From 4463c8f0b6759085d53c4e8f677f3827517b921f Mon Sep 17 00:00:00 2001 From: Jakub Jirutka Date: Fri, 11 Feb 2022 00:27:47 +0100 Subject: community/wluma: move from testing --- community/wluma/APKBUILD | 88 ++++++++++++++++++++++ community/wluma/cargo.patch | 62 +++++++++++++++ community/wluma/default-config.patch | 56 ++++++++++++++ .../libv4l-rs-01-fix-string-pointer-cast.patch | 23 ++++++ .../libv4l-rs-02-fix-wrong-_IOC_TYPE-on-musl.patch | 26 +++++++ community/wluma/link-vulkan-at-runtime.patch | 17 +++++ community/wluma/sys-level-config.patch | 37 +++++++++ community/wluma/wluma.post-install | 10 +++ testing/wluma/APKBUILD | 88 ---------------------- testing/wluma/cargo.patch | 62 --------------- testing/wluma/default-config.patch | 56 -------------- .../libv4l-rs-01-fix-string-pointer-cast.patch | 23 ------ .../libv4l-rs-02-fix-wrong-_IOC_TYPE-on-musl.patch | 26 ------- testing/wluma/link-vulkan-at-runtime.patch | 17 ----- testing/wluma/sys-level-config.patch | 37 --------- testing/wluma/wluma.post-install | 10 --- 16 files changed, 319 insertions(+), 319 deletions(-) create mode 100644 community/wluma/APKBUILD create mode 100644 community/wluma/cargo.patch create mode 100644 community/wluma/default-config.patch create mode 100644 community/wluma/libv4l-rs-01-fix-string-pointer-cast.patch create mode 100644 community/wluma/libv4l-rs-02-fix-wrong-_IOC_TYPE-on-musl.patch create mode 100644 community/wluma/link-vulkan-at-runtime.patch create mode 100644 community/wluma/sys-level-config.patch create mode 100644 community/wluma/wluma.post-install delete mode 100644 testing/wluma/APKBUILD delete mode 100644 testing/wluma/cargo.patch delete mode 100644 testing/wluma/default-config.patch delete mode 100644 testing/wluma/libv4l-rs-01-fix-string-pointer-cast.patch delete mode 100644 testing/wluma/libv4l-rs-02-fix-wrong-_IOC_TYPE-on-musl.patch delete mode 100644 testing/wluma/link-vulkan-at-runtime.patch delete mode 100644 testing/wluma/sys-level-config.patch delete mode 100644 testing/wluma/wluma.post-install diff --git a/community/wluma/APKBUILD b/community/wluma/APKBUILD new file mode 100644 index 00000000000..1352a7be239 --- /dev/null +++ b/community/wluma/APKBUILD @@ -0,0 +1,88 @@ +# Contributor: Jakub Jirutka +# Maintainer: Jakub Jirutka +pkgname=wluma +pkgver=4.1.2 +pkgrel=2 +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 + clang + eudev-dev + v4l-utils-dev + wayland-dev + vulkan-loader-dev + " +install="$pkgname.post-install" +subpackages="$pkgname-wlroots" +_libv4l_gitrev=d7ac716f6065a0e1aa47ef673387603d6eacc4f0 +source="https://github.com/maximbaz/wluma/archive/$pkgver/wluma-$pkgver.tar.gz + cargo.patch + link-vulkan-at-runtime.patch + sys-level-config.patch + default-config.patch + + https://github.com/raymanfx/libv4l-rs/archive/$_libv4l_gitrev/libv4l-rs-$_libv4l_gitrev.tar.gz + libv4l-rs-01-fix-string-pointer-cast.patch + libv4l-rs-02-fix-wrong-_IOC_TYPE-on-musl.patch + " + +prepare() { + mv ../libv4l-rs-$_libv4l_gitrev "$builddir"/libv4l-rs + + 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 --locked +} + +build() { + cargo 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=" +d9e16f0af0961678c9f59fd692f50e517cf0f5791d16c50314ee909cab81b468c921850d50f264199cf4b52388d3e30797d7cc82ab22d71f26ee3e5705157992 wluma-4.1.2.tar.gz +56fef5b5cdc4d1e7fbf4c592ee7235cab9c4512a8f87d4c83c8d1b2309d6aaf4dd758516b4f32b35823ddfe162787740881202eb2f2b072df6b479dfe3e7295f cargo.patch +9e6d773e41fa40b9f565d98929a7c561e37e641fcb1ffdfd4295cdf94e324be467e82016d002b86132b0c4293e265703ee0f05d1f061929c17bf08e34f4bedfc link-vulkan-at-runtime.patch +cecbb642c881c17edc2dd8475905db186a55f1026a16fb8049b5597b69f74b8db3d9c705f5e0ac75351955347f534d545e8069dee10ce5b378aa60c9b9be45aa sys-level-config.patch +d6d864b048b711699d612aa3d658ada8c1e7094271885dccddec0064bebe4380bb014a74ef0cd3f9700d6964b20b268b2c6966000a6cb98c63110729a133f041 default-config.patch +7b60a001e695b7b7281807c2d96ad640d1072093a97279299f3051bfae6eed32e23ddc72dbcd0a06416cd5e8497012b13a0c3dac43ae7ec1b79cc77c3f1e2599 libv4l-rs-d7ac716f6065a0e1aa47ef673387603d6eacc4f0.tar.gz +828075e7bec0317c137ce0d68424d209cdf62ff24c55e813f4449401de884643bd9e6114acbf92f002459f4a95d4d672bab4eba03216351319b7f0366b3006f3 libv4l-rs-01-fix-string-pointer-cast.patch +62d81304209f072cb63073b306e6b61fbd0e7cd0c1cde75f1c24e792385c437e1c6737ec3713b9f71bae0c9b37ad47b08605b5c4af6d6ebf78d5fc9a9628fea5 libv4l-rs-02-fix-wrong-_IOC_TYPE-on-musl.patch +" diff --git a/community/wluma/cargo.patch b/community/wluma/cargo.patch new file mode 100644 index 00000000000..8eada4d19d5 --- /dev/null +++ b/community/wluma/cargo.patch @@ -0,0 +1,62 @@ +From: Jakub Jirutka +Date: Sun, 6 Feb 2022 22:23:00 +0100 +Subject: [PATCH] Patch dependencies + +- Use latest v4l and fix incorrect types (needed for building against musl). +- Link vulkan-loader at runtime instead of build-time to make it optional + (it's used only for `capturer = "wlroots"`). + +--- a/Cargo.toml ++++ b/Cargo.toml +@@ -12,9 +12,9 @@ + dirs = "3.0" + toml = { git = "https://github.com/vgao1996/toml-rs", branch = "dotted-table-0.5.8" } + chrono = "0.4" +-ash = { version = "0.35", features = ["linked"], default-features = false } ++ash = { version = "0.35", features = ["loaded"], default-features = false } + itertools = "0.10" +-v4l = { version = "0.12", features = ["libv4l"], default-features = false } ++v4l = { version = "0.12.2", features = ["libv4l"], default-features = false } + ddc-hi = "0.4" + log = "0.4" + env_logger = "0.9" +@@ -23,3 +23,6 @@ + + [dev-dependencies] + mockall = "0.10" ++ ++[patch.crates-io] ++v4l = { path = "./libv4l-rs" } +--- a/Cargo.lock ++++ b/Cargo.lock +@@ -31,6 +31,9 @@ + version = "0.35.1+1.2.203" + source = "registry+https://github.com/rust-lang/crates.io-index" + checksum = "b7fd04def1c9101b5fb488c131022d2d6f87753ef4b1b11b279e2af404fae6b9" ++dependencies = [ ++ "libloading", ++] + + [[package]] + name = "atty" +@@ -1084,9 +1087,7 @@ + + [[package]] + name = "v4l" +-version = "0.12.1" +-source = "registry+https://github.com/rust-lang/crates.io-index" +-checksum = "4f6eca58bca86b4b353b55e18828694f91e83dd7e9c4d7f127515e4687d5a8e9" ++version = "0.12.2" + dependencies = [ + "bitflags", + "libc", +@@ -1096,8 +1097,6 @@ + [[package]] + name = "v4l-sys" + version = "0.2.0" +-source = "registry+https://github.com/rust-lang/crates.io-index" +-checksum = "f91dc47f9668a0a1a0af7ba194f2d543a68c2ef9eb61888f89565d60b34247fe" + dependencies = [ + "bindgen", + ] + diff --git a/community/wluma/default-config.patch b/community/wluma/default-config.patch new file mode 100644 index 00000000000..7f97ae36a1f --- /dev/null +++ b/community/wluma/default-config.patch @@ -0,0 +1,56 @@ +--- a/config.toml ++++ b/config.toml +@@ -1,7 +1,9 @@ +-[als.iio] +-path = "/sys/bus/iio/devices" +-thresholds = { 0 = "night", 20 = "dark", 80 = "dim", 250 = "normal", 500 = "bright", 800 = "outdoors" } ++## Ambient Light Sensor + ++# [als.iio] ++# path = "/sys/bus/iio/devices" ++# thresholds = { 0 = "night", 20 = "dark", 80 = "dim", 250 = "normal", 500 = "bright", 800 = "outdoors" } ++ + # [als.webcam] + # video = 0 + # thresholds = { 0 = "night", 15 = "dark", 30 = "dim", 45 = "normal", 60 = "bright", 75 = "outdoors" } +@@ -9,20 +11,34 @@ + # [als.time] + # thresholds = { 0 = "night", 7 = "dark", 9 = "dim", 11 = "normal", 13 = "bright", 16 = "normal", 18 = "dark", 20 = "night" } + +-# [als.none] ++[als.none] + ++ ++## Display Backlight ++ + [[output.backlight]] + name = "eDP-1" +-path = "/sys/class/backlight/intel_backlight" +-capturer = "wlroots" ++path = "/sys/class/backlight/intel_backlight" # Intel GPU ++#path = "/sys/class/backlight/amdgpu_bl0" # AMD GPU ++# Change to "wlroots" if you use wlroots-based compositor and want to adjust ++# brightness based on the screen contents. ++capturer = "none" + ++# [[output.backlight]] ++# name = "eDP-1" ++# path = "/sys/class/backlight/amdgpu_bl0" # AMD GPU ++# capturer = "wlroots" ++ + # [[output.ddcutil]] + # name = "Dell Inc. DELL P2415Q" + # capturer = "none" + +-[[keyboard]] +-name = "keyboard-dell" +-path = "/sys/bus/platform/devices/dell-laptop/leds/dell::kbd_backlight" ++ ++## Keyboard Backlight ++ ++# [[keyboard]] ++# name = "keyboard-dell" ++# path = "/sys/bus/platform/devices/dell-laptop/leds/dell::kbd_backlight" + + # [[keyboard]] + # name = "keyboard-thinkpad" diff --git a/community/wluma/libv4l-rs-01-fix-string-pointer-cast.patch b/community/wluma/libv4l-rs-01-fix-string-pointer-cast.patch new file mode 100644 index 00000000000..194c9498ff6 --- /dev/null +++ b/community/wluma/libv4l-rs-01-fix-string-pointer-cast.patch @@ -0,0 +1,23 @@ +Patch-Source: https://github.com/raymanfx/libv4l-rs/pull/48/commits/aade3ba9014458a61fa08471c5c2fd8844c2ba73 (modified) +-- +From aade3ba9014458a61fa08471c5c2fd8844c2ba73 Mon Sep 17 00:00:00 2001 +From: "b.specht" +Date: Tue, 21 Dec 2021 10:45:28 +0100 +Subject: [PATCH] Let rust figure out the type + +On certain platforms, like when cross-compiling to Android, strings are +defined as `u8` instead of `i8`. + +diff --git a/src/device.rs b/src/device.rs +index 3442005..be93790 100644 +--- a/libv4l-rs/src/device.rs ++++ b/libv4l-rs/src/device.rs +@@ -265,7 +265,7 @@ impl Device { + control.size = std::mem::size_of::() as u32; + } + control::Value::String(ref val) => { +- control.__bindgen_anon_1.string = val.as_ptr() as *mut i8; ++ control.__bindgen_anon_1.string = val.as_ptr() as *mut _; + control.size = val.len() as u32; + } + control::Value::CompoundU8(ref val) => { diff --git a/community/wluma/libv4l-rs-02-fix-wrong-_IOC_TYPE-on-musl.patch b/community/wluma/libv4l-rs-02-fix-wrong-_IOC_TYPE-on-musl.patch new file mode 100644 index 00000000000..8de697d2730 --- /dev/null +++ b/community/wluma/libv4l-rs-02-fix-wrong-_IOC_TYPE-on-musl.patch @@ -0,0 +1,26 @@ +From 31f84751889857fed7e064c1ec713382582e435f Mon Sep 17 00:00:00 2001 +From: Jakub Jirutka +Date: Sun, 6 Feb 2022 16:10:34 +0100 +Subject: [PATCH] Fix wrong _IOC_TYPE on musl + + error[E0308]: mismatched types + --> libv4l-rs-917e1f4ffd90b94a/d7ac716/src/v4l2/api.rs:23:24 + | + 23 | v4l2_ioctl(fd, request, argp) + | ^^^^^^^ expected `u64`, found `i64` + +diff --git a/src/v4l2/vidioc.rs b/src/v4l2/vidioc.rs +--- a/libv4l-rs/src/v4l2/vidioc.rs ++++ b/libv4l-rs/src/v4l2/vidioc.rs +@@ -1,11 +1,7 @@ + use crate::v4l_sys::*; + +-#[cfg(not(target_env = "musl"))] + #[allow(non_camel_case_types)] + pub type _IOC_TYPE = std::os::raw::c_ulong; +-#[cfg(target_env = "musl")] +-#[allow(non_camel_case_types)] +-pub type _IOC_TYPE = std::os::raw::c_long; + + // linux ioctl.h + const _IOC_NRBITS: u8 = 8; diff --git a/community/wluma/link-vulkan-at-runtime.patch b/community/wluma/link-vulkan-at-runtime.patch new file mode 100644 index 00000000000..f2f6a942e79 --- /dev/null +++ b/community/wluma/link-vulkan-at-runtime.patch @@ -0,0 +1,17 @@ +From: Jakub Jirutka +Date: Thu, 10 Feb 2022 20:16:00 +0100 +Subject: [PATCH] Link vulkan-loader at runtime + +This depends on cargo.patch - enabling ash's feature 'loaded'. + +--- a/src/frame/vulkan.rs ++++ b/src/frame/vulkan.rs +@@ -44,7 +44,7 @@ + vk::KhrGetPhysicalDeviceProperties2Fn::name().as_ptr(), + ]; + +- let entry = Entry::linked(); ++ let entry = unsafe { Entry::load()? }; + + let create_info = vk::InstanceCreateInfo::builder() + .application_info(&app_info) diff --git a/community/wluma/sys-level-config.patch b/community/wluma/sys-level-config.patch new file mode 100644 index 00000000000..8016225d1aa --- /dev/null +++ b/community/wluma/sys-level-config.patch @@ -0,0 +1,37 @@ +Patch-Source: https://github.com/maximbaz/wluma/pull/45 +-- +From 287ca22e90e005bd4e9343b57d0e0ea666f2f930 Mon Sep 17 00:00:00 2001 +From: Jakub Jirutka +Date: Thu, 10 Feb 2022 23:57:14 +0100 +Subject: [PATCH] Add support for system-level config in /etc/xdg/wluma/ + +--- + README.md | 2 +- + src/config/mod.rs | 1 + + 2 files changed, 2 insertions(+), 1 deletion(-) + +diff --git a/README.md b/README.md +index d2d8ae1..6bf2273 100644 +--- a/README.md ++++ b/README.md +@@ -40,7 +40,7 @@ In order to access backlight devices, `wluma` must either run as `root`, or pref + + ## Configuration + +-The `config.toml` in repository represents default config values. To change them, copy the file into `$XDG_CONFIG_HOME/wluma/config.toml` and adjust as desired. ++The `config.toml` in repository represents default config values. To change them, copy the file into `$XDG_CONFIG_HOME/wluma/config.toml` or `/etc/xdg/wluma/config.toml` (the former takes precedence over the latter) and adjust as desired. + + ### ALS + +diff --git a/src/config/mod.rs b/src/config/mod.rs +index b8944b2..d515de7 100644 +--- a/src/config/mod.rs ++++ b/src/config/mod.rs +@@ -14,6 +14,7 @@ pub fn load() -> Result> { + fn parse() -> Result { + let file_config = dirs::config_dir() + .and_then(|config_dir| fs::read_to_string(&config_dir.join("wluma/config.toml")).ok()) ++ .or_else(|| fs::read_to_string("/etc/xdg/wluma/config.toml").ok()) + .unwrap_or_else(|| include_str!("../../config.toml").to_string()); + + let parse_als_thresholds = |t: HashMap| -> HashMap { diff --git a/community/wluma/wluma.post-install b/community/wluma/wluma.post-install new file mode 100644 index 00000000000..fc16251e6b2 --- /dev/null +++ b/community/wluma/wluma.post-install @@ -0,0 +1,10 @@ +#!/bin/sh +# +# If we have udev running then reload the rules and add the +# proper subsystems so people can use it +if [ -S /run/udev/control ]; then + udevadm control --reload-rules + udevadm trigger -s leds -s backlight -c add +fi + +exit 0 diff --git a/testing/wluma/APKBUILD b/testing/wluma/APKBUILD deleted file mode 100644 index 1352a7be239..00000000000 --- a/testing/wluma/APKBUILD +++ /dev/null @@ -1,88 +0,0 @@ -# Contributor: Jakub Jirutka -# Maintainer: Jakub Jirutka -pkgname=wluma -pkgver=4.1.2 -pkgrel=2 -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 - clang - eudev-dev - v4l-utils-dev - wayland-dev - vulkan-loader-dev - " -install="$pkgname.post-install" -subpackages="$pkgname-wlroots" -_libv4l_gitrev=d7ac716f6065a0e1aa47ef673387603d6eacc4f0 -source="https://github.com/maximbaz/wluma/archive/$pkgver/wluma-$pkgver.tar.gz - cargo.patch - link-vulkan-at-runtime.patch - sys-level-config.patch - default-config.patch - - https://github.com/raymanfx/libv4l-rs/archive/$_libv4l_gitrev/libv4l-rs-$_libv4l_gitrev.tar.gz - libv4l-rs-01-fix-string-pointer-cast.patch - libv4l-rs-02-fix-wrong-_IOC_TYPE-on-musl.patch - " - -prepare() { - mv ../libv4l-rs-$_libv4l_gitrev "$builddir"/libv4l-rs - - 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 --locked -} - -build() { - cargo 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=" -d9e16f0af0961678c9f59fd692f50e517cf0f5791d16c50314ee909cab81b468c921850d50f264199cf4b52388d3e30797d7cc82ab22d71f26ee3e5705157992 wluma-4.1.2.tar.gz -56fef5b5cdc4d1e7fbf4c592ee7235cab9c4512a8f87d4c83c8d1b2309d6aaf4dd758516b4f32b35823ddfe162787740881202eb2f2b072df6b479dfe3e7295f cargo.patch -9e6d773e41fa40b9f565d98929a7c561e37e641fcb1ffdfd4295cdf94e324be467e82016d002b86132b0c4293e265703ee0f05d1f061929c17bf08e34f4bedfc link-vulkan-at-runtime.patch -cecbb642c881c17edc2dd8475905db186a55f1026a16fb8049b5597b69f74b8db3d9c705f5e0ac75351955347f534d545e8069dee10ce5b378aa60c9b9be45aa sys-level-config.patch -d6d864b048b711699d612aa3d658ada8c1e7094271885dccddec0064bebe4380bb014a74ef0cd3f9700d6964b20b268b2c6966000a6cb98c63110729a133f041 default-config.patch -7b60a001e695b7b7281807c2d96ad640d1072093a97279299f3051bfae6eed32e23ddc72dbcd0a06416cd5e8497012b13a0c3dac43ae7ec1b79cc77c3f1e2599 libv4l-rs-d7ac716f6065a0e1aa47ef673387603d6eacc4f0.tar.gz -828075e7bec0317c137ce0d68424d209cdf62ff24c55e813f4449401de884643bd9e6114acbf92f002459f4a95d4d672bab4eba03216351319b7f0366b3006f3 libv4l-rs-01-fix-string-pointer-cast.patch -62d81304209f072cb63073b306e6b61fbd0e7cd0c1cde75f1c24e792385c437e1c6737ec3713b9f71bae0c9b37ad47b08605b5c4af6d6ebf78d5fc9a9628fea5 libv4l-rs-02-fix-wrong-_IOC_TYPE-on-musl.patch -" diff --git a/testing/wluma/cargo.patch b/testing/wluma/cargo.patch deleted file mode 100644 index 8eada4d19d5..00000000000 --- a/testing/wluma/cargo.patch +++ /dev/null @@ -1,62 +0,0 @@ -From: Jakub Jirutka -Date: Sun, 6 Feb 2022 22:23:00 +0100 -Subject: [PATCH] Patch dependencies - -- Use latest v4l and fix incorrect types (needed for building against musl). -- Link vulkan-loader at runtime instead of build-time to make it optional - (it's used only for `capturer = "wlroots"`). - ---- a/Cargo.toml -+++ b/Cargo.toml -@@ -12,9 +12,9 @@ - dirs = "3.0" - toml = { git = "https://github.com/vgao1996/toml-rs", branch = "dotted-table-0.5.8" } - chrono = "0.4" --ash = { version = "0.35", features = ["linked"], default-features = false } -+ash = { version = "0.35", features = ["loaded"], default-features = false } - itertools = "0.10" --v4l = { version = "0.12", features = ["libv4l"], default-features = false } -+v4l = { version = "0.12.2", features = ["libv4l"], default-features = false } - ddc-hi = "0.4" - log = "0.4" - env_logger = "0.9" -@@ -23,3 +23,6 @@ - - [dev-dependencies] - mockall = "0.10" -+ -+[patch.crates-io] -+v4l = { path = "./libv4l-rs" } ---- a/Cargo.lock -+++ b/Cargo.lock -@@ -31,6 +31,9 @@ - version = "0.35.1+1.2.203" - source = "registry+https://github.com/rust-lang/crates.io-index" - checksum = "b7fd04def1c9101b5fb488c131022d2d6f87753ef4b1b11b279e2af404fae6b9" -+dependencies = [ -+ "libloading", -+] - - [[package]] - name = "atty" -@@ -1084,9 +1087,7 @@ - - [[package]] - name = "v4l" --version = "0.12.1" --source = "registry+https://github.com/rust-lang/crates.io-index" --checksum = "4f6eca58bca86b4b353b55e18828694f91e83dd7e9c4d7f127515e4687d5a8e9" -+version = "0.12.2" - dependencies = [ - "bitflags", - "libc", -@@ -1096,8 +1097,6 @@ - [[package]] - name = "v4l-sys" - version = "0.2.0" --source = "registry+https://github.com/rust-lang/crates.io-index" --checksum = "f91dc47f9668a0a1a0af7ba194f2d543a68c2ef9eb61888f89565d60b34247fe" - dependencies = [ - "bindgen", - ] - diff --git a/testing/wluma/default-config.patch b/testing/wluma/default-config.patch deleted file mode 100644 index 7f97ae36a1f..00000000000 --- a/testing/wluma/default-config.patch +++ /dev/null @@ -1,56 +0,0 @@ ---- a/config.toml -+++ b/config.toml -@@ -1,7 +1,9 @@ --[als.iio] --path = "/sys/bus/iio/devices" --thresholds = { 0 = "night", 20 = "dark", 80 = "dim", 250 = "normal", 500 = "bright", 800 = "outdoors" } -+## Ambient Light Sensor - -+# [als.iio] -+# path = "/sys/bus/iio/devices" -+# thresholds = { 0 = "night", 20 = "dark", 80 = "dim", 250 = "normal", 500 = "bright", 800 = "outdoors" } -+ - # [als.webcam] - # video = 0 - # thresholds = { 0 = "night", 15 = "dark", 30 = "dim", 45 = "normal", 60 = "bright", 75 = "outdoors" } -@@ -9,20 +11,34 @@ - # [als.time] - # thresholds = { 0 = "night", 7 = "dark", 9 = "dim", 11 = "normal", 13 = "bright", 16 = "normal", 18 = "dark", 20 = "night" } - --# [als.none] -+[als.none] - -+ -+## Display Backlight -+ - [[output.backlight]] - name = "eDP-1" --path = "/sys/class/backlight/intel_backlight" --capturer = "wlroots" -+path = "/sys/class/backlight/intel_backlight" # Intel GPU -+#path = "/sys/class/backlight/amdgpu_bl0" # AMD GPU -+# Change to "wlroots" if you use wlroots-based compositor and want to adjust -+# brightness based on the screen contents. -+capturer = "none" - -+# [[output.backlight]] -+# name = "eDP-1" -+# path = "/sys/class/backlight/amdgpu_bl0" # AMD GPU -+# capturer = "wlroots" -+ - # [[output.ddcutil]] - # name = "Dell Inc. DELL P2415Q" - # capturer = "none" - --[[keyboard]] --name = "keyboard-dell" --path = "/sys/bus/platform/devices/dell-laptop/leds/dell::kbd_backlight" -+ -+## Keyboard Backlight -+ -+# [[keyboard]] -+# name = "keyboard-dell" -+# path = "/sys/bus/platform/devices/dell-laptop/leds/dell::kbd_backlight" - - # [[keyboard]] - # name = "keyboard-thinkpad" diff --git a/testing/wluma/libv4l-rs-01-fix-string-pointer-cast.patch b/testing/wluma/libv4l-rs-01-fix-string-pointer-cast.patch deleted file mode 100644 index 194c9498ff6..00000000000 --- a/testing/wluma/libv4l-rs-01-fix-string-pointer-cast.patch +++ /dev/null @@ -1,23 +0,0 @@ -Patch-Source: https://github.com/raymanfx/libv4l-rs/pull/48/commits/aade3ba9014458a61fa08471c5c2fd8844c2ba73 (modified) --- -From aade3ba9014458a61fa08471c5c2fd8844c2ba73 Mon Sep 17 00:00:00 2001 -From: "b.specht" -Date: Tue, 21 Dec 2021 10:45:28 +0100 -Subject: [PATCH] Let rust figure out the type - -On certain platforms, like when cross-compiling to Android, strings are -defined as `u8` instead of `i8`. - -diff --git a/src/device.rs b/src/device.rs -index 3442005..be93790 100644 ---- a/libv4l-rs/src/device.rs -+++ b/libv4l-rs/src/device.rs -@@ -265,7 +265,7 @@ impl Device { - control.size = std::mem::size_of::() as u32; - } - control::Value::String(ref val) => { -- control.__bindgen_anon_1.string = val.as_ptr() as *mut i8; -+ control.__bindgen_anon_1.string = val.as_ptr() as *mut _; - control.size = val.len() as u32; - } - control::Value::CompoundU8(ref val) => { diff --git a/testing/wluma/libv4l-rs-02-fix-wrong-_IOC_TYPE-on-musl.patch b/testing/wluma/libv4l-rs-02-fix-wrong-_IOC_TYPE-on-musl.patch deleted file mode 100644 index 8de697d2730..00000000000 --- a/testing/wluma/libv4l-rs-02-fix-wrong-_IOC_TYPE-on-musl.patch +++ /dev/null @@ -1,26 +0,0 @@ -From 31f84751889857fed7e064c1ec713382582e435f Mon Sep 17 00:00:00 2001 -From: Jakub Jirutka -Date: Sun, 6 Feb 2022 16:10:34 +0100 -Subject: [PATCH] Fix wrong _IOC_TYPE on musl - - error[E0308]: mismatched types - --> libv4l-rs-917e1f4ffd90b94a/d7ac716/src/v4l2/api.rs:23:24 - | - 23 | v4l2_ioctl(fd, request, argp) - | ^^^^^^^ expected `u64`, found `i64` - -diff --git a/src/v4l2/vidioc.rs b/src/v4l2/vidioc.rs ---- a/libv4l-rs/src/v4l2/vidioc.rs -+++ b/libv4l-rs/src/v4l2/vidioc.rs -@@ -1,11 +1,7 @@ - use crate::v4l_sys::*; - --#[cfg(not(target_env = "musl"))] - #[allow(non_camel_case_types)] - pub type _IOC_TYPE = std::os::raw::c_ulong; --#[cfg(target_env = "musl")] --#[allow(non_camel_case_types)] --pub type _IOC_TYPE = std::os::raw::c_long; - - // linux ioctl.h - const _IOC_NRBITS: u8 = 8; diff --git a/testing/wluma/link-vulkan-at-runtime.patch b/testing/wluma/link-vulkan-at-runtime.patch deleted file mode 100644 index f2f6a942e79..00000000000 --- a/testing/wluma/link-vulkan-at-runtime.patch +++ /dev/null @@ -1,17 +0,0 @@ -From: Jakub Jirutka -Date: Thu, 10 Feb 2022 20:16:00 +0100 -Subject: [PATCH] Link vulkan-loader at runtime - -This depends on cargo.patch - enabling ash's feature 'loaded'. - ---- a/src/frame/vulkan.rs -+++ b/src/frame/vulkan.rs -@@ -44,7 +44,7 @@ - vk::KhrGetPhysicalDeviceProperties2Fn::name().as_ptr(), - ]; - -- let entry = Entry::linked(); -+ let entry = unsafe { Entry::load()? }; - - let create_info = vk::InstanceCreateInfo::builder() - .application_info(&app_info) diff --git a/testing/wluma/sys-level-config.patch b/testing/wluma/sys-level-config.patch deleted file mode 100644 index 8016225d1aa..00000000000 --- a/testing/wluma/sys-level-config.patch +++ /dev/null @@ -1,37 +0,0 @@ -Patch-Source: https://github.com/maximbaz/wluma/pull/45 --- -From 287ca22e90e005bd4e9343b57d0e0ea666f2f930 Mon Sep 17 00:00:00 2001 -From: Jakub Jirutka -Date: Thu, 10 Feb 2022 23:57:14 +0100 -Subject: [PATCH] Add support for system-level config in /etc/xdg/wluma/ - ---- - README.md | 2 +- - src/config/mod.rs | 1 + - 2 files changed, 2 insertions(+), 1 deletion(-) - -diff --git a/README.md b/README.md -index d2d8ae1..6bf2273 100644 ---- a/README.md -+++ b/README.md -@@ -40,7 +40,7 @@ In order to access backlight devices, `wluma` must either run as `root`, or pref - - ## Configuration - --The `config.toml` in repository represents default config values. To change them, copy the file into `$XDG_CONFIG_HOME/wluma/config.toml` and adjust as desired. -+The `config.toml` in repository represents default config values. To change them, copy the file into `$XDG_CONFIG_HOME/wluma/config.toml` or `/etc/xdg/wluma/config.toml` (the former takes precedence over the latter) and adjust as desired. - - ### ALS - -diff --git a/src/config/mod.rs b/src/config/mod.rs -index b8944b2..d515de7 100644 ---- a/src/config/mod.rs -+++ b/src/config/mod.rs -@@ -14,6 +14,7 @@ pub fn load() -> Result> { - fn parse() -> Result { - let file_config = dirs::config_dir() - .and_then(|config_dir| fs::read_to_string(&config_dir.join("wluma/config.toml")).ok()) -+ .or_else(|| fs::read_to_string("/etc/xdg/wluma/config.toml").ok()) - .unwrap_or_else(|| include_str!("../../config.toml").to_string()); - - let parse_als_thresholds = |t: HashMap| -> HashMap { diff --git a/testing/wluma/wluma.post-install b/testing/wluma/wluma.post-install deleted file mode 100644 index fc16251e6b2..00000000000 --- a/testing/wluma/wluma.post-install +++ /dev/null @@ -1,10 +0,0 @@ -#!/bin/sh -# -# If we have udev running then reload the rules and add the -# proper subsystems so people can use it -if [ -S /run/udev/control ]; then - udevadm control --reload-rules - udevadm trigger -s leds -s backlight -c add -fi - -exit 0 -- cgit v1.2.3