gnu: elixir: Use G-expressions.
* gnu/packages/elixir.scm (elixir)[arguments]: Use G-expressions. Prefer SEARCH-INPUT-FILES over WHICH.
This commit is contained in:
		
							parent
							
								
									d3865640e8
								
							
						
					
					
						commit
						3da297997d
					
				
					 1 changed files with 51 additions and 49 deletions
				
			
		| 
						 | 
					@ -26,6 +26,7 @@
 | 
				
			||||||
(define-module (gnu packages elixir)
 | 
					(define-module (gnu packages elixir)
 | 
				
			||||||
  #:use-module ((guix licenses) #:prefix license:)
 | 
					  #:use-module ((guix licenses) #:prefix license:)
 | 
				
			||||||
  #:use-module (guix build-system gnu)
 | 
					  #:use-module (guix build-system gnu)
 | 
				
			||||||
 | 
					  #:use-module (guix gexp)
 | 
				
			||||||
  #:use-module (guix git-download)
 | 
					  #:use-module (guix git-download)
 | 
				
			||||||
  #:use-module (guix packages)
 | 
					  #:use-module (guix packages)
 | 
				
			||||||
  #:use-module (gnu packages)
 | 
					  #:use-module (gnu packages)
 | 
				
			||||||
| 
						 | 
					@ -48,55 +49,56 @@
 | 
				
			||||||
       (patches (search-patches "elixir-path-length.patch"))))
 | 
					       (patches (search-patches "elixir-path-length.patch"))))
 | 
				
			||||||
    (build-system gnu-build-system)
 | 
					    (build-system gnu-build-system)
 | 
				
			||||||
    (arguments
 | 
					    (arguments
 | 
				
			||||||
     `(#:test-target "test"
 | 
					     (list
 | 
				
			||||||
       #:parallel-tests? #f ;see <https://debbugs.gnu.org/cgi/bugreport.cgi?bug=32171#23>
 | 
					      #:test-target "test"
 | 
				
			||||||
       #:make-flags (list (string-append "PREFIX="
 | 
					      #:parallel-tests? #f ;see <https://debbugs.gnu.org/cgi/bugreport.cgi?bug=32171#23>
 | 
				
			||||||
                                         (assoc-ref %outputs "out")))
 | 
					      #:make-flags #~(list (string-append "PREFIX=" #$output))
 | 
				
			||||||
       #:phases
 | 
					      #:phases
 | 
				
			||||||
       (modify-phases %standard-phases
 | 
					      #~(modify-phases %standard-phases
 | 
				
			||||||
         (add-after 'unpack 'make-git-checkout-writable
 | 
					          (add-after 'unpack 'make-git-checkout-writable
 | 
				
			||||||
           (lambda _
 | 
					            (lambda _
 | 
				
			||||||
             (for-each make-file-writable (find-files "."))))
 | 
					              (for-each make-file-writable (find-files "."))))
 | 
				
			||||||
         (add-after 'make-git-checkout-writable 'replace-paths
 | 
					          (add-after 'make-git-checkout-writable 'replace-paths
 | 
				
			||||||
           (lambda* (#:key inputs outputs #:allow-other-keys)
 | 
					            (lambda* (#:key inputs #:allow-other-keys)
 | 
				
			||||||
             (let ((out (assoc-ref outputs "out")))
 | 
					              (substitute* '("lib/elixir/lib/system.ex"
 | 
				
			||||||
               (substitute* '("lib/elixir/lib/system.ex"
 | 
					                             "lib/mix/lib/mix/scm/git.ex")
 | 
				
			||||||
                              "lib/mix/lib/mix/scm/git.ex")
 | 
					                (("(cmd\\(['\"])git" _ prefix)
 | 
				
			||||||
                 (("(cmd\\(['\"])git" _ prefix)
 | 
					                 (string-append prefix
 | 
				
			||||||
                  (string-append prefix (which "git"))))
 | 
					                                (search-input-file inputs "/bin/git"))))
 | 
				
			||||||
               (substitute* '("lib/mix/lib/mix/release.ex"
 | 
					              (substitute* '("lib/mix/lib/mix/release.ex"
 | 
				
			||||||
                              "lib/mix/lib/mix/tasks/release.init.ex")
 | 
					                             "lib/mix/lib/mix/tasks/release.init.ex")
 | 
				
			||||||
                 (("#!/bin/sh")
 | 
					                (("#!/bin/sh")
 | 
				
			||||||
                  (string-append "#!" (which "sh"))))
 | 
					                 (string-append "#!" (search-input-file inputs "sh"))))
 | 
				
			||||||
               (substitute* "bin/elixir"
 | 
					              (substitute* "bin/elixir"
 | 
				
			||||||
                 (("^ERTS_BIN=$")
 | 
					                (("^ERTS_BIN=$")
 | 
				
			||||||
                  (string-append
 | 
					                 (string-append
 | 
				
			||||||
                    "ERTS_BIN="
 | 
					                  "ERTS_BIN="
 | 
				
			||||||
                    ;; Elixir Releases will prepend to ERTS_BIN the path of a copy of erl.
 | 
					                  ;; Elixir Releases will prepend to ERTS_BIN the path of
 | 
				
			||||||
                    ;; We detect if a release is being generated by checking the initial ERTS_BIN
 | 
					                  ;; a copy of erl.  We detect if a release is being generated
 | 
				
			||||||
                    ;; value: if it's empty, we are not in release mode and can point to the actual
 | 
					                  ;; by checking the initial ERTS_BIN value: if it's empty, we
 | 
				
			||||||
                    ;; erl binary in Guix store.
 | 
					                  ;; are not in release mode and can point to the actual erl
 | 
				
			||||||
                    "\nif [ -z \"$ERTS_BIN\" ]; then ERTS_BIN="
 | 
					                  ;; binary in Guix store.
 | 
				
			||||||
                    (string-drop-right (which "erl") 3)
 | 
					                  "\nif [ -z \"$ERTS_BIN\" ]; then ERTS_BIN="
 | 
				
			||||||
                    "; fi\n")))
 | 
					                  (string-drop-right (search-input-file inputs "/bin/erl") 3)
 | 
				
			||||||
               (substitute* "bin/mix"
 | 
					                  "; fi\n")))
 | 
				
			||||||
                 (("#!/usr/bin/env elixir")
 | 
					              (substitute* "bin/mix"
 | 
				
			||||||
                  (string-append "#!" out "/bin/elixir"))))))
 | 
					                (("#!/usr/bin/env elixir")
 | 
				
			||||||
         (add-before 'build 'make-current
 | 
					                 (string-append "#!" #$output "/bin/elixir")))))
 | 
				
			||||||
           ;; The Elixir compiler checks whether or not to compile files by
 | 
					          (add-before 'build 'make-current
 | 
				
			||||||
           ;; inspecting their timestamps.  When the timestamp is equal to the
 | 
					            ;; The Elixir compiler checks whether or not to compile files by
 | 
				
			||||||
           ;; epoch no compilation will be performed.  Some tests fail when
 | 
					            ;; inspecting their timestamps.  When the timestamp is equal to the
 | 
				
			||||||
           ;; files are older than Jan 1, 2000.
 | 
					            ;; epoch no compilation will be performed.  Some tests fail when
 | 
				
			||||||
           (lambda _
 | 
					            ;; files are older than Jan 1, 2000.
 | 
				
			||||||
             (for-each (lambda (file)
 | 
					            (lambda _
 | 
				
			||||||
                         (let ((recent 1400000000))
 | 
					              (for-each (lambda (file)
 | 
				
			||||||
                           (utime file recent recent 0 0)))
 | 
					                          (let ((recent 1400000000))
 | 
				
			||||||
                       (find-files "." ".*"))))
 | 
					                            (utime file recent recent 0 0)))
 | 
				
			||||||
         (add-before 'check 'set-home
 | 
					                        (find-files "." ".*"))))
 | 
				
			||||||
           (lambda* (#:key inputs #:allow-other-keys)
 | 
					          (add-before 'check 'set-home
 | 
				
			||||||
             ;; Some tests require access to a home directory.
 | 
					            (lambda* (#:key inputs #:allow-other-keys)
 | 
				
			||||||
             (setenv "HOME" "/tmp")))
 | 
					              ;; Some tests require access to a home directory.
 | 
				
			||||||
         (delete 'configure))))
 | 
					              (setenv "HOME" "/tmp")))
 | 
				
			||||||
 | 
					          (delete 'configure))))
 | 
				
			||||||
    (inputs
 | 
					    (inputs
 | 
				
			||||||
     (list erlang git))
 | 
					     (list erlang git))
 | 
				
			||||||
    (home-page "https://elixir-lang.org/")
 | 
					    (home-page "https://elixir-lang.org/")
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Reference in a new issue