tags 1039534 +patch
thanks
squeekboard build-depends on missing:
- librust-gtk+v3-22-dev:amd64 (>= 0.14)

The current version of rust-gtk provides librust-gtk+v3-24-dev
After updating the dependencies (both Debian and cargo) to allow a build
to be attempted I discovered there were also a couple of real code issues.

The first is that gtk::rectangle is now an opaque type, so you have to
call "new" instead of assembling it field by field.

The second is that "property" appears to have been renamed first to
"property_value", then to "try_property_value". Then the non-panicing
version was removed completely. I modified the code to add an explicit
check if the property exists before calling the panicing version of
the function (now called "property_value") but I have no idea if this
is overkill or not.

I'm not really in a position to test this patch as I don't use Debian
on an appropriate device.

Anyway, a debdiff is attached, if there is no maintainer response,
*and* I get feedback from a user that the patched squeekboard is
usable then I may NMU it.
diff -Nru squeekboard-1.22.0/debian/changelog 
squeekboard-1.22.0/debian/changelog
--- squeekboard-1.22.0/debian/changelog 2023-06-13 14:43:56.000000000 +0000
+++ squeekboard-1.22.0/debian/changelog 2023-06-28 18:54:50.000000000 +0000
@@ -1,3 +1,16 @@
+squeekboard (1.22.0-2.1) UNRELEASED; urgency=medium
+
+  * Non-maintainer upload.
+  * Remove upper limit on cargo dependencies.
+  * Update for rust-gtk 0.16 and related packages. (Closes: #)
+    + Use v3_24 feature instead of v3_22 feature for rust-gtk as the former
+      no longer exists.
+    + Patch code to build with rust-gtk 0.16
+    + Bump rust-gtk/rust-glib dependencies to 0.16 as the fixes for 0.16
+      will break builds with older versions of the rust gtk stack.
+
+ -- Peter Michael Green <plugw...@debian.org>  Wed, 28 Jun 2023 18:54:50 +0000
+
 squeekboard (1.22.0-2) unstable; urgency=medium
 
   * Release to unstable
diff -Nru squeekboard-1.22.0/debian/control squeekboard-1.22.0/debian/control
--- squeekboard-1.22.0/debian/control   2023-06-13 14:43:56.000000000 +0000
+++ squeekboard-1.22.0/debian/control   2023-06-28 18:16:36.000000000 +0000
@@ -18,9 +18,9 @@
  librust-bitflags-1-dev (>= 1.0),
  librust-clap-4+std-dev (>= 3.1),
  librust-gio+v2-58-dev (>= 0.14),
- librust-glib+v2-58-dev (>= 0.14),
+ librust-glib+v2-58-dev (>= 0.16),
  librust-glib-sys-dev (>= 0.14),
- librust-gtk+v3-22-dev (>= 0.14),
+ librust-gtk+v3-24-dev (>= 0.16),
  librust-gtk-sys-dev (>= 0.14),
  librust-maplit-1-dev (>= 1.0),
  librust-serde-derive-1-dev (>= 1.0),
diff -Nru squeekboard-1.22.0/debian/patches/rust-gtk-0.16.patch 
squeekboard-1.22.0/debian/patches/rust-gtk-0.16.patch
--- squeekboard-1.22.0/debian/patches/rust-gtk-0.16.patch       1970-01-01 
00:00:00.000000000 +0000
+++ squeekboard-1.22.0/debian/patches/rust-gtk-0.16.patch       2023-06-28 
18:51:46.000000000 +0000
@@ -0,0 +1,92 @@
+Index: squeekboard-1.22.0/Cargo.deps.newer
+===================================================================
+--- squeekboard-1.22.0.orig/Cargo.deps.newer
++++ squeekboard-1.22.0/Cargo.deps.newer
+@@ -9,30 +9,30 @@ zvariant = "2.10.*"
+ zvariant_derive = "2.10.*"
+ 
+ [dependencies.cairo-rs]
+-version = "0.14.*"
++version = ">= 0.14"
+ 
+ [dependencies.cairo-sys-rs]
+-version = "0.14.*"
++version = ">= 0.14"
+ 
+ [dependencies.gdk]
+-version = "0.14.*"
++version = ">= 0.14"
+ 
+ [dependencies.gio]
+-version = "0.14.*"
++version = ">= 0.14"
+ features = ["v2_58"]
+ 
+ [dependencies.glib]
+-version = "0.14.*"
++version = ">= 0.14"
+ features = ["v2_58"]
+ 
+ [dependencies.glib-sys]
+-version = "0.14.*"
++version = ">= 0.14"
+ features = ["v2_58"]
+ 
+ [dependencies.gtk]
+-version = "0.14.*"
+-features = ["v3_22"]
++version = ">= 0.14"
++features = ["v3_24"]
+ 
+ [dependencies.gtk-sys]
+-version = "0.14.*"
+-features = ["v3_22"]
++version = ">= 0.14"
++features = ["v3_24"]
+Index: squeekboard-1.22.0/Cargo.toml.in
+===================================================================
+--- squeekboard-1.22.0.orig/Cargo.toml.in
++++ squeekboard-1.22.0/Cargo.toml.in
+@@ -31,5 +31,5 @@ clap_v4 = []
+ maplit = "1.0.*"
+ serde = { version = "1.0.*", features = ["derive"] }
+ serde_yaml = "0.8.*"
+-xkbcommon = { version = "0.4.*", features = ["wayland"] }
++xkbcommon = { version = ">= 0.4", features = ["wayland"] }
+ # Here is inserted the Cargo.deps file
+Index: squeekboard-1.22.0/src/popover.rs
+===================================================================
+--- squeekboard-1.22.0.orig/src/popover.rs
++++ squeekboard-1.22.0/src/popover.rs
+@@ -305,12 +305,12 @@ pub fn show(
+     #[cfg(not(feature = "glib_v0_14"))]
+     let menu = gtk::Popover::new_from_model(Some(&window), &model);
+ 
+-    menu.set_pointing_to(&gtk::Rectangle {
+-        x: position.x.ceil() as i32,
+-        y: position.y.ceil() as i32,
+-        width: position.width.floor() as i32,
+-        height: position.width.floor() as i32,
+-    });
++    menu.set_pointing_to(&gtk::Rectangle::new(
++        position.x.ceil() as i32,
++        position.y.ceil() as i32,
++        position.width.floor() as i32,
++        position.width.floor() as i32,
++    ));
+     menu.set_constrain_to(gtk::PopoverConstraint::None);
+ 
+     let action_group = gio::SimpleActionGroup::new();
+Index: squeekboard-1.22.0/src/style.rs
+===================================================================
+--- squeekboard-1.22.0.orig/src/style.rs
++++ squeekboard-1.22.0/src/style.rs
+@@ -99,7 +99,7 @@ fn get_theme_name(settings: &gtk::Settin
+         }).ok();
+ 
+     #[cfg(feature = "glib_v0_14")]
+-    let prop = |s: &gtk::Settings, name| s.property(name);
++    let prop = |s: &gtk::Settings, name| if s.has_property(name,None) { 
Ok(s.property_value::<>(name)) } else { Err("property does not exist") };
+     #[cfg(not(feature = "glib_v0_14"))]
+     let prop = |s: &gtk::Settings, name| s.get_property(name);
+ 
diff -Nru squeekboard-1.22.0/debian/patches/series 
squeekboard-1.22.0/debian/patches/series
--- squeekboard-1.22.0/debian/patches/series    1970-01-01 00:00:00.000000000 
+0000
+++ squeekboard-1.22.0/debian/patches/series    2023-06-28 18:52:10.000000000 
+0000
@@ -0,0 +1 @@
+rust-gtk-0.16.patch

Reply via email to