Commit | Line | Data |
---|---|---|
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 | 4 | ;;; Copyright © 2016 Ricardo Wurmus <rekado@elephly.net> |
6de3d176 | 5 | ;;; Copyright © 2017 nee <nee.git@cock.li> |
2c5150ba | 6 | ;;; Copyright © 2018 Tobias Geerinckx-Rice <me@tobias.gr> |
70f57ae0 | 7 | ;;; Copyright © 2018 Nils Gillmann <ng0@n0.is> |
0a4ebe01 PP |
8 | ;;; |
9 | ;;; This file is part of GNU Guix. | |
10 | ;;; | |
11 | ;;; GNU Guix is free software; you can redistribute it and/or modify it | |
12 | ;;; under the terms of the GNU General Public License as published by | |
13 | ;;; the Free Software Foundation; either version 3 of the License, or (at | |
14 | ;;; your option) any later version. | |
15 | ;;; | |
16 | ;;; GNU Guix is distributed in the hope that it will be useful, but | |
17 | ;;; WITHOUT ANY WARRANTY; without even the implied warranty of | |
18 | ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
19 | ;;; GNU General Public License for more details. | |
20 | ;;; | |
21 | ;;; You should have received a copy of the GNU General Public License | |
22 | ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>. | |
23 | ||
24 | (define-module (gnu packages elixir) | |
25 | #:use-module ((guix licenses) #:prefix license:) | |
26 | #:use-module (guix build-system gnu) | |
27 | #:use-module (guix download) | |
28 | #:use-module (guix packages) | |
29 | #:use-module (gnu packages) | |
30 | #:use-module (gnu packages erlang) | |
31 | #:use-module (gnu packages version-control)) | |
32 | ||
33 | (define-public elixir | |
34 | (package | |
35 | (name "elixir") | |
e345274a | 36 | (version "1.6.6") |
0a4ebe01 PP |
37 | (source (origin |
38 | (method url-fetch) | |
39 | (uri (string-append "https://github.com/elixir-lang/elixir" | |
40 | "/archive/v" version ".tar.gz")) | |
41 | (file-name (string-append name "-" version ".tar.gz")) | |
42 | (sha256 | |
43 | (base32 | |
e345274a | 44 | "0c9qz5hasa59a9x1iwpcqpqj6wdbzpijfxqfmzimwj5z8q37nl3l")))) |
0a4ebe01 PP |
45 | (build-system gnu-build-system) |
46 | (arguments | |
47 | `(#:test-target "test" | |
e345274a | 48 | #:parallel-tests? #f ;see <https://debbugs.gnu.org/cgi/bugreport.cgi?bug=32171#23> |
0a4ebe01 PP |
49 | #:make-flags (list (string-append "PREFIX=" |
50 | (assoc-ref %outputs "out"))) | |
51 | #:phases | |
52 | (modify-phases %standard-phases | |
53 | (add-after 'unpack 'replace-paths | |
6de3d176 | 54 | (lambda* (#:key inputs outputs #:allow-other-keys) |
55 | (let ((out (assoc-ref outputs "out"))) | |
56 | (substitute* '("lib/elixir/lib/system.ex" | |
57 | "lib/mix/lib/mix/scm/git.ex") | |
58 | (("(cmd\\(['\"])git" _ prefix) | |
59 | (string-append prefix (which "git")))) | |
60 | (substitute* "bin/elixir" | |
61 | (("ERL_EXEC=\"erl\"") | |
62 | (string-append "ERL_EXEC=" (which "erl")))) | |
63 | (substitute* "bin/mix" | |
64 | (("#!/usr/bin/env elixir") | |
65 | (string-append "#!" out "/bin/elixir")))) | |
0a4ebe01 | 66 | #t)) |
0a4ebe01 PP |
67 | (add-before 'build 'make-current |
68 | ;; The Elixir compiler checks whether or not to compile files by | |
69 | ;; inspecting their timestamps. When the timestamp is equal to the | |
70 | ;; epoch no compilation will be performed. Some tests fail when | |
71 | ;; files are older than Jan 1, 2000. | |
72 | (lambda _ | |
73 | (for-each (lambda (file) | |
74 | (let ((recent 1400000000)) | |
75 | (utime file recent recent 0 0))) | |
76 | (find-files "." ".*")) | |
77 | #t)) | |
e7a25d2a CB |
78 | (add-before 'check 'set-home |
79 | (lambda* (#:key inputs #:allow-other-keys) | |
80 | ;; Some tests require access to a home directory. | |
81 | (setenv "HOME" "/tmp") | |
82 | #t)) | |
0a4ebe01 PP |
83 | (delete 'configure)))) |
84 | (inputs | |
85 | `(("erlang" ,erlang) | |
86 | ("git" ,git))) | |
87 | (home-page "http://elixir-lang.org/") | |
88 | (synopsis "Elixir programming language") | |
89 | (description "Elixir is a dynamic, functional language used to build | |
90 | scalable and maintainable applications. Elixir leverages the Erlang VM, known | |
91 | for running low-latency, distributed and fault-tolerant systems, while also | |
92 | being successfully used in web development and the embedded software domain.") | |
93 | (license license:asl2.0))) |