AppFlowy/doc/BUILD_ON_LINUX.md
Alex to d965d26e60 Enable Linux build
1. BUILD_ON_LINUX.md is instruction of building Linux version
2. Update toml files in scripts/makefile/ and /Makefile.toml to support Linux

Building Windows/Linux release version is verified
Didn't get chance to verify building macos version
2021-11-19 12:09:56 +08:00

2.1 KiB

How to build on Linux, please follow these simple steps.

Step 1:

git clone https://github.com/AppFlowy-IO/appflowy.git

Step 2:

Note: Follow steps are verified on Ubuntu 20.04

  1. Install pre-requests
sudo apt-get install build-essential
sudo apt-get install libsqlite3-dev libssl-dev clang cmake ninja-build pkg-config libgtk-3-dev
  1. Install brew on Linux (TODO: rust installation should not depend on brew)
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
echo 'eval "$(/home/linuxbrew/.linuxbrew/bin/brew shellenv)"' >> /home/user/.profile
eval "$(/home/linuxbrew/.linuxbrew/bin/brew shellenv)"
  1. Install flutter according to https://docs.flutter.dev/get-started/install/linux
git clone https://github.com/flutter/flutter.git
cd flutter
echo "export PATH=\$PATH:"`pwd`"/bin" >> ~/.profile
export PATH="$PATH:`pwd`/flutter/bin"
flutter channel dev
flutter config --enable-linux-desktop
  1. Fix problem reported by flutter doctor
flutter doctor
# install Android toolchian (optional)
# install Chrome (optional)
  1. Install rust
# TODO: replace by rust offical installation step
brew install rustup-init
source $HOME/.cargo/env
rustup toolchain install nightly
rustup default nightly
  1. Install cargo make
cd appflowy
cargo install --force cargo-make
  1. Install duckscript
cargo install --force duckscript_cli
  1. Check pre-request
cargo make flowy_dev
  1. Generate protobuf for dart (optional)
cargo make -p development-linux-x86 pb
  1. Build flowy-sdk-dev (dart-ffi)
# TODO: for development

# for production
cargo make --profile production-linux-x86 flowy-sdk-release
  1. Build app_flowy
# TODO: for development

# for production
cargo make -p production-linux-x86 appflowy-linux
### tips
# run Linux GUI application through x11 on windows (use MobaXterm)
# export DISPLAY=localhost:10
# cd app_flowy/product/0.0.2/linux/Release/AppFlowy
# ./app_flowy

Step 3: Server side application

Note: You can launch postgresql server by using docker container

TBD