Fix Ubuntu deps, clarify Linux support in README (#242)

Resolves #237.

* Fix Ubuntu deps, clarify Linux support in README

* Avoid using `sudo` if it's not installed
This commit is contained in:
Max Desiatov 2021-05-28 22:00:38 +01:00 committed by GitHub
parent 7204aa4e78
commit 10c21db4bf
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 15 additions and 8 deletions

View File

@ -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

View File

@ -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