The package rpms/rust-termwiz.git has added or updated architecture specific content in its spec file (ExclusiveArch/ExcludeArch or %ifarch/%ifnarch) in commit(s): https://src.fedoraproject.org/cgit/rpms/rust-termwiz.git/commit/?id=70cf4b7e....
Change: -ExclusiveArch: %{rust_arches}
Thanks.
Full change: ============
commit 2d05b9ceb2f0c6599e009cce14e153e16335b09a Author: Fabio Valentini decathorpe@gmail.com Date: Tue Jan 31 13:33:20 2023 +0100
Backport upstream patch to fix unsafe cast that caused segfaults
diff --git a/0001-fix-unsafe-cast-that-caused-calls-of-free-with-inval.patch b/0001-fix-unsafe-cast-that-caused-calls-of-free-with-inval.patch new file mode 100644 index 0000000..b750f31 --- /dev/null +++ b/0001-fix-unsafe-cast-that-caused-calls-of-free-with-inval.patch @@ -0,0 +1,26 @@ +From 230336f71b8a7b94d57491dc5bedf9f11034ccac Mon Sep 17 00:00:00 2001 +From: Fabio Valentini decathorpe@gmail.com +Date: Tue, 31 Jan 2023 13:26:31 +0100 +Subject: [PATCH] fix unsafe cast that caused calls of free with invalid + pointers + +--- + src/cell.rs | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/src/cell.rs b/src/cell.rs +index c4262c3..e3c0f29 100644 +--- a/src/cell.rs ++++ b/src/cell.rs +@@ -700,7 +700,7 @@ impl TeenyString { + impl Drop for TeenyString { + fn drop(&mut self) { + if !Self::is_marker_bit_set(self.0) { +- let vec = unsafe { Box::from_raw(self.0 as *mut usize as *mut Vec<u8>) }; ++ let vec = unsafe { Box::from_raw(self.0 as *mut usize as *mut TeenyStringHeap) }; + drop(vec); + } + } +-- +2.39.1 + diff --git a/rust-termwiz.spec b/rust-termwiz.spec index 9d76a68..6cd625f 100644 --- a/rust-termwiz.spec +++ b/rust-termwiz.spec @@ -19,6 +19,8 @@ Patch: termwiz-fix-metadata-auto.diff Patch: termwiz-fix-metadata.diff # Backport of 7b904f05eb4de9ed44d2068355a571b117eba0e1 Patch: termwiz-fixup-32-bit-systems.patch +# Backport of 36519f0d90e1875fb4b3f11f6cbf94c7d716ef78 +Patch: 0001-fix-unsafe-cast-that-caused-calls-of-free-with-inval.patch
BuildRequires: rust-packaging >= 21
commit 904235352e51923260b3517fe0674f46d25cd100 Author: Fedora Release Engineering releng@fedoraproject.org Date: Sat Jan 21 01:45:27 2023 +0000
Rebuilt for https://fedoraproject.org/wiki/Fedora_38_Mass_Rebuild
Signed-off-by: Fedora Release Engineering releng@fedoraproject.org
commit 70cf4b7ec00a31134eaeb4bfb6d3e6bf08707d9d Author: Fabio Valentini decathorpe@gmail.com Date: Fri Nov 4 21:38:52 2022 +0100
Drop unused, benchmark-only criterion dev-dependency
diff --git a/rust-termwiz.spec b/rust-termwiz.spec index 7592d28..9d76a68 100644 --- a/rust-termwiz.spec +++ b/rust-termwiz.spec @@ -1,4 +1,4 @@ -# Generated by rust2rpm 22 +# Generated by rust2rpm 23 %bcond_without check %global debug_package %{nil}
@@ -14,11 +14,12 @@ URL: https://crates.io/crates/termwiz Source: %{crates_source} # Automatically generated patch to strip foreign dependencies Patch: termwiz-fix-metadata-auto.diff +# Manually created patch for downstream crate metadata changes +# * drop unused, benchmark-only criterion dev-dependency to speed up builds +Patch: termwiz-fix-metadata.diff # Backport of 7b904f05eb4de9ed44d2068355a571b117eba0e1 Patch: termwiz-fixup-32-bit-systems.patch
-ExclusiveArch: %{rust_arches} - BuildRequires: rust-packaging >= 21
%global _description %{expand: diff --git a/termwiz-fix-metadata.diff b/termwiz-fix-metadata.diff new file mode 100644 index 0000000..882cd8a --- /dev/null +++ b/termwiz-fix-metadata.diff @@ -0,0 +1,12 @@ +--- termwiz-0.17.1/Cargo.toml 1970-01-01T00:00:01+00:00 ++++ termwiz-0.17.1/Cargo.toml 2022-11-04T20:34:59.081935+00:00 +@@ -147,9 +147,6 @@ + [dependencies.wezterm-dynamic] + version = "0.1" + +-[dev-dependencies.criterion] +-version = "0.3" +- + [dev-dependencies.env_logger] + version = "0.9" +
commit cb216742a3cd8392c60d1c43652d9181922e1214 Author: Davide Cavalca dcavalca@fedoraproject.org Date: Wed Nov 2 21:07:35 2022 -0700
Backport upstream fix for 32 bit systems
diff --git a/rust-termwiz.spec b/rust-termwiz.spec index 1ea8f92..7592d28 100644 --- a/rust-termwiz.spec +++ b/rust-termwiz.spec @@ -14,6 +14,8 @@ URL: https://crates.io/crates/termwiz Source: %{crates_source} # Automatically generated patch to strip foreign dependencies Patch: termwiz-fix-metadata-auto.diff +# Backport of 7b904f05eb4de9ed44d2068355a571b117eba0e1 +Patch: termwiz-fixup-32-bit-systems.patch
ExclusiveArch: %{rust_arches}
diff --git a/termwiz-fixup-32-bit-systems.patch b/termwiz-fixup-32-bit-systems.patch new file mode 100644 index 0000000..1d367a4 --- /dev/null +++ b/termwiz-fixup-32-bit-systems.patch @@ -0,0 +1,521 @@ +diff -Naur a/7b904f05eb4de9ed44d2068355a571b117eba0e1.patch b/7b904f05eb4de9ed44d2068355a571b117eba0e1.patch +--- a/7b904f05eb4de9ed44d2068355a571b117eba0e1.patch 1969-12-31 16:00:00.000000000 -0800 ++++ b/7b904f05eb4de9ed44d2068355a571b117eba0e1.patch 2022-11-02 20:59:51.426109955 -0700 +@@ -0,0 +1,232 @@ ++From 7b904f05eb4de9ed44d2068355a571b117eba0e1 Mon Sep 17 00:00:00 2001 ++From: Wez Furlong wez@wezfurlong.org ++Date: Sat, 15 Oct 2022 16:45:02 -0700 ++Subject: [PATCH] termwiz: fixup for 32-bit systems ++ ++I noticed from https://github.com/void-linux/void-packages/pull/36903 ++that 32-bit systems were failing to pass the test suite. ++ ++Running `cargo test --target i686-unknown-linux-gnu -- --nocapture ++teeny_string` showed that we were faulting in the teenystring code ++and digging a bit deeper showed that it was because our assumptions ++about the high bits were wrong for 32-bit systems. ++ ++Fix this by making TeenyString based around a u64 rather than usize ++so that we guarantee its size on all current systems. ++--- ++ Cargo.lock | 1 - ++ termwiz/Cargo.toml | 1 - ++ termwiz/src/cell.rs | 87 ++++++++++++++------------------------------- ++ 3 files changed, 26 insertions(+), 63 deletions(-) ++ ++diff --git a/Cargo.lock b/Cargo.lock ++index 4f976535be..243e3a2b24 100644 ++--- a/Cargo.lock +++++ b/Cargo.lock ++@@ -4739,7 +4739,6 @@ dependencies = [ ++ "base64", ++ "bitflags", ++ "cassowary", ++- "cfg-if 1.0.0", ++ "criterion", ++ "env_logger", ++ "filedescriptor", ++diff --git a/termwiz/Cargo.toml b/termwiz/Cargo.toml ++index d8d7ab543c..e843bac261 100644 ++--- a/termwiz/Cargo.toml +++++ b/termwiz/Cargo.toml ++@@ -15,7 +15,6 @@ readme = "README.md" ++ base64 = "0.13" ++ bitflags = "1.3" ++ cassowary = {version="0.3", optional=true} ++-cfg-if = "1.0" ++ anyhow = "1.0" ++ filedescriptor = { version="0.8", path = "../filedescriptor" } ++ finl_unicode = "1.1" ++diff --git a/termwiz/src/cell.rs b/termwiz/src/cell.rs ++index ddf38a93bb..70d6099dd0 100644 ++--- a/termwiz/src/cell.rs +++++ b/termwiz/src/cell.rs ++@@ -590,7 +590,7 @@ where ++ s.serialize(serializer) ++ } ++ ++-/// TeenyString encodes string storage in a single machine word. +++/// TeenyString encodes string storage in a single u64. ++ /// The scheme is simple but effective: strings that encode into a ++ /// byte slice that is 1 less byte than the machine word size can ++ /// be encoded directly into the usize bits stored in the struct. ++@@ -603,60 +603,40 @@ where ++ /// calling grapheme_column_width; if it is set, then the TeenyString ++ /// has length 2, otherwise, it has length 1 (we don't allow zero-length ++ /// strings). ++-struct TeenyString(usize); +++struct TeenyString(u64); ++ struct TeenyStringHeap { ++ bytes: Vec<u8>, ++ width: usize, ++ } ++ ++ impl TeenyString { ++- const fn marker_mask() -> usize { +++ const fn marker_mask() -> u64 { ++ if cfg!(target_endian = "little") { ++- cfg_if::cfg_if! { ++- if #[cfg(target_pointer_width = "64")] { ++- 0x80000000_00000000 ++- } else if #[cfg(target_pointer_width = "32")] { ++- 0x80000000 ++- } else if #[cfg(target_pointer_width = "16")] { ++- 0x8000 ++- } else { ++- panic!("unsupported target"); ++- } ++- } +++ 0x80000000_00000000 ++ } else { ++ 0x1 ++ } ++ } ++ ++- const fn double_wide_mask() -> usize { +++ const fn double_wide_mask() -> u64 { ++ if cfg!(target_endian = "little") { ++- cfg_if::cfg_if! { ++- if #[cfg(target_pointer_width = "64")] { ++- 0xc0000000_00000000 ++- } else if #[cfg(target_pointer_width = "32")] { ++- 0xc0000000 ++- } else if #[cfg(target_pointer_width = "16")] { ++- 0xc000 ++- } else { ++- panic!("unsupported target"); ++- } ++- } +++ 0xc0000000_00000000 ++ } else { ++ 0x3 ++ } ++ } ++ ++- const fn is_marker_bit_set(word: usize) -> bool { +++ const fn is_marker_bit_set(word: u64) -> bool { ++ let mask = Self::marker_mask(); ++ word & mask == mask ++ } ++ ++- const fn is_double_width(word: usize) -> bool { +++ const fn is_double_width(word: u64) -> bool { ++ let mask = Self::double_wide_mask(); ++ word & mask == mask ++ } ++ ++- const fn set_marker_bit(word: usize, width: usize) -> usize { +++ const fn set_marker_bit(word: u64, width: usize) -> u64 { ++ if width > 1 { ++ word | Self::double_wide_mask() ++ } else { ++@@ -689,18 +669,18 @@ impl TeenyString { ++ let len = bytes.len(); ++ let width = width.unwrap_or_else(|| grapheme_column_width(s, unicode_version)); ++ ++- if len < std::mem::size_of::<usize>() { +++ if len < std::mem::size_of::<u64>() { ++ debug_assert!(width < 3); ++ ++- let mut word = 0usize; +++ let mut word = 0u64; ++ unsafe { ++ std::ptr::copy_nonoverlapping( ++ bytes.as_ptr(), ++- &mut word as *mut usize as *mut u8, +++ &mut word as *mut u64 as *mut u8, ++ len, ++ ); ++ } ++- let word = Self::set_marker_bit(word, width); +++ let word = Self::set_marker_bit(word as u64, width); ++ Self(word) ++ } else { ++ let vec = Box::new(TeenyStringHeap { ++@@ -708,35 +688,15 @@ impl TeenyString { ++ width, ++ }); ++ let ptr = Box::into_raw(vec); ++- Self(ptr as usize) +++ Self(ptr as u64) ++ } ++ } ++ ++ pub const fn space() -> Self { ++ Self(if cfg!(target_endian = "little") { ++- cfg_if::cfg_if! { ++- if #[cfg(target_pointer_width = "64")] { ++- 0x80000000_00000020 ++- } else if #[cfg(target_pointer_width = "32")] { ++- 0x80000020 ++- } else if #[cfg(target_pointer_width = "16")] { ++- 0x8020 ++- } else { ++- panic!("unsupported target"); ++- } ++- } +++ 0x80000000_00000020 ++ } else { ++- cfg_if::cfg_if! { ++- if #[cfg(target_pointer_width = "64")] { ++- 0x20000000_00000001 ++- } else if #[cfg(target_pointer_width = "32")] { ++- 0x20000001 ++- } else if #[cfg(target_pointer_width = "16")] { ++- 0x2001 ++- } else { ++- panic!("unsupported target"); ++- } ++- } +++ 0x20000000_00000001 ++ }) ++ } ++ ++@@ -753,7 +713,7 @@ impl TeenyString { ++ 1 ++ } ++ } else { ++- let heap = self.0 as *const usize as *const TeenyStringHeap; +++ let heap = self.0 as *const u64 as *const TeenyStringHeap; ++ unsafe { (*heap).width } ++ } ++ } ++@@ -766,17 +726,17 @@ impl TeenyString { ++ ++ pub fn as_bytes(&self) -> &[u8] { ++ if Self::is_marker_bit_set(self.0) { ++- let bytes = &self.0 as *const usize as *const u8; +++ let bytes = &self.0 as *const u64 as *const u8; ++ let bytes = ++- unsafe { std::slice::from_raw_parts(bytes, std::mem::size_of::<usize>() - 1) }; +++ unsafe { std::slice::from_raw_parts(bytes, std::mem::size_of::<u64>() - 1) }; ++ let len = bytes ++ .iter() ++ .position(|&b| b == 0) ++- .unwrap_or(std::mem::size_of::<usize>() - 1); +++ .unwrap_or(std::mem::size_of::<u64>() - 1); ++ ++ &bytes[0..len] ++ } else { ++- let heap = self.0 as *const usize as *const TeenyStringHeap; +++ let heap = self.0 as *const u64 as *const TeenyStringHeap; ++ unsafe { (*heap).bytes.as_slice() } ++ } ++ } ++@@ -1072,6 +1032,11 @@ mod test { ++ ++ #[test] ++ fn teeny_string() { +++ assert!( +++ std::mem::size_of::<usize>() <= std::mem::size_of::<u64>(), +++ "if a pointer doesn't fit in u64 then we need to change TeenyString" +++ ); +++ ++ let s = TeenyString::from_char('a'); ++ assert_eq!(s.as_bytes(), &[b'a']); ++ +diff -Naur a/Cargo.toml.orig b/Cargo.toml.orig +--- a/Cargo.toml.orig 1973-11-29 13:33:09.000000000 -0800 ++++ b/Cargo.toml.orig 1969-12-31 16:00:00.000000000 -0800 +@@ -1,95 +0,0 @@ +-[package] +-authors = ["Wez Furlong"] +-name = "termwiz" +-version = "0.17.1" +-edition = "2018" +-repository = "https://github.com/wez/wezterm" +-description = "Terminal Wizardry for Unix and Windows" +-license = "MIT" +-documentation = "https://docs.rs/termwiz" +-keywords = ["terminal", "readline", "console", "curses"] +-readme = "README.md" +- +-[dependencies] +-# backtrace = "0.3" +-base64 = "0.13" +-bitflags = "1.3" +-cassowary = {version="0.3", optional=true} +-cfg-if = "1.0" +-anyhow = "1.0" +-filedescriptor = { version="0.8", path = "../filedescriptor" } +-fixedbitset = "0.4" +-fnv = {version="1.0", optional=true} +-hex = "0.4" +-image = {version="0.24", optional=true} +-lazy_static = "1.4" +-libc = "0.2" +-log = "0.4" +-memmem = "0.1" +-num-traits = "0.2" +-ordered-float = "3.0" +-pest = "2.1" +-pest_derive = "2.1" +-phf = "0.10" +-regex = "1" +-semver = "0.11" +-serde = {version="1.0", features = ["rc", "derive"], optional=true} +-sha2 = "0.9" +-terminfo = "0.7" +-thiserror = "1.0" +-unicode-segmentation = "1.8" +-ucd-trie = "0.1" +-vtparse = { version="0.6.2", path="../vtparse" } +-wezterm-bidi = { path = "../bidi", version="0.2" } +-wezterm-color-types = { path = "../color-types", version="0.2" } +-wezterm-dynamic = { path = "../wezterm-dynamic", version="0.1" } +- +-[features] +-widgets = ["cassowary", "fnv"] +-use_serde = ["serde", "wezterm-color-types/use_serde"] +-use_image = ["image"] +-docs = ["widgets", "use_serde"] +- +-[dev-dependencies] +-criterion = "0.3" +-varbincode = "0.1" +-k9 = "0.11" +-env_logger = "0.9" +- +-[dependencies.num-derive] +-features = ["full-syntax"] +-version = "0.3" +- +-[target."cfg(unix)".dependencies] +-signal-hook = "0.1" +-termios = "0.3" +-nix = "0.24" +- +-[target."cfg(windows)".dependencies.winapi] +-features = [ +- "winbase", +- "winerror", +- "winnls", +- "winuser", +- "consoleapi", +- "handleapi", +- "fileapi", +- "synchapi", +- "memoryapi", +- "winnt", +- "impl-default" +-] +-version = "0.3.9" +- +-[package.metadata.docs.rs] +-features = ["docs"] +-rustdoc-args = ["--cfg", "feature="docs""] +- +-[[bench]] +-name = "wcwidth" +-harness = false +- +-[[bench]] +-name = "cell" +-harness = false +- +diff -Naur a/src/cell.rs b/src/cell.rs +--- a/src/cell.rs 1973-11-29 13:33:09.000000000 -0800 ++++ b/src/cell.rs 2022-11-02 21:00:12.445329589 -0700 +@@ -505,7 +505,7 @@ + s.serialize(serializer) + } + +-/// TeenyString encodes string storage in a single machine word. ++/// TeenyString encodes string storage in a single u64. + /// The scheme is simple but effective: strings that encode into a + /// byte slice that is 1 less byte than the machine word size can + /// be encoded directly into the usize bits stored in the struct. +@@ -518,60 +518,40 @@ + /// calling grapheme_column_width; if it is set, then the TeenyString + /// has length 2, otherwise, it has length 1 (we don't allow zero-length + /// strings). +-struct TeenyString(usize); ++struct TeenyString(u64); + struct TeenyStringHeap { + bytes: Vec<u8>, + width: usize, + } + + impl TeenyString { +- const fn marker_mask() -> usize { ++ const fn marker_mask() -> u64 { + if cfg!(target_endian = "little") { +- cfg_if::cfg_if! { +- if #[cfg(target_pointer_width = "64")] { +- 0x80000000_00000000 +- } else if #[cfg(target_pointer_width = "32")] { +- 0x80000000 +- } else if #[cfg(target_pointer_width = "16")] { +- 0x8000 +- } else { +- panic!("unsupported target"); +- } +- } ++ 0x80000000_00000000 + } else { + 0x1 + } + } + +- const fn double_wide_mask() -> usize { ++ const fn double_wide_mask() -> u64 { + if cfg!(target_endian = "little") { +- cfg_if::cfg_if! { +- if #[cfg(target_pointer_width = "64")] { +- 0xc0000000_00000000 +- } else if #[cfg(target_pointer_width = "32")] { +- 0xc0000000 +- } else if #[cfg(target_pointer_width = "16")] { +- 0xc000 +- } else { +- panic!("unsupported target"); +- } +- } ++ 0xc0000000_00000000 + } else { + 0x3 + } + } + +- const fn is_marker_bit_set(word: usize) -> bool { ++ const fn is_marker_bit_set(word: u64) -> bool { + let mask = Self::marker_mask(); + word & mask == mask + } + +- const fn is_double_width(word: usize) -> bool { ++ const fn is_double_width(word: u64) -> bool { + let mask = Self::double_wide_mask(); + word & mask == mask + } + +- const fn set_marker_bit(word: usize, width: usize) -> usize { ++ const fn set_marker_bit(word: u64, width: usize) -> u64 { + if width > 1 { + word | Self::double_wide_mask() + } else { +@@ -604,18 +584,18 @@ + let len = bytes.len(); + let width = width.unwrap_or_else(|| grapheme_column_width(s, unicode_version)); + +- if len < std::mem::size_of::<usize>() { ++ if len < std::mem::size_of::<u64>() { + debug_assert!(width < 3); + +- let mut word = 0usize; ++ let mut word = 0u64; + unsafe { + std::ptr::copy_nonoverlapping( + bytes.as_ptr(), +- &mut word as *mut usize as *mut u8, ++ &mut word as *mut u64 as *mut u8, + len, + ); + } +- let word = Self::set_marker_bit(word, width); ++ let word = Self::set_marker_bit(word as u64, width); + Self(word) + } else { + let vec = Box::new(TeenyStringHeap { +@@ -623,35 +603,15 @@ + width, + }); + let ptr = Box::into_raw(vec); +- Self(ptr as usize) ++ Self(ptr as u64) + } + } + + pub const fn space() -> Self { + Self(if cfg!(target_endian = "little") { +- cfg_if::cfg_if! { +- if #[cfg(target_pointer_width = "64")] { +- 0x80000000_00000020 +- } else if #[cfg(target_pointer_width = "32")] { +- 0x80000020 +- } else if #[cfg(target_pointer_width = "16")] { +- 0x8020 +- } else { +- panic!("unsupported target"); +- } +- } ++ 0x80000000_00000020 + } else { +- cfg_if::cfg_if! { +- if #[cfg(target_pointer_width = "64")] { +- 0x20000000_00000001 +- } else if #[cfg(target_pointer_width = "32")] { +- 0x20000001 +- } else if #[cfg(target_pointer_width = "16")] { +- 0x2001 +- } else { +- panic!("unsupported target"); +- } +- } ++ 0x20000000_00000001 + }) + } + +@@ -668,7 +628,7 @@ + 1 + } + } else { +- let heap = self.0 as *const usize as *const TeenyStringHeap; ++ let heap = self.0 as *const u64 as *const TeenyStringHeap; + unsafe { (*heap).width } + } + } +@@ -681,17 +641,17 @@ + + pub fn as_bytes(&self) -> &[u8] { + if Self::is_marker_bit_set(self.0) { +- let bytes = &self.0 as *const usize as *const u8; ++ let bytes = &self.0 as *const u64 as *const u8; + let bytes = +- unsafe { std::slice::from_raw_parts(bytes, std::mem::size_of::<usize>() - 1) }; ++ unsafe { std::slice::from_raw_parts(bytes, std::mem::size_of::<u64>() - 1) }; + let len = bytes + .iter() + .position(|&b| b == 0) +- .unwrap_or(std::mem::size_of::<usize>() - 1); ++ .unwrap_or(std::mem::size_of::<u64>() - 1); + + &bytes[0..len] + } else { +- let heap = self.0 as *const usize as *const TeenyStringHeap; ++ let heap = self.0 as *const u64 as *const TeenyStringHeap; + unsafe { (*heap).bytes.as_slice() } + } + } +@@ -989,6 +949,11 @@ + + #[test] + fn teeny_string() { ++ assert!( ++ std::mem::size_of::<usize>() <= std::mem::size_of::<u64>(), ++ "if a pointer doesn't fit in u64 then we need to change TeenyString" ++ ); ++ + let s = TeenyString::from_char('a'); + assert_eq!(s.as_bytes(), &[b'a']); +
commit a9a2ca4a248941acf5188fda5b1656bac3bbf13b Author: Davide Cavalca dcavalca@fedoraproject.org Date: Thu Sep 1 21:48:15 2022 -0700
Update to 0.17.1
diff --git a/.gitignore b/.gitignore index f6eab66..b85a64e 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ /termwiz-0.13.0.crate /termwiz-0.15.0.crate /termwiz-0.16.0.crate +/termwiz-0.17.1.crate diff --git a/rust-termwiz.spec b/rust-termwiz.spec index 1225ae3..1ea8f92 100644 --- a/rust-termwiz.spec +++ b/rust-termwiz.spec @@ -1,21 +1,19 @@ -# Generated by rust2rpm 21 +# Generated by rust2rpm 22 %bcond_without check %global debug_package %{nil}
%global crate termwiz
-Name: rust-%{crate} -Version: 0.16.0 +Name: rust-termwiz +Version: 0.17.1 Release: %autorelease Summary: Terminal Wizardry for Unix and Windows
-# Upstream license specification: MIT License: MIT URL: https://crates.io/crates/termwiz Source: %{crates_source} -# Initial patched metadata -# * Drop Windows dependencies -Patch0: termwiz-fix-metadata.diff +# Automatically generated patch to strip foreign dependencies +Patch: termwiz-fix-metadata-auto.diff
ExclusiveArch: %{rust_arches}
diff --git a/sources b/sources index 8909f7b..1c3864b 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (termwiz-0.16.0.crate) = 5d73db2fb356b454502a6bcb9d81cda33f271f2df7a48f4263564977d13f4661acfcea92b96821badf83e1d99546ab2b1de151ba9a4af86f14d8fae943a88680 +SHA512 (termwiz-0.17.1.crate) = 2b863c2f21174551e5defa8dc87df1dfd2c9710d6e2a4d4451fa8ac252be35a6124567d6a4f3b4213a4601d5c204765c25e9c8ca5b06ee03523ef56a9b90d221 diff --git a/termwiz-fix-metadata-auto.diff b/termwiz-fix-metadata-auto.diff new file mode 100644 index 0000000..0ac31fb --- /dev/null +++ b/termwiz-fix-metadata-auto.diff @@ -0,0 +1,21 @@ +--- termwiz-0.17.1/Cargo.toml 1970-01-01T00:00:01+00:00 ++++ termwiz-0.17.1/Cargo.toml 1970-01-01T00:00:01+00:00 +@@ -183,18 +183,3 @@ + [target."cfg(unix)".dependencies.termios] + version = "0.3" + +-[target."cfg(windows)".dependencies.winapi] +-version = "0.3.9" +-features = [ +- "winbase", +- "winerror", +- "winnls", +- "winuser", +- "consoleapi", +- "handleapi", +- "fileapi", +- "synchapi", +- "memoryapi", +- "winnt", +- "impl-default", +-] diff --git a/termwiz-fix-metadata.diff b/termwiz-fix-metadata.diff deleted file mode 100644 index 04e2f42..0000000 --- a/termwiz-fix-metadata.diff +++ /dev/null @@ -1,9 +0,0 @@ ---- termwiz-0.16.0/Cargo.toml 1970-01-01T00:00:01+00:00 -+++ termwiz-0.16.0/Cargo.toml 2022-07-10T21:59:40.403926+00:00 -@@ -138,6 +138,3 @@ - - [target."cfg(unix)".dependencies.termios] - version = "0.3" --[target."cfg(windows)".dependencies.winapi] --version = "0.3" --features = ["winbase", "winerror", "winnls", "winuser", "consoleapi", "handleapi", "fileapi", "synchapi", "memoryapi", "winnt"]
commit fe022112fb029570575b8b8ca2fe10dbe97e6e90 Author: Davide Cavalca dcavalca@fedoraproject.org Date: Sun Jul 10 15:00:45 2022 -0700
Update to 0.16
diff --git a/.gitignore b/.gitignore index 9c53976..f6eab66 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,3 @@ /termwiz-0.13.0.crate /termwiz-0.15.0.crate +/termwiz-0.16.0.crate diff --git a/rust-termwiz.spec b/rust-termwiz.spec index 46e1cf5..1225ae3 100644 --- a/rust-termwiz.spec +++ b/rust-termwiz.spec @@ -1,11 +1,11 @@ -# Generated by rust2rpm 20 +# Generated by rust2rpm 21 %bcond_without check %global debug_package %{nil}
%global crate termwiz
Name: rust-%{crate} -Version: 0.15.0 +Version: 0.16.0 Release: %autorelease Summary: Terminal Wizardry for Unix and Windows
@@ -19,7 +19,7 @@ Patch0: termwiz-fix-metadata.diff
ExclusiveArch: %{rust_arches}
-BuildRequires: rust-packaging +BuildRequires: rust-packaging >= 21
%global _description %{expand: Terminal Wizardry for Unix and Windows.} @@ -36,9 +36,9 @@ This package contains library source intended for building other packages which use the "%{crate}" crate.
%files devel -%license LICENSE.md -%doc examples README.md -%{cargo_registry}/%{crate}-%{version_no_tilde}/ +%license %{crate_instdir}/LICENSE.md +%doc %{crate_instdir}/README.md +%{crate_instdir}/
%package -n %{name}+default-devel Summary: %{summary} @@ -50,7 +50,7 @@ This package contains library source intended for building other packages which use the "default" feature of the "%{crate}" crate.
%files -n %{name}+default-devel -%ghost %{cargo_registry}/%{crate}-%{version_no_tilde}/Cargo.toml +%ghost %{crate_instdir}/Cargo.toml
%package -n %{name}+cassowary-devel Summary: %{summary} @@ -62,7 +62,7 @@ This package contains library source intended for building other packages which use the "cassowary" feature of the "%{crate}" crate.
%files -n %{name}+cassowary-devel -%ghost %{cargo_registry}/%{crate}-%{version_no_tilde}/Cargo.toml +%ghost %{crate_instdir}/Cargo.toml
%package -n %{name}+docs-devel Summary: %{summary} @@ -74,7 +74,7 @@ This package contains library source intended for building other packages which use the "docs" feature of the "%{crate}" crate.
%files -n %{name}+docs-devel -%ghost %{cargo_registry}/%{crate}-%{version_no_tilde}/Cargo.toml +%ghost %{crate_instdir}/Cargo.toml
%package -n %{name}+fnv-devel Summary: %{summary} @@ -86,7 +86,7 @@ This package contains library source intended for building other packages which use the "fnv" feature of the "%{crate}" crate.
%files -n %{name}+fnv-devel -%ghost %{cargo_registry}/%{crate}-%{version_no_tilde}/Cargo.toml +%ghost %{crate_instdir}/Cargo.toml
%package -n %{name}+image-devel Summary: %{summary} @@ -98,7 +98,7 @@ This package contains library source intended for building other packages which use the "image" feature of the "%{crate}" crate.
%files -n %{name}+image-devel -%ghost %{cargo_registry}/%{crate}-%{version_no_tilde}/Cargo.toml +%ghost %{crate_instdir}/Cargo.toml
%package -n %{name}+serde-devel Summary: %{summary} @@ -110,7 +110,7 @@ This package contains library source intended for building other packages which use the "serde" feature of the "%{crate}" crate.
%files -n %{name}+serde-devel -%ghost %{cargo_registry}/%{crate}-%{version_no_tilde}/Cargo.toml +%ghost %{crate_instdir}/Cargo.toml
%package -n %{name}+use_image-devel Summary: %{summary} @@ -122,7 +122,7 @@ This package contains library source intended for building other packages which use the "use_image" feature of the "%{crate}" crate.
%files -n %{name}+use_image-devel -%ghost %{cargo_registry}/%{crate}-%{version_no_tilde}/Cargo.toml +%ghost %{crate_instdir}/Cargo.toml
%package -n %{name}+use_serde-devel Summary: %{summary} @@ -134,7 +134,7 @@ This package contains library source intended for building other packages which use the "use_serde" feature of the "%{crate}" crate.
%files -n %{name}+use_serde-devel -%ghost %{cargo_registry}/%{crate}-%{version_no_tilde}/Cargo.toml +%ghost %{crate_instdir}/Cargo.toml
%package -n %{name}+widgets-devel Summary: %{summary} @@ -146,7 +146,7 @@ This package contains library source intended for building other packages which use the "widgets" feature of the "%{crate}" crate.
%files -n %{name}+widgets-devel -%ghost %{cargo_registry}/%{crate}-%{version_no_tilde}/Cargo.toml +%ghost %{crate_instdir}/Cargo.toml
%prep %autosetup -n %{crate}-%{version_no_tilde} -p1 diff --git a/sources b/sources index eac9173..8909f7b 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (termwiz-0.15.0.crate) = aba6349089143efaef27548bdb110ca89209bdfc4281994c2033d583b6c4cf8693c0815d1bccd85e1dc119711ebc2183e97bd85b978e787be4db9ebaa4614176 +SHA512 (termwiz-0.16.0.crate) = 5d73db2fb356b454502a6bcb9d81cda33f271f2df7a48f4263564977d13f4661acfcea92b96821badf83e1d99546ab2b1de151ba9a4af86f14d8fae943a88680 diff --git a/termwiz-fix-metadata.diff b/termwiz-fix-metadata.diff index 4e50558..04e2f42 100644 --- a/termwiz-fix-metadata.diff +++ b/termwiz-fix-metadata.diff @@ -1,9 +1,9 @@ ---- termwiz-0.15.0/Cargo.toml 1970-01-01T00:00:01+00:00 -+++ termwiz-0.15.0/Cargo.toml 2022-01-28T16:26:11.007656+00:00 -@@ -120,6 +120,3 @@ +--- termwiz-0.16.0/Cargo.toml 1970-01-01T00:00:01+00:00 ++++ termwiz-0.16.0/Cargo.toml 2022-07-10T21:59:40.403926+00:00 +@@ -138,6 +138,3 @@
[target."cfg(unix)".dependencies.termios] version = "0.3" -[target."cfg(windows)".dependencies.winapi] -version = "0.3" --features = ["winbase", "winerror", "winnls", "winuser", "consoleapi", "handleapi", "fileapi", "synchapi"] +-features = ["winbase", "winerror", "winnls", "winuser", "consoleapi", "handleapi", "fileapi", "synchapi", "memoryapi", "winnt"]
arch-excludes@lists.fedoraproject.org