guix_mirror_bot pushed a commit to branch master
in repository guix.

commit 3630cf246f4112169700f408f37541d5f1bd12bc
Author: Nigko Yerden <[email protected]>
AuthorDate: Sun Sep 6 13:27:19 2026 +0500

    gnu: rogue: Fix build on Hurd.
    
    While we do not have 'PATH_MAX' macro defined on GNU Hurd, on Linux
    'PATH_MAX' is defined in </linux/limits.h> to be 4096.
    Define PATH_MAX here to the same value as a workaround.
    Still, this is not good, see
    
<https://www.gnu.org/software/hurd/hurd/porting/guidelines.html#PATH_MAX_tt_MAX_PATH_tt_MAXPATHL>.
    
    * gnu/packages/games.scm (rogue)[source]{origin}: Add snippet to adjust
    source code to the new version of ncurses.
    [arguments]{#:make-flags}: Remove.
    {#:configure-flags}: Add “CPPFLAGS=-DPATH_MAX=4096” on Hurd.
    
    Signed-off-by: Liliana Marie Prikler <[email protected]>
---
 gnu/packages/games.scm | 23 ++++++++++++++++++++---
 1 file changed, 20 insertions(+), 3 deletions(-)

diff --git a/gnu/packages/games.scm b/gnu/packages/games.scm
index 1cdc071fab6..bb2484a1981 100644
--- a/gnu/packages/games.scm
+++ b/gnu/packages/games.scm
@@ -1228,11 +1228,28 @@ Quizzes: arithmetic and quiz.")
               (file-name (git-file-name name version))
               (sha256
                (base32
-                "0mk03l120scas4dcn6xccnhslnwmcx2blshbf925z06yk7rkzias"))))
+                "0mk03l120scas4dcn6xccnhslnwmcx2blshbf925z06yk7rkzias"))
+              (modules '((guix build utils)))
+              (snippet
+               #~(begin
+                   ;; erasechar and killchar functions are now in libtinfo
+                   (substitute* "configure"
+                     (("-lncurses" all) (string-append all " -ltinfo")))
+                   ;; Do not access fields of the opaque type WINDOW
+                   (substitute* "main.c"
+                     (("curscr->_cury = oy;" _) "")
+                     (("curscr->_curx = ox;" _) "move(oy, ox);"))
+                   ;; Choose branch with no accesses to the fields
+                   ;; of the opaque type TERMINAL
+                   (substitute* "mdport.c"
+                     (("^#ifdef NCURSES_VERSION" _) "#if 0"))))))
     (build-system gnu-build-system)
     (arguments
-     `(#:tests? #f
-       #:make-flags (list "CFLAGS=-DNCURSES_INTERNALS")))
+     (list #:tests? #f
+           #:configure-flags
+           (if (target-hurd?)
+               #~(list "CPPFLAGS=-DPATH_MAX=4096")
+               #~(list))))
     (inputs (list ncurses))
     (synopsis "Original rogue game")
     (description

Reply via email to