me
/
guix
Archived
1
0
Fork 0

gnu: entr: Cross-compile.

* gnu/packages/entr.scm (entr)[arguments]: Use CC-FOR-TARGET.
Use INPUTS instead of WHICH.
[inputs]: Add non-native bash and coreutils packages.
master
Tobias Geerinckx-Rice 2020-10-07 03:08:21 +02:00
parent 16d3630bf4
commit a5ed8e0e7c
No known key found for this signature in database
GPG Key ID: 0DB0FF884F556D79
1 changed files with 16 additions and 8 deletions

View File

@ -21,11 +21,14 @@
;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>. ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
(define-module (gnu packages entr) (define-module (gnu packages entr)
#:use-module (gnu packages base)
#:use-module (gnu packages bash)
#:use-module (gnu packages ncurses) #:use-module (gnu packages ncurses)
#:use-module (guix licenses) #:use-module (guix licenses)
#:use-module (guix packages) #:use-module (guix packages)
#:use-module (guix download) #:use-module (guix download)
#:use-module (guix build-system gnu)) #:use-module (guix build-system gnu)
#:use-module (guix utils))
(define-public entr (define-public entr
(package (package
@ -47,20 +50,25 @@
(lambda* (#:key outputs #:allow-other-keys) (lambda* (#:key outputs #:allow-other-keys)
(let ((out (assoc-ref outputs "out"))) (let ((out (assoc-ref outputs "out")))
(setenv "CONFIG_SHELL" (which "bash")) (setenv "CONFIG_SHELL" (which "bash"))
(setenv "CC" (which "gcc")) (setenv "CC" ,(cc-for-target))
(setenv "DESTDIR" (string-append out "/")) (setenv "DESTDIR" (string-append out "/"))
(setenv "PREFIX" "") (setenv "PREFIX" "")
(setenv "MANPREFIX" "man") (setenv "MANPREFIX" "man")
(invoke "./configure")))) (invoke "./configure"))))
(add-before 'build 'remove-fhs-file-names (add-before 'build 'remove-fhs-file-names
(lambda _ (lambda* (#:key inputs #:allow-other-keys)
(substitute* "entr.c" (substitute* "entr.c"
(("/bin/sh") (which "sh")) (("/bin/sh" command)
(("/bin/cat") (which "cat")) (string-append (assoc-ref inputs "bash") command))
(("/usr/bin/clear") (which "clear"))) (("/bin/cat" command)
(string-append (assoc-ref inputs "coreutils") command))
(("/usr(/bin/clear)" _ command)
(string-append (assoc-ref inputs "ncurses") command)))
#t))))) #t)))))
;; ncurses provides the `clear' binary. (inputs
(inputs `(("ncurses" ,ncurses))) `(("bash" ,bash)
("coreutils" ,coreutils)
("ncurses" ,ncurses)))
(home-page "http://entrproject.org/") (home-page "http://entrproject.org/")
(synopsis "Run arbitrary commands when files change") (synopsis "Run arbitrary commands when files change")
(description (description