Skip to content
Snippets Groups Projects
Commit f755aa3f authored by Ludovic Courtès's avatar Ludovic Courtès
Browse files

gnu: ncurses, readline: Allow cross-compilation.

* gnu/packages/ncurses.scm (ncurses): Add `cross-pre-install-phase'.
  Use different phases when (%current-target-system) is true.
* gnu/packages/readline.scm (readline): Use %standard-cross-phases as
  the base when (%current-target-system) is true.
parent 089b0634
No related branches found
No related tags found
No related merge requests found
...@@ -42,7 +42,16 @@ (define-public ncurses ...@@ -42,7 +42,16 @@ (define-public ncurses
(string-append "CONFIG_SHELL=" bash) (string-append "CONFIG_SHELL=" bash)
(string-append "--prefix=" out) (string-append "--prefix=" out)
configure-flags))))) configure-flags)))))
(cross-pre-install-phase
'(lambda _
;; Run the native `tic' program, not the cross-built one.
(substitute* "misc/run_tic.sh"
(("\\{TIC_PATH:=.*\\}")
"{TIC_PATH:=true}")
(("cross_compiling:=no")
"cross_compiling:=yes"))))
(post-install-phase (post-install-phase
;; FIXME: The `tic' binary lacks a RUNPATH; fix it.
'(lambda* (#:key outputs #:allow-other-keys) '(lambda* (#:key outputs #:allow-other-keys)
(let ((out (assoc-ref outputs "out"))) (let ((out (assoc-ref outputs "out")))
;; When building a wide-character (Unicode) build, create backward ;; When building a wide-character (Unicode) build, create backward
...@@ -97,16 +106,28 @@ (define lib.so ...@@ -97,16 +106,28 @@ (define lib.so
'("--without-cxx-binding") '("--without-cxx-binding")
'())) '()))
#:tests? #f ; no "check" target #:tests? #f ; no "check" target
#:phases (alist-cons-after #:phases ,(if (%current-target-system)
'install 'post-install ,post-install-phase
(alist-cons-before `(alist-cons-before ; cross build
'configure 'patch-makefile-SHELL 'configure 'patch-makefile-SHELL
,patch-makefile-phase ,patch-makefile-phase
(alist-replace (alist-cons-before
'configure 'install 'pre-install
,configure-phase ,cross-pre-install-phase
%standard-phases))))) (alist-cons-after
(self-native-input? #t) 'install 'post-install ,post-install-phase
%standard-cross-phases)))
`(alist-cons-after ; native build
'install 'post-install ,post-install-phase
(alist-cons-before
'configure 'patch-makefile-SHELL
,patch-makefile-phase
(alist-replace
'configure
,configure-phase
%standard-phases))))))
(self-native-input? #t) ; for `tic'
(synopsis "Terminal emulation (termcap, terminfo) library") (synopsis "Terminal emulation (termcap, terminfo) library")
(description (description
"The Ncurses (new curses) library is a free software emulation of curses "The Ncurses (new curses) library is a free software emulation of curses
......
...@@ -61,7 +61,9 @@ (define-public readline ...@@ -61,7 +61,9 @@ (define-public readline
#:phases (alist-cons-after #:phases (alist-cons-after
'install 'post-install 'install 'post-install
,post-install-phase ,post-install-phase
%standard-phases))) ,(if (%current-target-system)
'%standard-cross-phases
'%standard-phases))))
(synopsis "Edit command lines while typing, with history support") (synopsis "Edit command lines while typing, with history support")
(description (description
"The GNU Readline library provides a set of functions for use by "The GNU Readline library provides a set of functions for use by
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment