diff options
Diffstat (limited to 'gnu/packages/elixir.scm')
| -rw-r--r-- | gnu/packages/elixir.scm | 99 |
1 files changed, 99 insertions, 0 deletions
diff --git a/gnu/packages/elixir.scm b/gnu/packages/elixir.scm new file mode 100644 index 00000000000..4e430b323f9 --- /dev/null +++ b/gnu/packages/elixir.scm | |||
| @@ -0,0 +1,99 @@ | |||
| 1 | ;;; GNU Guix --- Functional package management for GNU | ||
| 2 | ;;; Copyright © 2016 Leo Famulari <leo@famulari.name> | ||
| 3 | ;;; Copyright © 2016 Pjotr Prins <pjotr.public12@thebird.nl> | ||
| 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") | ||
| 33 | (version "1.3.2") | ||
| 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 | ||
| 41 | "0jsc6kl7f74yszcypdv3w3vhyc9qfqav8nwc41in082m0vpfy95y")) | ||
| 42 | ;; FIXME: Some tests had to be disabled as they fail in the | ||
| 43 | ;; build environment. Common failures are: | ||
| 44 | ;; - Mix.Shell.cmd() fails with error 130 | ||
| 45 | ;; - The git_repo fixture cannot be found | ||
| 46 | ;; - Communication with spawned processes fails with EPIPE | ||
| 47 | ;; - Failure to copy files | ||
| 48 | (patches (search-patches "elixir-disable-failing-tests.patch")))) | ||
| 49 | (build-system gnu-build-system) | ||
| 50 | (arguments | ||
| 51 | `(#:test-target "test" | ||
| 52 | #:make-flags (list (string-append "PREFIX=" | ||
| 53 | (assoc-ref %outputs "out"))) | ||
| 54 | #:phases | ||
| 55 | (modify-phases %standard-phases | ||
| 56 | (add-after 'unpack 'replace-paths | ||
| 57 | (lambda* (#:key inputs #:allow-other-keys) | ||
| 58 | (substitute* '("lib/elixir/lib/system.ex" | ||
| 59 | "lib/mix/lib/mix/scm/git.ex") | ||
| 60 | (("(cmd\\(['\"])git" _ prefix) | ||
| 61 | (string-append prefix (which "git")))) | ||
| 62 | (substitute* "bin/elixir" | ||
| 63 | (("ERL_EXEC=\"erl\"") | ||
| 64 | (string-append "ERL_EXEC=" (which "erl")))) | ||
| 65 | #t)) | ||
| 66 | (add-after 'unpack 'fix-or-disable-tests | ||
| 67 | (lambda* (#:key inputs #:allow-other-keys) | ||
| 68 | ;; Some tests require access to a home directory. | ||
| 69 | (setenv "HOME" "/tmp") | ||
| 70 | |||
| 71 | ;; FIXME: These tests fail because the "git_repo" fixture does | ||
| 72 | ;; not exist or cannot be found. | ||
| 73 | (delete-file "lib/mix/test/mix/tasks/deps.git_test.exs") | ||
| 74 | |||
| 75 | ;; FIXME: Mix.Shell.cmd() always fails with error code 130. | ||
| 76 | (delete-file "lib/mix/test/mix/shell_test.exs") | ||
| 77 | #t)) | ||
| 78 | (add-before 'build 'make-current | ||
| 79 | ;; The Elixir compiler checks whether or not to compile files by | ||
| 80 | ;; inspecting their timestamps. When the timestamp is equal to the | ||
| 81 | ;; epoch no compilation will be performed. Some tests fail when | ||
| 82 | ;; files are older than Jan 1, 2000. | ||
| 83 | (lambda _ | ||
| 84 | (for-each (lambda (file) | ||
| 85 | (let ((recent 1400000000)) | ||
| 86 | (utime file recent recent 0 0))) | ||
| 87 | (find-files "." ".*")) | ||
| 88 | #t)) | ||
| 89 | (delete 'configure)))) | ||
| 90 | (inputs | ||
| 91 | `(("erlang" ,erlang) | ||
| 92 | ("git" ,git))) | ||
| 93 | (home-page "http://elixir-lang.org/") | ||
| 94 | (synopsis "Elixir programming language") | ||
| 95 | (description "Elixir is a dynamic, functional language used to build | ||
| 96 | scalable and maintainable applications. Elixir leverages the Erlang VM, known | ||
| 97 | for running low-latency, distributed and fault-tolerant systems, while also | ||
| 98 | being successfully used in web development and the embedded software domain.") | ||
| 99 | (license license:asl2.0))) | ||
