diff --git a/Formula/c/cgrep.rb b/Formula/c/cgrep.rb index eb541bcde3d5f..3c36f10be79e8 100644 --- a/Formula/c/cgrep.rb +++ b/Formula/c/cgrep.rb @@ -1,6 +1,7 @@ class Cgrep < Formula desc "Context-aware grep for source code" homepage "https://github.com/awgn/cgrep" + # TODO: Check if `rawfilepath` workaround and `aeson` allow-newer workaround can be removed url "https://github.com/awgn/cgrep/archive/refs/tags/v8.1.2.tar.gz" sha256 "1b705013a432e6ea90247f03e4cfeceb5a37f795d879178e4bf0085ce6191316" license "GPL-2.0-or-later" @@ -42,6 +43,9 @@ def install end # Help resolver pick package versions compatible with newer GHC constraints = ["--constraint=async>=2"] + # Workaround to build with GHC 9.12, remove after https://github.com/haskell/aeson/pull/1126 + # is merged and available on Hackage or if `aeson` is willing to provide a metadata revision + constraints << "--allow-newer=aeson:ghc-prim,aeson:template-haskell" system "cabal", "v2-update" system "cabal", "v2-install", *constraints, *std_cabal_v2_args diff --git a/Formula/h/hpack.rb b/Formula/h/hpack.rb index adbfa26237c20..0c89d6b161bcd 100644 --- a/Formula/h/hpack.rb +++ b/Formula/h/hpack.rb @@ -1,6 +1,7 @@ class Hpack < Formula desc "Modern format for Haskell packages" homepage "https://github.com/sol/hpack" + # TODO: Check if `aeson` allow-newer workaround can be removed url "https://github.com/sol/hpack/archive/refs/tags/0.37.0.tar.gz" sha256 "5d292d70744435d67586f9a8a759debbf160cb70a069a8d65403f123fac84091" license "MIT" @@ -23,8 +24,12 @@ class Hpack < Formula uses_from_macos "zlib" def install + # Workaround to build with GHC 9.12, remove after https://github.com/haskell/aeson/pull/1126 + # is merged and available on Hackage or if `aeson` is willing to provide a metadata revision + args = ["--allow-newer=aeson:ghc-prim,aeson:template-haskell"] + system "cabal", "v2-update" - system "cabal", "v2-install", *std_cabal_v2_args + system "cabal", "v2-install", *args, *std_cabal_v2_args end # Testing hpack is complicated by the fact that it is not guaranteed diff --git a/Formula/s/shellcheck.rb b/Formula/s/shellcheck.rb index 64d71309a592d..c589f42062b02 100644 --- a/Formula/s/shellcheck.rb +++ b/Formula/s/shellcheck.rb @@ -5,6 +5,7 @@ class Shellcheck < Formula head "https://github.com/koalaman/shellcheck.git", branch: "master" stable do + # TODO: Check if `aeson` allow-newer workaround can be removed url "https://github.com/koalaman/shellcheck/archive/refs/tags/v0.10.0.tar.gz" sha256 "149ef8f90c0ccb8a5a9e64d2b8cdd079ac29f7d2f5a263ba64087093e9135050" @@ -31,8 +32,12 @@ class Shellcheck < Formula depends_on "pandoc" => :build def install + # Workaround to build with GHC 9.12, remove after https://github.com/haskell/aeson/pull/1126 + # is merged and available on Hackage or if `aeson` is willing to provide a metadata revision + args = ["--allow-newer=aeson:ghc-prim,aeson:template-haskell"] + system "cabal", "v2-update" - system "cabal", "v2-install", *std_cabal_v2_args + system "cabal", "v2-install", *args, *std_cabal_v2_args system "./manpage" man1.install "shellcheck.1" end diff --git a/Formula/s/skylighting.rb b/Formula/s/skylighting.rb index 48a781a042b15..6961155a95dee 100644 --- a/Formula/s/skylighting.rb +++ b/Formula/s/skylighting.rb @@ -1,6 +1,7 @@ class Skylighting < Formula desc "Flexible syntax highlighter using KDE XML syntax descriptions" homepage "https://github.com/jgm/skylighting" + # TODO: Check if `aeson` allow-newer workaround can be removed url "https://github.com/jgm/skylighting/archive/refs/tags/0.14.6.tar.gz" sha256 "73417bbc85c1e11fb2bdaf565629e6bb78c71694d70d436bd5dcbc5b906507e7" license "GPL-2.0-or-later" @@ -21,18 +22,22 @@ class Skylighting < Formula uses_from_macos "zlib" def install + # Workaround to build with GHC 9.12, remove after https://github.com/haskell/aeson/pull/1126 + # is merged and available on Hackage or if `aeson` is willing to provide a metadata revision + args = ["--allow-newer=aeson:ghc-prim,aeson:template-haskell"] + system "cabal", "v2-update" # moving this file aside during the first package's compilation avoids # spurious errors about undeclared autogenerated modules mv buildpath/"skylighting/skylighting.cabal", buildpath/"skylighting.cabal.temp-loc" - system "cabal", "v2-install", buildpath/"skylighting-core", "-fexecutable", *std_cabal_v2_args + system "cabal", "v2-install", buildpath/"skylighting-core", "--flags=executable", *args, *std_cabal_v2_args mv buildpath/"skylighting.cabal.temp-loc", buildpath/"skylighting/skylighting.cabal" cd "skylighting" do system bin/"skylighting-extract", buildpath/"skylighting-core/xml" end - system "cabal", "v2-install", buildpath/"skylighting", "-fexecutable", *std_cabal_v2_args + system "cabal", "v2-install", buildpath/"skylighting", "--flags=executable", *args, *std_cabal_v2_args end test do diff --git a/Formula/t/texmath.rb b/Formula/t/texmath.rb index 3a6b156efa622..4c3ed48868aed 100644 --- a/Formula/t/texmath.rb +++ b/Formula/t/texmath.rb @@ -1,6 +1,7 @@ class Texmath < Formula desc "Haskell library for converting LaTeX math to MathML" homepage "https://johnmacfarlane.net/texmath.html" + # TODO: Check if `aeson` allow-newer workaround can be removed url "https://hackage.haskell.org/package/texmath-0.12.8.13/texmath-0.12.8.13.tar.gz" sha256 "bb51a51f69d02c7fed411739d61bff62d56865719542bba995c66e5abe96e409" license "GPL-2.0-or-later" @@ -19,11 +20,15 @@ class Texmath < Formula depends_on "ghc" => :build def install + # Workaround to build with GHC 9.12, remove after https://github.com/haskell/aeson/pull/1126 + # is merged and available on Hackage or if `aeson` is willing to provide a metadata revision + args = ["--allow-newer=aeson:ghc-prim,aeson:template-haskell"] + system "cabal", "v2-update" - system "cabal", "v2-install", *std_cabal_v2_args, "-fexecutable" + system "cabal", "v2-install", "--flags=executable", *args, *std_cabal_v2_args end test do - assert_match "2", pipe_output(bin/"texmath", "a^2 + b^2 = c^2") + assert_match "2", pipe_output(bin/"texmath", "a^2 + b^2 = c^2", 0) end end