From c308c7ac5b6ecb24dc47becc8d0fd5eafa5e2a9f Mon Sep 17 00:00:00 2001 From: Fabio Valentini Date: Thu, 29 Aug 2024 16:36:07 +0200 Subject: [PATCH] Bump rustix dependency from 0.37 to 0.38 --- 0001-Port-from-rustix-0.37-to-0.38.patch | 25 ++++++++++++++++++++++++ rust-terminal_size0.2.spec | 14 ++++++++----- rust2rpm.toml | 9 +++++++++ terminal_size-fix-metadata-auto.diff | 2 +- terminal_size-fix-metadata.diff | 11 +++++++++++ 5 files changed, 55 insertions(+), 6 deletions(-) create mode 100644 0001-Port-from-rustix-0.37-to-0.38.patch create mode 100644 rust2rpm.toml create mode 100644 terminal_size-fix-metadata.diff diff --git a/0001-Port-from-rustix-0.37-to-0.38.patch b/0001-Port-from-rustix-0.37-to-0.38.patch new file mode 100644 index 0000000..6ec057c --- /dev/null +++ b/0001-Port-from-rustix-0.37-to-0.38.patch @@ -0,0 +1,25 @@ +From a47cd6fd89e913310bdca752ca6a69f53c140747 Mon Sep 17 00:00:00 2001 +From: Fabio Valentini +Date: Thu, 29 Aug 2024 16:21:45 +0200 +Subject: [PATCH] Port from rustix 0.37 to 0.38 + +--- + src/unix.rs | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/src/unix.rs b/src/unix.rs +index 59af979..0a3de13 100644 +--- a/src/unix.rs ++++ b/src/unix.rs +@@ -6,7 +6,7 @@ use rustix::fd::BorrowedFd; + /// + /// If STDOUT is not a tty, returns `None` + pub fn terminal_size() -> Option<(Width, Height)> { +- terminal_size_using_fd(rustix::io::raw_stdout()) ++ terminal_size_using_fd(rustix::stdio::raw_stdout()) + } + + /// Returns the size of the terminal using the given file descriptor, if available. +-- +2.46.0 + diff --git a/rust-terminal_size0.2.spec b/rust-terminal_size0.2.spec index 62e552f..8207ab3 100644 --- a/rust-terminal_size0.2.spec +++ b/rust-terminal_size0.2.spec @@ -1,4 +1,4 @@ -# Generated by rust2rpm 24 +# Generated by rust2rpm 26 %bcond_without check %global debug_package %{nil} @@ -12,10 +12,14 @@ Summary: Gets the size of your Linux or Windows terminal License: MIT OR Apache-2.0 URL: https://crates.io/crates/terminal_size Source: %{crates_source} -# Automatically generated patch to strip foreign dependencies +# Automatically generated patch to strip dependencies and normalize metadata Patch: terminal_size-fix-metadata-auto.diff +# Manually created patch for downstream crate metadata changes +# * bump rustix dependency from 0.37 to 0.38 +Patch: terminal_size-fix-metadata.diff +Patch: 0001-Port-from-rustix-0.37-to-0.38.patch -BuildRequires: rust-packaging >= 21 +BuildRequires: cargo-rpm-macros >= 24 %global _description %{expand: Gets the size of your Linux or Windows terminal.} @@ -50,7 +54,7 @@ use the "default" feature of the "%{crate}" crate. %ghost %{crate_instdir}/Cargo.toml %prep -%autosetup -n %{crate}-%{version_no_tilde} -p1 +%autosetup -n %{crate}-%{version} -p1 %cargo_prep %generate_buildrequires @@ -64,7 +68,7 @@ use the "default" feature of the "%{crate}" crate. %if %{with check} %check -# skip tests that don't work without a TTY +# * skip tests that don't work without a TTY %cargo_test -- -- --skip unix::compare_with_stty %endif diff --git a/rust2rpm.toml b/rust2rpm.toml new file mode 100644 index 0000000..88d8d33 --- /dev/null +++ b/rust2rpm.toml @@ -0,0 +1,9 @@ +[package] +cargo-toml-patch-comments = [ + "bump rustix dependency from 0.37 to 0.38", +] + +[tests] +skip = ["unix::compare_with_stty"] +comments = ["skip tests that don't work without a TTY"] + diff --git a/terminal_size-fix-metadata-auto.diff b/terminal_size-fix-metadata-auto.diff index 0c56a10..eb13059 100644 --- a/terminal_size-fix-metadata-auto.diff +++ b/terminal_size-fix-metadata-auto.diff @@ -1,5 +1,5 @@ --- terminal_size-0.2.6/Cargo.toml 1970-01-01T00:00:01+00:00 -+++ terminal_size-0.2.6/Cargo.toml 2023-09-20T09:58:34.443659+00:00 ++++ terminal_size-0.2.6/Cargo.toml 2024-08-29T14:23:13.991642+00:00 @@ -31,9 +31,3 @@ version = "0.37.0" features = ["termios"] diff --git a/terminal_size-fix-metadata.diff b/terminal_size-fix-metadata.diff new file mode 100644 index 0000000..bd7861a --- /dev/null +++ b/terminal_size-fix-metadata.diff @@ -0,0 +1,11 @@ +--- terminal_size-0.2.6/Cargo.toml 1970-01-01T00:00:01+00:00 ++++ terminal_size-0.2.6/Cargo.toml 2024-08-29T14:23:25.182709+00:00 +@@ -28,6 +28,6 @@ + repository = "https://github.com/eminence/terminal-size" + + [target."cfg(not(windows))".dependencies.rustix] +-version = "0.37.0" +-features = ["termios"] ++version = "0.38.0" ++features = ["stdio", "termios"] +