gnu: ruby-listen: Update to 3.1.5.
[jackhill/guix/guix.git] / gnu / packages / elixir.scm
CommitLineData
0a4ebe01
PP
1;;; GNU Guix --- Functional package management for GNU
2;;; Copyright © 2016 Leo Famulari <leo@famulari.name>
151960e4 3;;; Copyright © 2016, 2017 Pjotr Prins <pjotr.guix@thebird.nl>
0a4ebe01
PP
4;;; Copyright © 2016 Ricardo Wurmus <rekado@elephly.net>
5;;;
6;;; This file is part of GNU Guix.
7;;;
8;;; GNU Guix is free software; you can redistribute it and/or modify it
9;;; under the terms of the GNU General Public License as published by
10;;; the Free Software Foundation; either version 3 of the License, or (at
11;;; your option) any later version.
12;;;
13;;; GNU Guix is distributed in the hope that it will be useful, but
14;;; WITHOUT ANY WARRANTY; without even the implied warranty of
15;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16;;; GNU General Public License for more details.
17;;;
18;;; You should have received a copy of the GNU General Public License
19;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
20
21(define-module (gnu packages elixir)
22 #:use-module ((guix licenses) #:prefix license:)
23 #:use-module (guix build-system gnu)
24 #:use-module (guix download)
25 #:use-module (guix packages)
26 #:use-module (gnu packages)
27 #:use-module (gnu packages erlang)
28 #:use-module (gnu packages version-control))
29
30(define-public elixir
31 (package
32 (name "elixir")
151960e4 33 (version "1.4.2")
0a4ebe01
PP
34 (source (origin
35 (method url-fetch)
36 (uri (string-append "https://github.com/elixir-lang/elixir"
37 "/archive/v" version ".tar.gz"))
38 (file-name (string-append name "-" version ".tar.gz"))
39 (sha256
40 (base32
151960e4
PP
41 "0gsmgx4h6rvxilcbsx2z6yirm6g2g5bsxdvr0608ng4bsv22wknb"))
42 ;; FIXME: 27 tests (out of 4K) had to be disabled as
43 ;; they fail in the build environment. Common failures
44 ;; are:
0a4ebe01
PP
45 ;; - Mix.Shell.cmd() fails with error 130
46 ;; - The git_repo fixture cannot be found
47 ;; - Communication with spawned processes fails with EPIPE
48 ;; - Failure to copy files
49 (patches (search-patches "elixir-disable-failing-tests.patch"))))
50 (build-system gnu-build-system)
51 (arguments
52 `(#:test-target "test"
53 #:make-flags (list (string-append "PREFIX="
54 (assoc-ref %outputs "out")))
55 #:phases
56 (modify-phases %standard-phases
57 (add-after 'unpack 'replace-paths
58 (lambda* (#:key inputs #:allow-other-keys)
59 (substitute* '("lib/elixir/lib/system.ex"
60 "lib/mix/lib/mix/scm/git.ex")
61 (("(cmd\\(['\"])git" _ prefix)
62 (string-append prefix (which "git"))))
63 (substitute* "bin/elixir"
64 (("ERL_EXEC=\"erl\"")
65 (string-append "ERL_EXEC=" (which "erl"))))
66 #t))
67 (add-after 'unpack 'fix-or-disable-tests
68 (lambda* (#:key inputs #:allow-other-keys)
69 ;; Some tests require access to a home directory.
70 (setenv "HOME" "/tmp")
71
72 ;; FIXME: These tests fail because the "git_repo" fixture does
73 ;; not exist or cannot be found.
74 (delete-file "lib/mix/test/mix/tasks/deps.git_test.exs")
75
76 ;; FIXME: Mix.Shell.cmd() always fails with error code 130.
77 (delete-file "lib/mix/test/mix/shell_test.exs")
78 #t))
79 (add-before 'build 'make-current
80 ;; The Elixir compiler checks whether or not to compile files by
81 ;; inspecting their timestamps. When the timestamp is equal to the
82 ;; epoch no compilation will be performed. Some tests fail when
83 ;; files are older than Jan 1, 2000.
84 (lambda _
85 (for-each (lambda (file)
86 (let ((recent 1400000000))
87 (utime file recent recent 0 0)))
88 (find-files "." ".*"))
89 #t))
90 (delete 'configure))))
91 (inputs
92 `(("erlang" ,erlang)
93 ("git" ,git)))
94 (home-page "http://elixir-lang.org/")
95 (synopsis "Elixir programming language")
96 (description "Elixir is a dynamic, functional language used to build
97scalable and maintainable applications. Elixir leverages the Erlang VM, known
98for running low-latency, distributed and fault-tolerant systems, while also
99being successfully used in web development and the embedded software domain.")
100 (license license:asl2.0)))