Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Explore using brew for Mac #126

Open
gabrielflorit opened this issue Jan 29, 2016 · 8 comments
Open

Explore using brew for Mac #126

gabrielflorit opened this issue Jan 29, 2016 · 8 comments

Comments

@gabrielflorit
Copy link

Is anyone planning on writing a brew formula for this? Otherwise I could give it a try.

@avh4
Copy link
Owner

avh4 commented Jan 30, 2016

I don't know of anyone working on this. I would be happy to see this, but be warned that it's a bit painful because of the dependency on haskell. It also hopefully won't be needed for long because the goal for elm-format is to merge it into Elm-Platform within the next 3 months so that it will be distributed with Elm.

If you do want to look at this, here's a start that might help get haskell compilation working:

require "language/haskell"

class ElmFormat < Formula
  include Language::Haskell::Cabal

  desc "..."
  homepage "..."

  stable do
    url "..."
    sha256 "..."
  end

  bottle do
    sha256 "..." => :el_capitan
    sha256 "..." => :yosemite
    sha256 "..." => :mavericks
  end

  head do
    url "..."
  end

  depends_on "ghc" => :build
  depends_on "cabal-install" => :build

  def install
    cabal_sandbox do
      cabal_sandbox_add_source "elm-format"
      cabal_install "--only-dependencies", "elm-format"
      cabal_install "--prefix=#{prefix}", "elm-format"
    end
  end

  test do
    src_path = testpath/"Hello.elm"
    src_path.write <<-EOS.undent
      import Html exposing (text)
      main = text "Hello, world!"
    EOS

    system bin/"elm-format", testpath/"Hello.elm", "--yes"
    ## assert output is formatted
  end
end

@enilsen16
Copy link

I put this together with a little of help of what @avh4 posted above. enilsen16/homebrew@85f95f8

I am not sure homebrew will accept this formula until a stable version is released but I will try anyway. https://github.com/Homebrew/homebrew/blob/master/share/doc/homebrew/Acceptable-Formulae.md#stable-versions

@mgold
Copy link
Contributor

mgold commented Feb 14, 2016

If this is to become part of Elm Platform in the foreseeable future, there's no need to bother with Homebrew.

@gyzerok
Copy link
Contributor

gyzerok commented Jun 16, 2016

@avh4 what about the plans to move elm-format to the elm-platform?

@PublicParadise
Copy link

As mentioned in #84 it seems that brew support is partially working:

brew install --devel homebrew/devel-only/elm-format

After running that I got two elm-formats:

/usr/local/bin/elm-format-0.16
/usr/local/bin/elm-format-0.17

The only thing left to do was creating a symbolic link:

ln -s /usr/local/bin/elm-format-0.17 /usr/local/bin/elm-format

@franciscolourenco
Copy link

franciscolourenco commented Mar 6, 2017

I just came here after using the formula as it seems to install 3 versions but link none. The formula should only install the latest version. If other versions are needed there should be secondary formulas to those version. Is there a reason for 3 version to be installed automatically and none be linked?

@mloughran
Copy link

An elm-format formula exists for brew so I think this issue can be closed.

I have been using it for several years without issue (except for the lack of apple silicon support as discussed in #723 (comment)).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

8 participants