Skip to content

Commit 556b6b5

Browse files
authored
Merge pull request Homebrew#181302 from Homebrew/cgrep-ghc910
cgrep: use `ghc` to build
2 parents 13aaa7e + cb442cf commit 556b6b5

File tree

1 file changed

+20
-2
lines changed

1 file changed

+20
-2
lines changed

Formula/c/cgrep.rb

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,15 +17,33 @@ class Cgrep < Formula
1717
end
1818

1919
depends_on "cabal-install" => :build
20-
depends_on "ghc@9.4" => :build
20+
depends_on "ghc" => :build
2121
depends_on "pkg-config" => :build
2222
depends_on "pcre"
2323

2424
conflicts_with "aerleon", because: "both install `cgrep` binaries"
2525

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+
2633
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+
2745
system "cabal", "v2-update"
28-
system "cabal", "v2-install", *std_cabal_v2_args
46+
system "cabal", "v2-install", *constraints, *std_cabal_v2_args
2947
end
3048

3149
test do

0 commit comments

Comments
 (0)