@@ -17,15 +17,33 @@ class Cgrep < Formula
17
17
end
18
18
19
19
depends_on "cabal-install" => :build
20
- depends_on "ghc@9.4 " => :build
20
+ depends_on "ghc" => :build
21
21
depends_on "pkg-config" => :build
22
22
depends_on "pcre"
23
23
24
24
conflicts_with "aerleon" , because : "both install `cgrep` binaries"
25
25
26
+ resource "rawfilepath" do
27
+ on_macos do
28
+ url "https://hackage.haskell.org/package/rawfilepath-1.1.1/rawfilepath-1.1.1.tar.gz"
29
+ sha256 "43f879da83b7b07c30e76a3c31d5362b7b6bb8e235c2698872b92b9fcce3bf69"
30
+ end
31
+ end
32
+
26
33
def install
34
+ # Work around "error: call to undeclared function 'execvpe'" by imitating part of removed
35
+ # hack in https://github.com/haskell/unix/commit/b8eb2486b15d564e73ef9307e175ac24a186acd2
36
+ # Issue ref: https://github.com/xtendo-org/rawfilepath/issues/13
37
+ if OS . mac?
38
+ ( buildpath /"cabal.project.local" ) . write "packages: . rawfilepath/"
39
+ ( buildpath /"rawfilepath" ) . install resource ( "rawfilepath" )
40
+ inreplace "rawfilepath/cbits/runProcess.c" , " execvpe(" , " __hsunix_execvpe("
41
+ end
42
+ # Help resolver pick package versions compatible with newer GHC
43
+ constraints = [ "--constraint=async>=2" ]
44
+
27
45
system "cabal" , "v2-update"
28
- system "cabal" , "v2-install" , *std_cabal_v2_args
46
+ system "cabal" , "v2-install" , *constraints , * std_cabal_v2_args
29
47
end
30
48
31
49
test do
0 commit comments