Skip to content

Commit

Permalink
Add support for testing on Apple silicon
Browse files Browse the repository at this point in the history
  • Loading branch information
DOBRO committed Jul 9, 2022
1 parent 2799941 commit 9e4d84d
Show file tree
Hide file tree
Showing 4 changed files with 45 additions and 4 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ jobs:
- name: Install Stockfish
run: brew install stockfish
- name: Start Stockfish TCP Server
run: launchctl load test/helper-files/org.stockfish.plist
run: launchctl load test/helper-files/org.stockfish.x86.plist
- name: Cache Hex packages
uses: actions/cache@v2
with:
Expand Down
15 changes: 12 additions & 3 deletions README.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,7 @@ binbo:print_board(Pid, [unicode, flip]).
The examples below assume that Stockfish is used as the chess engine and its path is `/usr/local/bin/stockfish`, change it according to your environment.
TCP service starts on local machine on port `9010`.

If you are on Linux, install `socat` and start TCP service. On macOS just use file `org.stockfish.plist` provided in the `test` folder (see below).
If you are on Linux, install `socat` and start TCP service. On macOS just use file `org.stockfish.x86.plist` (for Intel-based devices) or `org.stockfish.arm.plist` (for Apple silicon) provided in the `test` folder (see below).

.On Ubuntu/Debian:
[source,bash]
Expand All @@ -247,12 +247,21 @@ $ cd binbo
$ rebar3 shell
----

.On macOS:
.On macOS (Intel x86 Architecture):
[source,bash]
----
$ git clone https://github.com/DOBRO/binbo.git
$ cd binbo
$ launchctl load test/helper-files/org.stockfish.plist
$ launchctl load test/helper-files/org.stockfish.x86.plist
$ rebar3 shell
----

.On macOS (Apple silicon):
[source,bash]
----
$ git clone https://github.com/DOBRO/binbo.git
$ cd binbo
$ launchctl load test/helper-files/org.stockfish.arm.plist
$ rebar3 shell
----

Expand Down
32 changes: 32 additions & 0 deletions test/helper-files/org.stockfish.arm.plist
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Label</key>
<string>org.stockfishchess.stockfishd</string>

<key>ProgramArguments</key>
<array>
<string>/opt/homebrew/bin/stockfish</string>
</array>

<key>inetdCompatibility</key>
<dict>
<key>Wait</key>
<false/>
</dict>

<key>Sockets</key>
<dict>
<key>Listeners</key>
<dict>
<key>SockServiceName</key>
<string>9010</string>
<key>SockType</key>
<string>stream</string>
<key>SockFamily</key>
<string>IPv4</string>
</dict>
</dict>
</dict>
</plist>
File renamed without changes.

0 comments on commit 9e4d84d

Please sign in to comment.