diff options
Diffstat (limited to 'x11/ashell/files')
-rw-r--r-- | x11/ashell/files/iced/patch-core_src_window_settings.rs | 19 | ||||
-rw-r--r-- | x11/ashell/files/iced/patch-wgpu_src_window.rs | 13 | ||||
-rw-r--r-- | x11/ashell/files/iced/patch-wgpu_src_window_x11.rs | 19 | ||||
-rw-r--r-- | x11/ashell/files/iced/patch-winit_Cargo.toml | 11 | ||||
-rw-r--r-- | x11/ashell/files/iced/patch-winit_src_clipboard.rs | 11 | ||||
-rw-r--r-- | x11/ashell/files/iced/patch-winit_src_conversion.rs | 11 | ||||
-rw-r--r-- | x11/ashell/files/iced/patch-winit_src_platform__specific_mod.rs | 89 | ||||
-rw-r--r-- | x11/ashell/files/iced/patch-winit_src_program.rs | 11 | ||||
-rw-r--r-- | x11/ashell/files/patch-pipewire-sys-0.8.0 | 59 |
9 files changed, 243 insertions, 0 deletions
diff --git a/x11/ashell/files/iced/patch-core_src_window_settings.rs b/x11/ashell/files/iced/patch-core_src_window_settings.rs new file mode 100644 index 000000000000..69cfd050e40b --- /dev/null +++ b/x11/ashell/files/iced/patch-core_src_window_settings.rs @@ -0,0 +1,19 @@ +--- core/src/window/settings.rs.orig 2025-09-19 07:04:16 UTC ++++ core/src/window/settings.rs +@@ -7,7 +7,7 @@ mod platform; + #[path = "settings/macos.rs"] + mod platform; + +-#[cfg(target_os = "linux")] ++#[cfg(any(target_os = "linux", target_os = "freebsd"))] + #[path = "settings/linux.rs"] + mod platform; + +@@ -19,6 +19,7 @@ mod platform; + target_os = "windows", + target_os = "macos", + target_os = "linux", ++ target_os = "freebsd", + target_arch = "wasm32" + )))] + #[path = "settings/other.rs"] diff --git a/x11/ashell/files/iced/patch-wgpu_src_window.rs b/x11/ashell/files/iced/patch-wgpu_src_window.rs new file mode 100644 index 000000000000..c185be3fdf87 --- /dev/null +++ b/x11/ashell/files/iced/patch-wgpu_src_window.rs @@ -0,0 +1,13 @@ +--- wgpu/src/window.rs.orig 2025-09-19 07:04:16 UTC ++++ wgpu/src/window.rs +@@ -17,8 +17,8 @@ fn ids_from_dev(dev: u64) -> Option<(u16, u16)> { + fn ids_from_dev(dev: u64) -> Option<(u16, u16)> { + let path = PathBuf::from(format!( + "/sys/dev/char/{}:{}/device", +- major(dev), +- minor(dev) ++ major(dev.try_into().unwrap()), ++ minor(dev.try_into().unwrap()) + )); + let vendor = { + let path = path.join("vendor"); diff --git a/x11/ashell/files/iced/patch-wgpu_src_window_x11.rs b/x11/ashell/files/iced/patch-wgpu_src_window_x11.rs new file mode 100644 index 000000000000..6cf65d257aa8 --- /dev/null +++ b/x11/ashell/files/iced/patch-wgpu_src_window_x11.rs @@ -0,0 +1,19 @@ +--- wgpu/src/window/x11.rs.orig 2025-09-19 07:04:16 UTC ++++ wgpu/src/window/x11.rs +@@ -145,7 +145,7 @@ pub fn get_x11_device_ids<W: Window>(window: &W) -> Op + let stat = + stat(Path::new("/dev/dri").join(device)).ok()?; + let dev = stat.st_rdev; +- return super::ids_from_dev(dev); ++ return super::ids_from_dev(dev.into()); + } + } + } +@@ -166,6 +166,6 @@ pub fn get_x11_device_ids<W: Window>(window: &W) -> Op + let device_fd = dri3.device_fd; + let stat = fstat(device_fd).ok()?; + let dev = stat.st_rdev; +- super::ids_from_dev(dev) ++ super::ids_from_dev(dev.into()) + } + } diff --git a/x11/ashell/files/iced/patch-winit_Cargo.toml b/x11/ashell/files/iced/patch-winit_Cargo.toml new file mode 100644 index 000000000000..a2d1009620b5 --- /dev/null +++ b/x11/ashell/files/iced/patch-winit_Cargo.toml @@ -0,0 +1,11 @@ +--- winit/Cargo.toml.orig 2025-09-19 07:04:16 UTC ++++ winit/Cargo.toml +@@ -56,7 +56,7 @@ sysinfo.optional = true + sysinfo.workspace = true + sysinfo.optional = true + +-[target.'cfg(target_os = "linux")'.dependencies] ++[target.'cfg(any(target_os = "linux", target_os = "freebsd"))'.dependencies] + raw-window-handle = { version = "0.6", optional = true } + cctk.workspace = true + cctk.optional = true diff --git a/x11/ashell/files/iced/patch-winit_src_clipboard.rs b/x11/ashell/files/iced/patch-winit_src_clipboard.rs new file mode 100644 index 000000000000..7c1260fff897 --- /dev/null +++ b/x11/ashell/files/iced/patch-winit_src_clipboard.rs @@ -0,0 +1,11 @@ +--- winit/src/clipboard.rs.orig 2025-09-19 07:04:16 UTC ++++ winit/src/clipboard.rs +@@ -91,7 +91,7 @@ impl Clipboard { + }) + .unwrap_or(State::Unavailable); + +- #[cfg(target_os = "linux")] ++ #[cfg(any(target_os = "linux", target_os = "freebsd"))] + if let State::Connected { clipboard, .. } = &state { + clipboard.init_dnd(Box::new(sender)); + } diff --git a/x11/ashell/files/iced/patch-winit_src_conversion.rs b/x11/ashell/files/iced/patch-winit_src_conversion.rs new file mode 100644 index 000000000000..68944941bc47 --- /dev/null +++ b/x11/ashell/files/iced/patch-winit_src_conversion.rs @@ -0,0 +1,11 @@ +--- winit/src/conversion.rs.orig 2025-09-19 07:04:16 UTC ++++ winit/src/conversion.rs +@@ -105,7 +105,7 @@ pub fn window_attributes( + ); + } + +- #[cfg(target_os = "linux")] ++ #[cfg(any(target_os = "linux", target_os = "freebsd"))] + { + #[cfg(feature = "x11")] + { diff --git a/x11/ashell/files/iced/patch-winit_src_platform__specific_mod.rs b/x11/ashell/files/iced/patch-winit_src_platform__specific_mod.rs new file mode 100644 index 000000000000..1c197d196569 --- /dev/null +++ b/x11/ashell/files/iced/patch-winit_src_platform__specific_mod.rs @@ -0,0 +1,89 @@ +--- winit/src/platform_specific/mod.rs.orig 2025-09-19 07:04:16 UTC ++++ winit/src/platform_specific/mod.rs +@@ -10,19 +10,19 @@ use winit::raw_window_handle::HasWindowHandle; + }; + use winit::raw_window_handle::HasWindowHandle; + +-#[cfg(all(feature = "wayland", target_os = "linux"))] ++#[cfg(all(feature = "wayland", any(target_os = "linux", target_os = "freebsd")))] + pub mod wayland; + +-#[cfg(all(feature = "wayland", target_os = "linux"))] ++#[cfg(all(feature = "wayland", any(target_os = "linux", target_os = "freebsd")))] + pub use wayland::*; +-#[cfg(all(feature = "wayland", target_os = "linux"))] ++#[cfg(all(feature = "wayland", any(target_os = "linux", target_os = "freebsd")))] + use wayland_backend::client::Backend; + + use crate::{program::WindowManager, Program}; + + #[derive(Debug)] + pub enum Event { +- #[cfg(all(feature = "wayland", target_os = "linux"))] ++ #[cfg(all(feature = "wayland", any(target_os = "linux", target_os = "freebsd")))] + Wayland(sctk_event::SctkEvent), + } + +@@ -48,7 +48,7 @@ pub struct PlatformSpecific { + + #[derive(Debug, Default)] + pub struct PlatformSpecific { +- #[cfg(all(feature = "wayland", target_os = "linux"))] ++ #[cfg(all(feature = "wayland", any(target_os = "linux", target_os = "freebsd")))] + wayland: WaylandSpecific, + } + +@@ -58,7 +58,7 @@ impl PlatformSpecific { + action: iced_runtime::platform_specific::Action, + ) { + match action { +- #[cfg(all(feature = "wayland", target_os = "linux"))] ++ #[cfg(all(feature = "wayland", any(target_os = "linux", target_os = "freebsd")))] + iced_runtime::platform_specific::Action::Wayland(a) => { + self.send_wayland(wayland::Action::Action(a)); + } +@@ -76,7 +76,7 @@ impl PlatformSpecific { + } + + pub(crate) fn clear_subsurface_list(&mut self) { +- #[cfg(all(feature = "wayland", target_os = "linux"))] ++ #[cfg(all(feature = "wayland", any(target_os = "linux", target_os = "freebsd")))] + { + self.wayland.clear_subsurface_list(); + } +@@ -87,7 +87,7 @@ impl PlatformSpecific { + id: window::Id, + window: &dyn HasWindowHandle, + ) { +- #[cfg(all(feature = "wayland", target_os = "linux"))] ++ #[cfg(all(feature = "wayland", any(target_os = "linux", target_os = "freebsd")))] + { + use cctk::sctk::reexports::client::{ + protocol::wl_surface::WlSurface, Proxy, +@@ -138,7 +138,7 @@ impl PlatformSpecific { + pub(crate) fn create_surface( + &mut self, + ) -> Option<Box<dyn HasWindowHandle + Send + Sync + 'static>> { +- #[cfg(all(feature = "wayland", target_os = "linux"))] ++ #[cfg(all(feature = "wayland", any(target_os = "linux", target_os = "freebsd")))] + { + return self.wayland.create_surface(); + } +@@ -154,7 +154,7 @@ impl PlatformSpecific { + data: &[u8], + offset: Vector, + ) { +- #[cfg(all(feature = "wayland", target_os = "linux"))] ++ #[cfg(all(feature = "wayland", any(target_os = "linux", target_os = "freebsd")))] + { + return self.wayland.update_surface_shm( + surface, width, height, scale, data, offset, +@@ -193,7 +193,7 @@ pub(crate) fn handle_event<'a, P, C>( + C: Compositor<Renderer = P::Renderer>, + { + match e { +- #[cfg(all(feature = "wayland", target_os = "linux"))] ++ #[cfg(all(feature = "wayland", any(target_os = "linux", target_os = "freebsd")))] + Event::Wayland(e) => { + platform_specific.wayland.handle_event( + e, diff --git a/x11/ashell/files/iced/patch-winit_src_program.rs b/x11/ashell/files/iced/patch-winit_src_program.rs new file mode 100644 index 000000000000..c9f71c7515ca --- /dev/null +++ b/x11/ashell/files/iced/patch-winit_src_program.rs @@ -0,0 +1,11 @@ +--- winit/src/program.rs.orig 2025-09-19 07:04:16 UTC ++++ winit/src/program.rs +@@ -773,7 +773,7 @@ async fn run_instance<'a, P, C>( + + let mut platform_specific_handler = + crate::platform_specific::PlatformSpecific::default(); +- #[cfg(all(feature = "wayland", target_os = "linux"))] ++ #[cfg(all(feature = "wayland", any(target_os = "linux", target_os = "freebsd")))] + if is_wayland { + platform_specific_handler = platform_specific_handler.with_wayland( + control_sender.clone(), diff --git a/x11/ashell/files/patch-pipewire-sys-0.8.0 b/x11/ashell/files/patch-pipewire-sys-0.8.0 new file mode 100644 index 000000000000..29fed332dd14 --- /dev/null +++ b/x11/ashell/files/patch-pipewire-sys-0.8.0 @@ -0,0 +1,59 @@ +From 04260b868ac1b9d8d7946ead0ff866070d14fda2 Mon Sep 17 00:00:00 2001 +From: GRENEWODE <grenewode@pm.me> +Date: Thu, 20 Feb 2025 23:02:21 -0500 +Subject: [PATCH] fix: Resolve API incompatiblities on FreeBSD hosts + +FreeBSD's `libutil` library defines `pw_init` and `pw_deinit` functions, +conflicting with the PipeWire API `pw_init` and `pw_deinit` functions. + +To resolve the conflict, the PipeWire package in FreeBSD's ports +patches the function definitions, renaming `pw_init` to `pipewire_init` +and renaming `pw_deinit` to `pipewire_deinit`. + +As a result, the expected `pw_init` and `pw_deinit` functions are not +generated on FreeBSD (and probably other BSDs). + +Since Rust supports namespaces, we can manually define `pw_init` and +`pw_deinit` aliases and there are not conflicts with any other libraries. + +Notes: +* `pipewire-sys/build.rs` + Update add the `pipewire_*` pattern to the allow list, so that the aliases are picked up by bindgen +* `pipewire-sys/src/lib.rs` + Adds aliases to for `pipewire_init` and `pipewire_deinit` to `pw_init` and `pw_deinit` respectively. + +See Also: +* https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=284719 +* https://github.com/freebsd/freebsd-ports/blob/87adc7e46597e5e28eb6139946530029f9363f79/multimedia/pipewire/files/patch-src_pipewire_pipewire_init + +--- cargo-crates/pipewire-sys-0.8.0/build.rs.orig 2006-07-24 01:21:28 UTC ++++ cargo-crates/pipewire-sys-0.8.0/build.rs +@@ -20,6 +20,11 @@ fn main() { + .parse_callbacks(Box::new(bindgen::CargoCallbacks::new())) + .size_t_is_usize(true) + .allowlist_function("pw_.*") ++ // Special case for FreeBSD. ++ // https://github.com/freebsd/freebsd-ports/blob/main/multimedia/pipewire/files/patch-src_pipewire_pipewire_init ++ // `libutil` defines functions pw_{init, deinit}, so those functions are aliased as pipewire_{init, deinit} ++ // in the port multimedia/pipewire ++ .allowlist_function("pipewire_.*") + .allowlist_type("pw_.*") + .allowlist_var("pw_.*") + .allowlist_var("PW_.*") +--- cargo-crates/pipewire-sys-0.8.0/src/lib.rs.orig 2006-07-24 01:21:28 UTC ++++ cargo-crates/pipewire-sys-0.8.0/src/lib.rs +@@ -13,6 +13,14 @@ pub use bindings::*; + } + pub use bindings::*; + ++// See comment in build.rs ++// Adds compatibility for patched pipewire in FreeBSD ++#[cfg(target_os = "freebsd")] ++pub use bindings::pipewire_init as pw_init; ++ ++#[cfg(target_os = "freebsd")] ++pub use bindings::pipewire_deinit as pw_deinit; ++ + #[cfg(test)] + mod tests { + use super::*; |