From a479260bd0a0c92773b7448a146a7bbe8bdbe74e Mon Sep 17 00:00:00 2001
From: Zach van Rijn <me@zv.io>
Date: Wed, 8 Feb 2023 19:50:02 +0000
Subject: system/libuv: add patch for nonsense test assumption. fixes #695.

---
 system/libuv/APKBUILD                        |  7 +++++--
 system/libuv/fix-test-terminal-illness.patch | 27 +++++++++++++++++++++++++++
 2 files changed, 32 insertions(+), 2 deletions(-)
 create mode 100644 system/libuv/fix-test-terminal-illness.patch

(limited to 'system')

diff --git a/system/libuv/APKBUILD b/system/libuv/APKBUILD
index be514a5a4..89323e26b 100644
--- a/system/libuv/APKBUILD
+++ b/system/libuv/APKBUILD
@@ -10,7 +10,9 @@ arch="all"
 license="MIT AND BSD-2-Clause AND BSD-3-Clause AND ISC"
 makedepends="automake autoconf libtool linux-headers"
 subpackages="$pkgname-dev"
-source="https://dist.libuv.org/dist/v$pkgver/$pkgname-v$pkgver.tar.gz"
+source="https://dist.libuv.org/dist/v$pkgver/$pkgname-v$pkgver.tar.gz
+	fix-test-terminal-illness.patch
+	"
 builddir="$srcdir/$pkgname-v$pkgver"
 
 prepare() {
@@ -39,4 +41,5 @@ package() {
 		"$pkgdir"/usr/share/licenses/$pkgname/LICENSE
 }
 
-sha512sums="b4f8944e2c79e3a6a31ded6cccbe4c0eeada50db6bc8a448d7015642795012a4b80ffeef7ca455bb093c59a8950d0e1430566c3c2fa87b73f82699098162d834  libuv-v1.44.1.tar.gz"
+sha512sums="b4f8944e2c79e3a6a31ded6cccbe4c0eeada50db6bc8a448d7015642795012a4b80ffeef7ca455bb093c59a8950d0e1430566c3c2fa87b73f82699098162d834  libuv-v1.44.1.tar.gz
+46e861417f17a6a423b0d89204d74668c44e96666b69726064799f86b5db2436cfe749619af4c4e1baee8154780738c1eb8892c2a5187f7f46f3c54192b6d749  fix-test-terminal-illness.patch"
diff --git a/system/libuv/fix-test-terminal-illness.patch b/system/libuv/fix-test-terminal-illness.patch
new file mode 100644
index 000000000..85efd77d9
--- /dev/null
+++ b/system/libuv/fix-test-terminal-illness.patch
@@ -0,0 +1,27 @@
+This patch addresses the following issue:
+
+    https://git.adelielinux.org/adelie/packages/-/issues/695
+
+I've run into this enough times to justify this patch, waking
+up in the morning to find that my overnight builds failed, or
+during manual testing on laptops with smaller displays that
+have a reduce line count when I connect to tmux.
+
+I don't think width is an issue, but saying "you must be 10
+columns or higher to ride" is arbitrarily restrictive.
+
+--- a/test/test-tty.c
++++ b/test/test-tty.c
+@@ -118,10 +118,10 @@
+ 
+   /*
+    * Is it a safe assumption that most people have terminals larger than
+-   * 10x10?
++   * 10x10? -- No; you know what they say about assumptions.
+    */
+   ASSERT(width > 10);
+-  ASSERT(height > 10);
++  ASSERT(height > 3);
+ 
+   /* Turn on raw mode. */
+   r = uv_tty_set_mode(&tty_in, UV_TTY_MODE_RAW);
-- 
cgit v1.2.3-70-g09d2