-
-
Save huffman/1955470 to your computer and use it in GitHub Desktop.
# Install this recipe with: | |
# brew install --HEAD https://raw.github.com/gist/1955470/c58bda92f07147afff64a86d0c2d8ef65adb9cd6/elixir.rb | |
require 'formula' | |
class Elixir < Formula | |
homepage 'http://elixir-lang.org/' | |
head 'https://github.com/elixir-lang/elixir.git' | |
depends_on 'erlang' | |
def install | |
system "make" | |
bin.install Dir['bin/*'] | |
prefix.install Dir['ebin/', 'exbin/'] | |
end | |
def test | |
system "elixir" | |
system "elixirc" | |
system "iex" | |
end | |
end |
I looked into it but they don't currently support it. Maybe we can print out a message during install to clarify the version dependency.
Last time I updated Elixir on my machine, Homebrew also installed the newest version of Erlang (R15B01).
On another occasion, it installed the latest automake
before updating Elixir. Has anyone got a clue why?
why isn't this in homebrew core?
@alco AFAIK, this is how homebrew works, it installs the latest dependencies across the board. Elixir depends on Erlang which then depends on automake.
@paulmillr homebrew does not accept head-only packages. As soon as we release the next Elixir version, we will be able to push it to homebrew.
@josevalim I suggest you provide a formula like this one with a --head or --devel option now, https://github.com/mxcl/homebrew/blob/master/Library/Formula/couchdb.rb and confirm you'll be tagging a release soon. I'd guess that will be sufficient.
@alco because --head is a recursize flag in homebrew, driving erlang to latest release. Latest homebrew releases take into account that you no longer need XCode to build from source, and that the apple-provided non-XCode compiler bundle also requires auto* to be feature-complete.
@huffman for CouchDB we check erlang version in configure.ac via
otp_release="
${ERL} -noshell -eval 'io:put_chars(erlang:system_info(otp_release)).' -s erlang halt"
and something similar could be done during brew recipe for elixir wrapped with a grep or similar check.
@dch thanks! We have already submitted a pull request to home brew: Homebrew/legacy-homebrew#12450
@josevalim I tried to install via the homebrew as suggested above.
After installation, when I try to fire the iex
console, it fails to start.
millisami at sachin in ~
○ brew install --HEAD https://raw.github.com/gist/1955470/c58bda92f07147afff64a86d0c2d8ef65adb9cd6/elixir.rb ruby-1.9.3-p194
######################################################################## 100.0%
==> Installing elixir dependency: erlang
==> Downloading https://downloads.sf.net/project/machomebrew/Bottles/erlang-R15B01.snowleopard.bottle.tar.gz
######################################################################## 100.0%
==> Pouring erlang-R15B01.snowleopard.bottle.tar.gz
/usr/local/Cellar/erlang/R15B01: 6991 files, 270M
==> Installing elixir
==> Cloning https://github.com/elixir-lang/elixir.git
Cloning into /Library/Caches/Homebrew/elixir--git...
remote: Counting objects: 897, done.
remote: Compressing objects: 100% (771/771), done.
remote: Total 897 (delta 293), reused 296 (delta 54)
Receiving objects: 100% (897/897), 790.69 KiB | 29 KiB/s, done.
Resolving deltas: 100% (293/293), done.
==> make
Warning: tried to install empty array to /usr/local/Cellar/elixir/HEAD
Warning: Non-executables were installed to "bin".
Installing non-executables to "bin" is bad practice.
The offending files are:
/usr/local/Cellar/elixir/HEAD/bin/elixir.bat
/usr/local/Cellar/elixir/HEAD/bin/elixirc.bat
/usr/local/Cellar/elixir/HEAD/bin/iex.bat
/usr/local/Cellar/elixir/HEAD/bin/mix.bat
==> Summary
/usr/local/Cellar/elixir/HEAD: 11 files, 44K, built in 70 seconds
brew install --HEAD 34.22s user 19.68s system 1% cpu 1:06:46.18 total
millisami at sachin in ~
○ iex ruby-1.9.3-p194
zsh: correct 'iex' to 'lex' [nyae]? n
{"init terminating in do_boot",{undef,[{elixir,start_cli,[],[]},{init,start_it,1,[]},{init,start_em,1,[]}]}}
Crash dump was written to: erl_crash.dump
init terminating in do_boot ()
millisami at sachin in ~1 ↵
@millisami Yes, this no longer works for Elixir master. I will update this soon on my fork: https://gist.github.com/1968046 I will let you know when.
@millisami the formula at https://gist.github.com/1968046 is up to date and ready to go!
@josevalim Thanks, I'll try it out.
@josevalim, yup that works. Now heading to the doc site and do play-around.
Question, can we specify the erlang version we depend on? We need at least Erlang R15B. :)