@@ -4,21 +4,31 @@ class Agda < Formula
44 # agda2hs.cabal specifies BSD-3-Clause but it installs an MIT LICENSE file.
55 # Everything else specifies MIT license and installs corresponding file.
66 license all_of : [ "MIT" , "BSD-3-Clause" ]
7- revision 2
87
98 stable do
10- url "https://github.com/agda/agda/archive/refs/tags/v2.6.4.3-r1.tar.gz"
11- sha256 "15a0ebf08b71ebda0510c8cad04b053beeec653ed26e2c537614a80de8b2e132"
12- version "2.6.4.3"
9+ url "https://github.com/agda/agda/archive/refs/tags/v2.7.0.1.tar.gz"
10+ sha256 "4a2c0a76c55368e1b70b157b3d35a82e073a0df8f587efa1e9aa8be3f89235be"
1311
1412 resource "stdlib" do
15- url "https://github.com/agda/agda-stdlib/archive/refs/tags/v2.1.tar.gz"
16- sha256 "72ca3ea25094efa0439e106f0d949330414232ec4cc5c3c3316e7e70dd06d431"
13+ url "https://github.com/agda/agda-stdlib/archive/refs/tags/v2.2.tar.gz"
14+ sha256 "588f94af7fedd5aa1a6a1f0afdfb602d3e4615c7a17e6a0ae9dff326583b7a12"
15+
16+ # Backport support for building with GHC 9.12
17+ patch do
18+ url "https://github.com/agda/agda-stdlib/commit/a78700653de116b1043ce5d80bbe99482a705ecc.patch?full_index=1"
19+ sha256 "547af4793368a7b37d7b707cc25d0b87bab674233ed69d38d4d685c28e574a58"
20+ end
1721 end
1822
1923 resource "cubical" do
2024 url "https://github.com/agda/cubical/archive/refs/tags/v0.7.tar.gz"
2125 sha256 "25a0d1a0a01ba81888a74dfe864883547dbc1b06fa89ac842db13796b7389641"
26+
27+ # Bump Agda compat
28+ patch do
29+ url "https://github.com/agda/cubical/commit/6220641fc7c297a84c5e2c49614fae518cf6307d.patch?full_index=1"
30+ sha256 "c6919e394ac9dc6efa016fa6b4e9163ce58142d48f7100b6bc354678fc982986"
31+ end
2232 end
2333
2434 resource "categories" do
@@ -35,8 +45,8 @@ class Agda < Formula
3545 end
3646
3747 resource "agda2hs" do
38- url "https://github.com/agda/agda2hs/archive/refs/tags/v1.2 .tar.gz"
39- sha256 "e80ffc90ff2ccb3933bf89a39ab16d920a6c7a7461a6d182faa0fb6c0446dbb8 "
48+ url "https://github.com/agda/agda2hs/archive/refs/tags/v1.3 .tar.gz"
49+ sha256 "0e2c11eae0af459d4c78c24efadb9a4725d12c951f9d94da4adda5a0bcb1b6f6 "
4050 end
4151 end
4252
@@ -48,13 +58,12 @@ class Agda < Formula
4858 end
4959
5060 bottle do
51- rebuild 2
52- sha256 arm64_sequoia : "4b97635a593e1b6c9cc86442bebf1965ab8044978d4a9b2beef8f72d19644f0e"
53- sha256 arm64_sonoma : "3a7273b7e8f396137877528655f277589aa099436b4b89d3c0d9b7410325c407"
54- sha256 arm64_ventura : "374ba6e21398191f1777853e880ef1a4cd972052c9f7f9d06bc95a6e22f6d1bc"
55- sha256 sonoma : "1b5f5bc0d740c168e40cff9c407a34eedee29954dc9be47f4b400597498b73ee"
56- sha256 ventura : "af45d9a99fecc0242a489e0e56d2567204ce626916c045bca10d62b34de1452a"
57- sha256 x86_64_linux : "282d393806f0f432e5443baab37c57a231e14d0922d99d54b8cc40e5a04ce589"
61+ sha256 arm64_sequoia : "26f559c86caad9341ce407bbd0bc27451c346b814167a87df05e62740539fcfb"
62+ sha256 arm64_sonoma : "a384bc06a0e0d478fa3313984627acbf93e6b01ea1856828aa3ee29b9c5bb649"
63+ sha256 arm64_ventura : "63f087212f64b6c2a7aeac2c71c57d73bc21de6e10dca4026137e8f6b2530bf6"
64+ sha256 sonoma : "b88e608820b221fc925da7673af0b203f7c7c5b2a4ef5828dc1cf842142273f5"
65+ sha256 ventura : "d918822220ae771dd172a852969304550df86e1ddd3a698b722b1b53cc786918"
66+ sha256 x86_64_linux : "22fe1ee4a776725bf50597804430a5429d706963578acf7461fe1fb1c0cb5dfa"
5867 end
5968
6069 head do
@@ -86,37 +95,30 @@ class Agda < Formula
8695
8796 def install
8897 agda2hs = buildpath /"agda2hs"
89- agdalib = lib / "agda"
98+ agdalib = pkgshare # for write permissions needed to re-generate .agdai when using different options
9099 cubicallib = agdalib /"cubical"
91100 categorieslib = agdalib /"categories"
92101
102+ # Add a backwards compatibility symlink. Can consider removing in a future release
103+ lib . install_symlink pkgshare
104+
93105 resource ( "agda2hs" ) . stage agda2hs
94106 resource ( "stdlib" ) . stage agdalib
95107 resource ( "cubical" ) . stage cubicallib
96108 resource ( "categories" ) . stage categorieslib
97109
98- # Backport part of https://github.com/agda/agda- stdlib/commit/a78700653de116b1043ce5d80bbe99482a705ecc
99- inreplace agdalib /"agda-stdlib-utils.cabal " , /( base .*) < 4 \. 21 $/ , "\\ 1 < 4.22" if build . stable?
110+ # Remove strict stdlib version check in categories
111+ inreplace categorieslib /"agda-categories.agda-lib " , /(standard-library)-2 \. 1 $/ , "\\ 1" , audit_result : build . stable?
100112
101113 ( buildpath /"cabal.project.local" ) . write <<~HASKELL
102114 packages: . #{ agda2hs }
103115 package Agda
104116 flags: +optimise-heavily
117+ -- Workaround for GHC 9.12 until official supported, https://github.com/agda/agda/issues/7574
118+ allow-newer: Agda:base, agda2hs:base, agda2hs:filepath
105119 HASKELL
106120
107- cabal_args = std_cabal_v2_args
108- # Workaround for GHC 9.12 until official support is available
109- # Issue ref: https://github.com/agda/agda/issues/7574
110- cabal_args += %w[
111- --allow-newer=Agda:base
112- --allow-newer=agda2hs:base
113- --allow-newer=agda2hs:filepath
114- ]
115- # Workaround for https://github.com/agda/agda/commit/e11ae9875470aab7b68b98d9d9574e736dbcaddd
116- if build . stable?
117- odie "Remove allow-newer hashable workaround!" if version > "2.6.4.3"
118- cabal_args << "--allow-newer=Agda:hashable"
119- end
121+ cabal_args = std_cabal_v2_args . map { |s | s . sub "=copy" , "=symlink" }
120122 # Reduce install size by dynamically linking to shared libraries in store-dir
121123 # TODO: Linux support, related issue https://github.com/haskell/cabal/issues/9784
122124 cabal_args += %w[ --enable-executable-dynamic --enable-shared ] if OS . mac?
@@ -161,12 +163,12 @@ module Everything where
161163
162164 # write out the example libraries and defaults files for users to copy
163165 ( agdalib /"example-libraries" ) . write <<~TEXT
164- #{ opt_lib } /agda /standard-library.agda-lib
165- #{ opt_lib } /agda /doc/standard-library-doc.agda-lib
166- #{ opt_lib } /agda /tests/standard-library-tests.agda-lib
167- #{ opt_lib } /agda /cubical/cubical.agda-lib
168- #{ opt_lib } /agda /categories/agda-categories.agda-lib
169- #{ opt_lib } /agda /agda2hs/agda2hs.agda-lib
166+ #{ opt_pkgshare } /standard-library.agda-lib
167+ #{ opt_pkgshare } /doc/standard-library-doc.agda-lib
168+ #{ opt_pkgshare } /tests/standard-library-tests.agda-lib
169+ #{ opt_pkgshare } /cubical/cubical.agda-lib
170+ #{ opt_pkgshare } /categories/agda-categories.agda-lib
171+ #{ opt_pkgshare } /agda2hs/agda2hs.agda-lib
170172 TEXT
171173 ( agdalib /"example-defaults" ) . write <<~TEXT
172174 standard-library
@@ -181,20 +183,20 @@ def caveats
181183 To use the installed Agda libraries, execute the following commands:
182184
183185 mkdir -p $HOME/.config/agda
184- cp #{ opt_lib } /agda /example-libraries $HOME/.config/agda/libraries
185- cp #{ opt_lib } /agda /example-defaults $HOME/.config/agda/defaults
186+ cp #{ opt_pkgshare } /example-libraries $HOME/.config/agda/libraries
187+ cp #{ opt_pkgshare } /example-defaults $HOME/.config/agda/defaults
186188
187189 You can then inspect the copied files and customize them as needed.
188190 EOS
189191 end
190192
191193 test do
192- Pathname ( "#{ Dir . home } /.config/agda" ) . install_symlink opt_lib / "agda/ example-libraries" => "libraries"
193- Pathname ( "#{ Dir . home } /.config/agda" ) . install_symlink opt_lib / "agda/ example-defaults" => "defaults"
194+ Pathname ( "#{ Dir . home } /.config/agda" ) . install_symlink opt_pkgshare / " example-libraries" => "libraries"
195+ Pathname ( "#{ Dir . home } /.config/agda" ) . install_symlink opt_pkgshare / " example-defaults" => "defaults"
194196
195197 simpletest = testpath /"SimpleTest.agda"
196198 simpletest . write <<~AGDA
197- {-# OPTIONS --safe --without-K #-}
199+ {-# OPTIONS --safe --cubical-compatible #-}
198200 module SimpleTest where
199201
200202 infix 4 _≡_
@@ -266,6 +268,7 @@ module IOTest where
266268 agda2hstest = testpath /"Agda2HsTest.agda"
267269 agda2hstest . write <<~AGDA
268270 {-# OPTIONS --erasure #-}
271+ module Agda2HsTest where
269272 open import Haskell.Prelude
270273
271274 _≤_ : {{Ord a}} → a → a → Set
@@ -302,9 +305,8 @@ module Agda2HsTest where
302305 # compile a simple module using the JS backend
303306 system bin /"agda" , "--js" , simpletest
304307
305- # test the GHC backend;
306- # compile and run a simple program
307- system bin /"agda" , "--ghc-flag=-fno-warn-star-is-type" , "--compile" , iotest
308+ # test the GHC backend; compile and run a simple program
309+ system bin /"agda" , "--compile" , iotest
308310 assert_empty shell_output ( testpath /"IOTest" )
309311
310312 # translate a simple file via agda2hs
0 commit comments