;;; Copyright © 2016 Ricardo Wurmus <rekado@elephly.net>
;;; Copyright © 2017 nee <nee.git@cock.li>
;;; Copyright © 2018, 2019 Tobias Geerinckx-Rice <me@tobias.gr>
-;;; Copyright © 2018 ng0 <ng0@n0.is>
+;;; Copyright © 2018 Nikita <nikita@n0.is>
+;;; Copyright © 2021 Oskar Köök <oskar@maatriks.ee>
;;;
;;; This file is part of GNU Guix.
;;;
(define-public elixir
(package
(name "elixir")
- (version "1.8.2")
+ (version "1.11.3")
(source
(origin
(method git-fetch)
(uri (git-reference
- (url "https://github.com/elixir-lang/elixir.git")
+ (url "https://github.com/elixir-lang/elixir")
(commit (string-append "v" version))))
(file-name (git-file-name name version))
(sha256
- (base32 "1n77cpcl2b773gmj3m9s24akvj9gph9byqbmj2pvlsmby4aqwckq"))
+ (base32 "0ivah4117z75pinvb3gr22d05ihfwcdgw5zvvpv7kbgiqaj8ma8f"))
(patches (search-patches "elixir-path-length.patch"))))
(build-system gnu-build-system)
(arguments
"lib/mix/lib/mix/scm/git.ex")
(("(cmd\\(['\"])git" _ prefix)
(string-append prefix (which "git"))))
+ (substitute* '("lib/mix/lib/mix/release.ex"
+ "lib/mix/lib/mix/tasks/release.init.ex")
+ (("#!/bin/sh")
+ (string-append "#!" (which "sh"))))
(substitute* "bin/elixir"
- (("ERL_EXEC=\"erl\"")
- (string-append "ERL_EXEC=" (which "erl"))))
+ (("ERTS_BIN=")
+ (string-append
+ "ERTS_BIN="
+ ;; Elixir Releases will prepend to ERTS_BIN the path of a copy of erl.
+ ;; We detect if a release is being generated by checking the initial ERTS_BIN
+ ;; value: if it's empty, we are not in release mode and can point to the actual
+ ;; erl binary in Guix store.
+ "\nif [ -z \"$ERTS_BIN\" ]; then ERTS_BIN="
+ (string-drop-right (which "erl") 3)
+ "; fi")))
(substitute* "bin/mix"
(("#!/usr/bin/env elixir")
(string-append "#!" out "/bin/elixir"))))