@@ -24,6 +24,12 @@ class Agda < Formula
24
24
resource "categories" do
25
25
url "https://github.com/agda/agda-categories/archive/refs/tags/v0.2.0.tar.gz"
26
26
sha256 "a4bf97bf0966ba81553a2dad32f6c9a38cd74b4c86f23f23f701b424549f9015"
27
+
28
+ # Backport support for stdlib 2.1
29
+ patch do
30
+ url "https://github.com/agda/agda-categories/commit/ac0d9d27a402305f6774a6343f7a21a229822168.patch?full_index=1"
31
+ sha256 "50dc97c97898c825dd4c85fffc8452dc3e61a7871aa907d65b1711e5642c05fc"
32
+ end
27
33
end
28
34
29
35
resource "agda2hs" do
@@ -78,7 +84,21 @@ class Agda < Formula
78
84
uses_from_macos "zlib"
79
85
80
86
def install
81
- cabal_args = std_cabal_v2_args . reject { |s | s [ "installdir" ] }
87
+ # Workaround for GHC 9.12 until official support is available
88
+ # Issue ref: https://github.com/agda/agda/issues/7574
89
+ ghc912_args = %w[
90
+ --allow-newer=Agda:base
91
+ --allow-newer=agda-stdlib-utils:base
92
+ --allow-newer=agda2hs:base
93
+ --allow-newer=agda2hs:filepath
94
+ ]
95
+ # Workaround for https://github.com/agda/agda/commit/e11ae9875470aab7b68b98d9d9574e736dbcaddd
96
+ ghc912_args << "--allow-newer=Agda:hashable"
97
+ # Workaround to build with GHC 9.12, remove after https://github.com/haskell/aeson/pull/1126
98
+ # is merged and available on Hackage or if `aeson` is willing to provide a metadata revision
99
+ ghc912_args << "--allow-newer=aeson:ghc-prim,aeson:template-haskell"
100
+
101
+ cabal_args = ghc912_args + std_cabal_v2_args . reject { |s | s [ "installdir" ] }
82
102
83
103
system "cabal" , "v2-update"
84
104
# expose certain packages for building and testing
@@ -89,7 +109,7 @@ def install
89
109
90
110
# install main Agda library and binaries
91
111
system "cabal" , "--store-dir=#{ libexec } " , "v2-install" ,
92
- "-foptimise- heavily", *std_cabal_v2_args
112
+ "--flags=optimise- heavily", *std_cabal_v2_args , * ghc912_args
93
113
94
114
# install agda2hs helper binary and library,
95
115
# relying on the Agda library just installed
@@ -109,7 +129,7 @@ def install
109
129
# Issue ref: https://github.com/agda/agda2hs/issues/347
110
130
inreplace "agda2hs.cabal" , /( base .*&&) < 4\. 20,/ , "\\ 1 < 4.21," , build . stable?
111
131
112
- system "cabal" , "--store-dir=#{ libexec } " , "v2-install" , *std_cabal_v2_args
132
+ system "cabal" , "--store-dir=#{ libexec } " , "v2-install" , *std_cabal_v2_args , * ghc912_args
113
133
end
114
134
115
135
# generate the standard library's documentation and vim highlighting files
0 commit comments