Skip to content

Commit

Permalink
Attempt to get elm-format building on apple silicon
Browse files Browse the repository at this point in the history
  • Loading branch information
mloughran committed Jul 10, 2022
1 parent ffef759 commit a36f62f
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions Formula/elm-format.rb
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ class ElmFormat < Formula

depends_on "cabal-install" => :build
depends_on "haskell-stack" => :build
depends_on arch: :x86_64 # no ghc (OSX,AArch64) binary via `haskell-stack`

uses_from_macos "xz" => :build # for `haskell-stack` to unpack ghc

Expand All @@ -30,8 +29,11 @@ def install
# in Homebrew. Try using Homebrew `ghc` on update. Optionally, consider adding `ghcup`
# as a lighter-weight alternative to `haskell-stack` for installing particular ghc version.
jobs = ENV.make_jobs
ENV.deparallelize { system "stack", "-j#{jobs}", "setup", "8.10.4", "--stack-root", buildpath/".stack" }
ENV.deparallelize { system "stack", "-j#{jobs}", "setup", "8.10.7", "--stack-root", buildpath/".stack" }
ENV.prepend_path "PATH", Dir[buildpath/".stack/programs/*/ghc-*/bin"].first

system "sed", "-i", ".bak", "s/8.10.4/8.10.7/", "cabal.project"

system "cabal", "v2-update"

# Directly running `cabal v2-install` fails: Invalid file name in tar archive: "avh4-lib-0.0.0.1/../"
Expand Down

0 comments on commit a36f62f

Please sign in to comment.