[PATCH 27/94] app-misc/screen: fix Hurd build (PATH_MAX)

Sam James <[email protected]>
Newsgroups gmane.linux.gentoo.devel
Message-ID <63af9f5c717b100fccc80f259df495f4d651b3ec.1774994303.git.sam@gentoo.org>
Signed-off-by: Sam James <[email protected]>
---
 .../files/screen-4.9.1-hurd-path-max.patch    | 41 +++++++++++++++++++
 app-misc/screen/screen-4.9.1-r2.ebuild        |  3 +-
 2 files changed, 43 insertions(+), 1 deletion(-)
 create mode 100644 app-misc/screen/files/screen-4.9.1-hurd-path-max.patch

diff --git a/app-misc/screen/files/screen-4.9.1-hurd-path-max.patch b/app-misc/screen/files/screen-4.9.1-hurd-path-max.patch
new file mode 100644
index 0000000000000..46aa8a4abd2f8
--- /dev/null
+++ b/app-misc/screen/files/screen-4.9.1-hurd-path-max.patch
@@ -0,0 +1,41 @@
+https://salsa.debian.org/debian/screen/-/raw/master/debian/patches/61-default-PATH_MAX-if-undefined-for-hurd.patch?ref_type=heads
+
+Description: Set PATH_MAX to 4096 if undefined
+ Fixes FTBFS since 4.4.0 on GNU/Hurd. Updated to add one more occurrence for 4.5.0.
+Author: Axel Beckert <[email protected]>
+Bug: https://savannah.gnu.org/bugs/?50089
+Last-Updated: 2017-01-18
+
+--- a/tty.sh
++++ b/tty.sh
+@@ -1526,6 +1526,13 @@
+   return 0;
+ }
+ 
++/*
++ * Define PATH_MAX to 4096 if it's not defined, like on GNU/Hurd
++ */
++
++#ifndef PATH_MAX
++#define PATH_MAX 4096
++#endif
+ 
+ int CheckTtyname (char *tty)
+ {
+--- a/screen.h
++++ b/screen.h
+@@ -109,6 +109,13 @@
+ # define DEFAULT_BUFFERFILE	"/tmp/screen-exchange"
+ #endif
+ 
++/*
++ * Define PATH_MAX to 4096 if it's not defined, like on GNU/Hurd
++ */
++
++#ifndef PATH_MAX
++#define PATH_MAX 4096
++#endif
+ 
+ #if defined(hpux) && !(defined(VSUSP) && defined(VDSUSP) && defined(VWERASE) && defined(VLNEXT))
+ # define HPUX_LTCHARS_HACK
+
diff --git a/app-misc/screen/screen-4.9.1-r2.ebuild b/app-misc/screen/screen-4.9.1-r2.ebuild
index e02c57aef6577..03863382bdcc1 100644
--- a/app-misc/screen/screen-4.9.1-r2.ebuild
+++ b/app-misc/screen/screen-4.9.1-r2.ebuild
@@ -1,4 +1,4 @@
-# Copyright 1999-2025 Gentoo Authors
+# Copyright 1999-2026 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
 EAPI=8
@@ -38,6 +38,7 @@ PATCHES=(
 	"${FILESDIR}"/${PN}-4.9.1-fix_CVE-2025-46802.patch
 	"${FILESDIR}"/${PN}-4.9.1-fix_CVE-2025-46804.patch
 	"${FILESDIR}"/${PN}-4.9.1-fix_CVE-2025-46805.patch
+	"${FILESDIR}"/${PN}-4.9.1-hurd-path-max.patch
 )
 
 src_prepare() {
-- 
2.53.0
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.