Skip to content

Commit

Permalink
texmath: workaround to build with GHC 9.12
Browse files Browse the repository at this point in the history
  • Loading branch information
cho-m committed Jan 14, 2025
1 parent b2d4b82 commit e1c479a
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions Formula/t/texmath.rb
Original file line number Diff line number Diff line change
@@ -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"
Expand All @@ -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 "<mn>2</mn>", pipe_output(bin/"texmath", "a^2 + b^2 = c^2")
assert_match "<mn>2</mn>", pipe_output(bin/"texmath", "a^2 + b^2 = c^2", 0)
end
end

0 comments on commit e1c479a

Please sign in to comment.