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

Added pre-requisites for building native modules on linux and updated native-node-modules.md #336

Closed
wants to merge 12 commits into from
Closed
65 changes: 65 additions & 0 deletions docs/linux-requirements.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
# Linux

The native modules include support for features like searching in encrypted rooms and secure storage.
Thus, skipping this step is fine, you just won't have those features in your build.

**NOTE:** Instructions are for Debian-derived distros other distros should adapt them as appropriate.
## Requirements to build native modules
ttheshreeyasingh marked this conversation as resolved.
Show resolved Hide resolved

ttheshreeyasingh marked this conversation as resolved.
Show resolved Hide resolved
If you want to build native modules, make sure that the following tools are installed on your system.
If they're not already installed on your system, you can run the following commands to install them:
```
sudo apt install pkg-config
sudo apt install pkgconf
sudo apt install libsecret-1-dev
```

- [Node 14](https://nodejs.org)

You can run the following commands to install Node 14:
```
curl -sL https://deb.nodesource.com/setup_14.x | sudo bash -
sudo apt -y install nodejs
```

Verify the version of Node.js installed. (Latest version is preferred)
```
node -v
```

Install the Node dev tools and the yarn package manager using the following commands:
```
sudo apt -y install gcc g++ make
curl -sL https://dl.yarnpkg.com/debian/pubkey.gpg | sudo apt-key add -
echo "deb https://dl.yarnpkg.com/debian/ stable main" | sudo tee /etc/apt/sources.list.d/yarn.list
sudo apt update && sudo apt install yarn
```

Verify the version of Yarn installed. (Must be v1)
```
yarn -v
```

- [Python 3](https://www.python.org/downloads/)

You can run the following commands to install Python 3:
```
sudo apt-get install python3.6
python3 --version
```

- [Strawberry Perl](https://strawberryperl.com/)
ttheshreeyasingh marked this conversation as resolved.
Show resolved Hide resolved

- [Rust](https://rustup.rs/)

Run the following in your terminal, then follow the on-screen instructions.
```
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
```

- [SQLCipher](https://www.zetetic.net/sqlcipher/)
```
sudo apt install sqlcipher
sudo apt install libsqlcipher-dev
```

25 changes: 18 additions & 7 deletions docs/native-node-modules.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,13 @@ when releasing.
Install the pre-requisites for your system:

* [Windows pre-requisites](https://github.com/vector-im/element-desktop/blob/develop/docs/windows-requirements.md)
* Linux: TODO
* [Linux pre-requisites](https://github.com/vector-im/element-desktop/blob/develop/docs/linux-requirements.md)
* OS X: TODO

Then optionally, [add seshat and dependencies to support search in E2E rooms](#adding-seshat-for-search-in-e2e-encrypted-rooms).

Then, to build for an architecture selected automatically based on your system (recommended), run:
Then, to build for an architecture selected automatically based on your system
(recommended), run:
```
yarn run build:native
```
Expand All @@ -36,14 +37,24 @@ Seshat is a native Node module that adds support for local event indexing and
full text search in E2E encrypted rooms.

Since Seshat is written in Rust, the Rust compiler and related tools need to be
installed before installing Seshat itself. To install Rust please consult the
official Rust [documentation](https://www.rust-lang.org/tools/install).
installed before installing Seshat itself. If you're running macOS, Linux, or
another Unix-like OS, to download Rustup and install Rust, run the following in
your terminal, then follow the on-screen instructions.
```
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
```

Or you can consult the official Rust [documentation](https://www.rust-lang.org/tools/install).

Seshat also depends on the SQLCipher library to store its data in encrypted form
on disk. You'll need to install it via your OS package manager.
on disk. You'll need to install it via your OS package manager,on Debian/Ubuntu run:
```
sudo apt install sqlcipher
sudo apt install libsqlcipher-dev
```

After installing the Rust compiler and SQLCipher, Seshat support can be added
using yarn at the root of this project:
After installing the Rust compiler and SQLCipher along with libsqlcipher, Seshat
support can be added using yarn at the root of this project:

yarn add matrix-seshat

Expand Down