summary refs log tree commit diff
diff options
context:
space:
mode:
authorTobias Geerinckx-Rice <me@tobias.gr>2020-10-07 03:08:21 +0200
committerTobias Geerinckx-Rice <me@tobias.gr>2020-10-07 03:21:44 +0200
commita5ed8e0e7ce251f0c0f0f60159c30632c0354b56 (patch)
tree796f40e4d565ecc4d7126fd6c200ec47da860992
parent16d3630bf4126c8976f6c671b92d1257aa0f3b45 (diff)
downloadguix-a5ed8e0e7ce251f0c0f0f60159c30632c0354b56.tar.gz
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.
-rw-r--r--gnu/packages/entr.scm24
1 files changed, 16 insertions, 8 deletions
diff --git a/gnu/packages/entr.scm b/gnu/packages/entr.scm
index da05a23353..be89f21980 100644
--- a/gnu/packages/entr.scm
+++ b/gnu/packages/entr.scm
@@ -21,11 +21,14 @@
 ;;; along with GNU Guix.  If not, see <http://www.gnu.org/licenses/>.
 
 (define-module (gnu packages entr)
+  #:use-module (gnu packages base)
+  #:use-module (gnu packages bash)
   #:use-module (gnu packages ncurses)
   #:use-module (guix licenses)
   #:use-module (guix packages)
   #:use-module (guix download)
-  #:use-module (guix build-system gnu))
+  #:use-module (guix build-system gnu)
+  #:use-module (guix utils))
 
 (define-public entr
   (package
@@ -47,20 +50,25 @@
            (lambda* (#:key outputs #:allow-other-keys)
              (let ((out (assoc-ref outputs "out")))
                (setenv "CONFIG_SHELL" (which "bash"))
-               (setenv "CC" (which "gcc"))
+               (setenv "CC" ,(cc-for-target))
                (setenv "DESTDIR" (string-append out "/"))
                (setenv "PREFIX" "")
                (setenv "MANPREFIX" "man")
                (invoke "./configure"))))
          (add-before 'build 'remove-fhs-file-names
-           (lambda _
+           (lambda* (#:key inputs #:allow-other-keys)
              (substitute* "entr.c"
-               (("/bin/sh") (which "sh"))
-               (("/bin/cat") (which "cat"))
-               (("/usr/bin/clear") (which "clear")))
+               (("/bin/sh" command)
+                (string-append (assoc-ref inputs "bash") command))
+               (("/bin/cat" command)
+                (string-append (assoc-ref inputs "coreutils") command))
+               (("/usr(/bin/clear)" _ command)
+                (string-append (assoc-ref inputs "ncurses") command)))
              #t)))))
-    ;; ncurses provides the `clear' binary.
-    (inputs `(("ncurses" ,ncurses)))
+    (inputs
+     `(("bash" ,bash)
+       ("coreutils" ,coreutils)
+       ("ncurses" ,ncurses)))
     (home-page "http://entrproject.org/")
     (synopsis "Run arbitrary commands when files change")
     (description