Skip to content

Commit

Permalink
Lookup at gpatch before patch on macOS now that both homebrew and mac…
Browse files Browse the repository at this point in the history
…ports expose gpatch as gpatch

Homebrew changed behaviour in Homebrew/homebrew-core#174687
  • Loading branch information
kit-ty-kate committed Oct 22, 2024
1 parent f0ba0c2 commit 9d0e84f
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 1 deletion.
1 change: 1 addition & 0 deletions .github/workflows/ci.ml
Original file line number Diff line number Diff line change
Expand Up @@ -333,6 +333,7 @@ let main_build_job ~analyse_job ~cygwin_job ?section runner start_version ~oc ~w
let host = host_of_platform platform in
job ~oc ~workflow ~runs_on:(Runner [runner]) ?shell ?section ~needs ~matrix ("Build-" ^ name_of_platform platform)
++ only_on Linux (run "Install bubblewrap" ["sudo apt install bubblewrap"])
++ only_on MacOS (run "Install GNU patch" ["brew install gpatch"])
++ only_on Windows (git_lf_checkouts ~cond:(Predicate(true, EndsWith("matrix.host", "-pc-cygwin"))) ~shell:"cmd" ~title:"Configure LF checkout for Cygwin" ())
++ checkout ()
++ only_on Windows (cache ~cond:(Predicate(true, Compare("matrix.build", "x86_64-pc-cygwin"))) Cygwin)
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -245,6 +245,8 @@ jobs:
ocamlv: [ 4.14.2, 5.2.0 ]
fail-fast: true
steps:
- name: Install GNU patch
run: brew install gpatch
- name: Checkout tree
uses: actions/checkout@v4
- name: src_ext/archives and opam-repository Cache
Expand Down
1 change: 1 addition & 0 deletions master_changes.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ users)
## Opamfile

## External dependencies
* Lookup at `gpatch` before `patch` on macOS now that both homebrew and macports expose `gpatch` as `gpatch` since Homebrew/homebrew-core#174687 [#6255 @kit-ty-kate]

## Format upgrade

Expand Down
2 changes: 1 addition & 1 deletion src/core/opamSystem.ml
Original file line number Diff line number Diff line change
Expand Up @@ -1570,12 +1570,12 @@ let gpatch = lazy begin
in
let default_cmd, other_cmds =
match OpamStd.Sys.os () with
| Darwin
| DragonFly
| FreeBSD
| NetBSD
| OpenBSD -> ("gpatch", ["patch"])
| Cygwin
| Darwin
| Linux
| Unix
| Win32
Expand Down

0 comments on commit 9d0e84f

Please sign in to comment.