Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix Ubuntu deps, clarify Linux support in README #242

Merged
merged 2 commits into from
May 28, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 10 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,17 +42,19 @@ brew install swiftwasm/tap/carton
docker pull ghcr.io/swiftwasm/carton:latest
```

If Docker images are not suitable for you, you'll have to build `carton` from sources on Ubuntu, and
unfortunately other Linux distributions are currently not supported. Clone the repository and run
`swift build -c release`, the `carton` binary will be located in the `.build/release` directory
after that.
If Docker images are not suitable for you, you'll have to build `carton` from sources on Ubuntu.
Clone the repository and run `./install_ubuntu_deps.sh` in the root directory of the clone. After
that completes successfully, run `swift build -c release`, the `carton` binary will be located in
the `.build/release` directory after that. Unfortunately, other Linux distributions are currently
not supported.

### Usage

The `carton init` command initializes a new SwiftWasm project for you (similarly to `swift package init`) with multiple templates available at your choice. `carton init --template tokamak` creates a
new [Tokamak](https://tokamak.dev/) project, while `carton init --template basic` (equivalent to
`carton init`) creates an empty SwiftWasm project with no dependencies. Also, `carton init list-templates` provides a complete list of templates (with only `basic` and `tokamak` available
currently).
The `carton init` command initializes a new SwiftWasm project for you (similarly to
`swift package init`) with multiple templates available at your choice. `carton init --template tokamak`
creates a new [Tokamak](https://tokamak.dev/) project, while `carton init --template basic` (equivalent
to `carton init`) creates an empty SwiftWasm project with no dependencies. Also, `carton init list-templates`
provides a complete list of templates (with only `basic` and `tokamak` available currently).

The `carton dev` command builds your project with the SwiftWasm toolchain and starts an HTTP server
that hosts your WebAssembly executable and a corresponding JavaScript entrypoint that loads it. The
Expand Down
5 changes: 5 additions & 0 deletions install_ubuntu_deps.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@

set -ex

if [ -x "$(command -v sudo)" ]; then
sudo apt-get install zlib1g-dev
else
apt-get install zlib1g-dev
fi
curl -L -v -o binaryen.tar.gz https://github.com/WebAssembly/binaryen/releases/download/version_97/binaryen-version_97-x86_64-linux.tar.gz
tar xzvf binaryen.tar.gz
cp binaryen-version_97/bin/* /usr/local/bin