summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHans de Graaff <graaff@gentoo.org>2021-08-23 19:31:27 +0200
committerHans de Graaff <graaff@gentoo.org>2021-08-23 19:38:12 +0200
commit1b7900f916ca8ac513c0393a5811d87e724646c8 (patch)
tree43b75a27f44edb9e2c059cd3a60078e900ba3abd /dev-ruby/tty-screen
parentdev-ruby/listen: cleanup (diff)
downloadgentoo-1b7900f916ca8ac513c0393a5811d87e724646c8.tar.gz
gentoo-1b7900f916ca8ac513c0393a5811d87e724646c8.tar.bz2
gentoo-1b7900f916ca8ac513c0393a5811d87e724646c8.zip
dev-ruby/tty-screen: fix ioctl endian test failure
Closes: https://bugs.gentoo.org/808174 Package-Manager: Portage-3.0.20, Repoman-3.0.3 Signed-off-by: Hans de Graaff <graaff@gentoo.org>
Diffstat (limited to 'dev-ruby/tty-screen')
-rw-r--r--dev-ruby/tty-screen/files/tty-screen-0.8.1-ioctl-test.patch55
-rw-r--r--dev-ruby/tty-screen/tty-screen-0.8.1.ebuild2
2 files changed, 57 insertions, 0 deletions
diff --git a/dev-ruby/tty-screen/files/tty-screen-0.8.1-ioctl-test.patch b/dev-ruby/tty-screen/files/tty-screen-0.8.1-ioctl-test.patch
new file mode 100644
index 000000000000..0933f1f611b0
--- /dev/null
+++ b/dev-ruby/tty-screen/files/tty-screen-0.8.1-ioctl-test.patch
@@ -0,0 +1,55 @@
+From dba351b178ae06b56985cc77a291918a0fc4aff4 Mon Sep 17 00:00:00 2001
+From: Piotr Murach <pmurach@gmail.com>
+Date: Mon, 16 Aug 2021 22:13:27 +0200
+Subject: [PATCH] Fix ioctl call test to stub terminal size encoding for
+ big-endian systems
+
+Fixes #13
+---
+ CHANGELOG.md | 6 ++++++
+ spec/unit/screen_spec.rb | 8 +++++++-
+ 2 files changed, 13 insertions(+), 1 deletion(-)
+
+diff --git a/CHANGELOG.md b/CHANGELOG.md
+index 91dd6ab..0f369bd 100644
+--- a/CHANGELOG.md
++++ b/CHANGELOG.md
+@@ -1,5 +1,10 @@
+ # Change log
+
++## [v0.8.2] - unreleased
++
++### Fixed
++* Fix ioctl call test to stub terminal size encoding for big-endian systems
++
+ ## [v0.8.1] - 2020-07-17
+
+ ### Fixed
+@@ -136,6 +141,7 @@
+ ### Fixed
+ * Fix bug with screen detection from_io_console by @luxflux
+
++[v0.8.2]: https://github.com/piotrmurach/tty-screen/compare/v0.8.1...v0.8.2
+ [v0.8.1]: https://github.com/piotrmurach/tty-screen/compare/v0.8.0...v0.8.1
+ [v0.8.0]: https://github.com/piotrmurach/tty-screen/compare/v0.7.1...v0.8.0
+ [v0.7.1]: https://github.com/piotrmurach/tty-screen/compare/v0.7.0...v0.7.1
+diff --git a/spec/unit/screen_spec.rb b/spec/unit/screen_spec.rb
+index 3666a3c..de78ff3 100644
+--- a/spec/unit/screen_spec.rb
++++ b/spec/unit/screen_spec.rb
+@@ -6,8 +6,14 @@ def winsize
+ [100, 200]
+ end
+
++ def big_endian?
++ [1].pack("S") == [1].pack("n")
++ end
++
+ def ioctl(control, buf)
+- buf.replace("3\x00\xD3\x00\xF2\x04\xCA\x02\x00")
++ little_endian = "3\x00\xD3\x00\xF2\x04\xCA\x02\x00"
++ big_endian = "\x003\x00\xD3\x04\xF2\x02\xCA"
++ buf.replace(big_endian? ? big_endian : little_endian)
+ 0
+ end
+ end
diff --git a/dev-ruby/tty-screen/tty-screen-0.8.1.ebuild b/dev-ruby/tty-screen/tty-screen-0.8.1.ebuild
index 7f105f6ddd56..24ccfbc41f77 100644
--- a/dev-ruby/tty-screen/tty-screen-0.8.1.ebuild
+++ b/dev-ruby/tty-screen/tty-screen-0.8.1.ebuild
@@ -23,6 +23,8 @@ SLOT="0"
KEYWORDS="~amd64 ~hppa ~riscv ~sparc"
IUSE=""
+PATCHES=( "${FILESDIR}/${P}-ioctl-test.patch" )
+
all_ruby_prepare() {
echo '-rspec_helper' > .rspec || die
sed -i -e 's:require_relative ":require "./:' ${RUBY_FAKEGEM_GEMSPEC} || die