gnu: nvi: Fix build with glibc 2.30.

* gnu/packages/nvi.scm (nvi)[source](modules): New field.
[source](snippet): Add substitution to prevent including code that relies on
obsolete glibc functions.
This commit is contained in:
Marius Bakke 2020-01-23 23:28:57 +01:00
parent 1de804da52
commit 3440fecd4e
No known key found for this signature in database
GPG key ID: A2A06DF2A33A54FA

View file

@ -1,5 +1,6 @@
;;; GNU Guix --- Functional package management for GNU ;;; GNU Guix --- Functional package management for GNU
;;; Copyright © 2014 Marek Benc <merkur32@gmail.com> ;;; Copyright © 2014 Marek Benc <merkur32@gmail.com>
;;; Copyright © 2020 Marius Bakke <mbakke@fastmail.com>
;;; ;;;
;;; This file is part of GNU Guix. ;;; This file is part of GNU Guix.
;;; ;;;
@ -40,6 +41,7 @@ (define-public nvi
(patches (search-patches "nvi-assume-preserve-path.patch" (patches (search-patches "nvi-assume-preserve-path.patch"
"nvi-dbpagesize-binpower.patch" "nvi-dbpagesize-binpower.patch"
"nvi-db4.patch")) "nvi-db4.patch"))
(modules '((guix build utils)))
(snippet (snippet
;; Create a wrapper for the configure script, make it executable. ;; Create a wrapper for the configure script, make it executable.
'(let ((conf-wrap (open-output-file "configure"))) '(let ((conf-wrap (open-output-file "configure")))
@ -51,6 +53,12 @@ (define-public nvi
(newline conf-wrap) (newline conf-wrap)
(close-output-port conf-wrap) (close-output-port conf-wrap)
(chmod "configure" #o0755) (chmod "configure" #o0755)
;; Glibc 2.30 removed the deprecated <sys/stropts.h>, so fall back
;; to the internal PTY allocation logic.
(substitute* "ex/ex_script.c"
(("#ifdef HAVE_SYS5_PTY")
"#if defined(HAVE_SYS5_PTY) && !defined(__GLIBC__)"))
#t)))) #t))))
(build-system gnu-build-system) (build-system gnu-build-system)