elixir.scm 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101
  1. ;;; GNU Guix --- Functional package management for GNU
  2. ;;; Copyright © 2016 Leo Famulari <leo@famulari.name>
  3. ;;; Copyright © 2016, 2017 Pjotr Prins <pjotr.guix@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. (define-module (gnu packages elixir)
  21. #:use-module ((guix licenses) #:prefix license:)
  22. #:use-module (guix build-system gnu)
  23. #:use-module (guix download)
  24. #:use-module (guix packages)
  25. #:use-module (gnu packages)
  26. #:use-module (gnu packages erlang)
  27. #:use-module (gnu packages version-control))
  28. (define-public elixir
  29. (package
  30. (name "elixir")
  31. (version "1.4.2")
  32. (source (origin
  33. (method url-fetch)
  34. (uri (string-append "https://github.com/elixir-lang/elixir"
  35. "/archive/v" version ".tar.gz"))
  36. (file-name (string-append name "-" version ".tar.gz"))
  37. (sha256
  38. (base32
  39. "0gsmgx4h6rvxilcbsx2z6yirm6g2g5bsxdvr0608ng4bsv22wknb"))
  40. ;; FIXME: 27 tests (out of 4K) had to be disabled as
  41. ;; they fail in the build environment. Common failures
  42. ;; are:
  43. ;; - Mix.Shell.cmd() fails with error 130
  44. ;; - The git_repo fixture cannot be found
  45. ;; - Communication with spawned processes fails with EPIPE
  46. ;; - Failure to copy files
  47. (patches (search-patches "elixir-disable-failing-tests.patch"))))
  48. (build-system gnu-build-system)
  49. (arguments
  50. `(#:test-target "test"
  51. #:make-flags (list (string-append "PREFIX="
  52. (assoc-ref %outputs "out")))
  53. #:phases
  54. (modify-phases %standard-phases
  55. (add-after 'unpack 'replace-paths
  56. (lambda* (#:key inputs #:allow-other-keys)
  57. (substitute* '("lib/elixir/lib/system.ex"
  58. "lib/mix/lib/mix/scm/git.ex")
  59. (("(cmd\\(['\"])git" _ prefix)
  60. (string-append prefix (which "git"))))
  61. (substitute* "bin/elixir"
  62. (("ERL_EXEC=\"erl\"")
  63. (string-append "ERL_EXEC=" (which "erl"))))
  64. #t))
  65. (add-after 'unpack 'fix-or-disable-tests
  66. (lambda* (#:key inputs #:allow-other-keys)
  67. ;; Some tests require access to a home directory.
  68. (setenv "HOME" "/tmp")
  69. ;; FIXME: These tests fail because the "git_repo" fixture does
  70. ;; not exist or cannot be found.
  71. (delete-file "lib/mix/test/mix/tasks/deps.git_test.exs")
  72. ;; FIXME: Mix.Shell.cmd() always fails with error code 130.
  73. (delete-file "lib/mix/test/mix/shell_test.exs")
  74. #t))
  75. (add-before 'build 'make-current
  76. ;; The Elixir compiler checks whether or not to compile files by
  77. ;; inspecting their timestamps. When the timestamp is equal to the
  78. ;; epoch no compilation will be performed. Some tests fail when
  79. ;; files are older than Jan 1, 2000.
  80. (lambda _
  81. (for-each (lambda (file)
  82. (let ((recent 1400000000))
  83. (utime file recent recent 0 0)))
  84. (find-files "." ".*"))
  85. #t))
  86. (delete 'configure))))
  87. (inputs
  88. `(("erlang" ,erlang)
  89. ("git" ,git)))
  90. (home-page "http://elixir-lang.org/")
  91. (synopsis "Elixir programming language")
  92. (description "Elixir is a dynamic, functional language used to build
  93. scalable and maintainable applications. Elixir leverages the Erlang VM, known
  94. for running low-latency, distributed and fault-tolerant systems, while also
  95. being successfully used in web development and the embedded software domain.")
  96. (license license:asl2.0)))