2022-10-08 20:46:44 +03:00
|
|
|
# Roc installation guide for x86_64 macOS systems
|
2022-08-27 08:51:57 +03:00
|
|
|
|
|
|
|
## How to install Roc
|
|
|
|
|
2022-09-07 08:24:24 +03:00
|
|
|
In order to develop in Roc, you need to install the Roc CLI,
|
|
|
|
which includes the Roc compiler and various helpful utilities.
|
|
|
|
|
2022-08-27 08:51:57 +03:00
|
|
|
1. Download the latest nightly from the assets [here](https://github.com/roc-lang/roc/releases).
|
|
|
|
|
|
|
|
1. To prevent "roc can't be opened because Apple can't check it...":
|
|
|
|
|
|
|
|
```sh
|
2022-08-12 22:24:09 +03:00
|
|
|
xattr -d com.apple.quarantine roc_nightly-macos_x86_64-<VERSION>.tar.gz
|
2022-06-28 19:51:28 +03:00
|
|
|
```
|
2022-08-27 08:51:57 +03:00
|
|
|
|
|
|
|
1. Untar the archive:
|
|
|
|
|
|
|
|
```sh
|
2022-09-23 19:21:23 +03:00
|
|
|
mkdir roc_nightly-macos_x86_64-<VERSION>
|
|
|
|
tar xf roc_nightly-macos_x86_64-<VERSION>.tar.gz --directory roc_nightly-macos_x86_64-<VERSION>
|
2022-09-19 19:13:41 +03:00
|
|
|
cd roc_night<TAB TO AUTOCOMPLETE>
|
2022-06-28 19:51:28 +03:00
|
|
|
```
|
2022-08-27 08:51:57 +03:00
|
|
|
|
2022-09-07 08:24:24 +03:00
|
|
|
## How to install Roc platform dependencies
|
|
|
|
|
|
|
|
In order to compile Roc apps (either in `examples/` or in your own projects),
|
|
|
|
you need to install one or more of these platform language compilers, too.
|
2022-08-27 08:51:57 +03:00
|
|
|
|
2022-09-07 08:15:00 +03:00
|
|
|
1. Install the Rust compiler, for apps with Rust-based platforms:
|
2022-08-27 08:51:57 +03:00
|
|
|
|
|
|
|
```sh
|
2022-06-28 19:51:28 +03:00
|
|
|
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
|
|
|
|
```
|
2022-08-27 08:51:57 +03:00
|
|
|
|
2022-09-07 08:15:00 +03:00
|
|
|
1. Install the Zig compiler, for apps with Zig-based platforms:
|
2022-08-27 08:51:57 +03:00
|
|
|
|
|
|
|
```sh
|
2022-06-28 19:51:28 +03:00
|
|
|
brew install zig
|
|
|
|
```
|
2022-08-27 08:51:57 +03:00
|
|
|
|
|
|
|
1. Run examples:
|
|
|
|
|
|
|
|
```sh
|
|
|
|
# Note: If you installed rust in this terminal session, you'll need to open a new one first!
|
2022-09-12 06:52:48 +03:00
|
|
|
./roc crates/cli_testing_examples/platform-switching/rocLovesRust.roc
|
2022-08-27 08:51:57 +03:00
|
|
|
|
2022-09-12 06:52:48 +03:00
|
|
|
./roc crates/cli_testing_examples/platform-switching/rocLovesZig.roc
|
2022-08-27 08:51:57 +03:00
|
|
|
|
2022-09-12 06:52:48 +03:00
|
|
|
./roc crates/cli_testing_examples/platform-switching/rocLovesC.roc
|
2022-06-28 19:51:28 +03:00
|
|
|
```
|