From d85aac0a130a81592485673d71d5c2ae85e2e970 Mon Sep 17 00:00:00 2001 From: Trevor Bergeron Date: Wed, 1 Sep 2021 20:33:46 -0400 Subject: [PATCH] readme: clarify build instructions --- README.md | 34 ++++++++++++++++++++++++---------- 1 file changed, 24 insertions(+), 10 deletions(-) diff --git a/README.md b/README.md index 5115e5a1..e0c38d3e 100644 --- a/README.md +++ b/README.md @@ -18,29 +18,43 @@ This README covers build instructions, for information on Cwtch itself please go Cwtch processes the following environment variables: - `CWTCH_HOME=` overrides the default storage path of `~/.cwtch` with what ever you choose -- `LOG_FILE=` will reroute all of libcwtch-go's logging to the specified file instead of the console +- `LOG_FILE=` will reroute all of libcwtch-go's logging to the specified file instead of the console - `LOG_LEVEL=debug` will set the log level to debug instead of info ## Building ### Getting Started -First you will need a valid [flutter sdk installation](https://flutter.dev/docs/get-started/install) -and run `flutter pub get` to fetch dependencies. - +First you will need a valid [flutter sdk installation](https://flutter.dev/docs/get-started/install). You will probably want to disable Analytics on the Flutter Tool: `flutter config --no-analytics` +This project uses the flutter `dev` channel, which you will need to switch to: `flutter channel dev; flutter upgrade`. + +Once flutter is set up, run `flutter pub get` from this project folder to fetch dependencies. + +By default a development version is built, which loads profiles from `$CWTCH_HOME/dev/`. +To build a release version and load normal profiles, add something like the +following to the `flutter build` commands below: +``` +--dart-define BUILD_VER="`git describe --tags --abbrev=1`" --dart-define BUILD_DATE="`date +%G-%m-%d-%H-%M`" +``` + ### Building on Linux (for Linux) -- run `fetch-libcwtch-go.sh`libCwtch-go to fetch a prebuild version of `libCwtch-go.so` go to `./linux`. Include `./linux` in `LD_LIBRARY_PATH` -- run `fetch-tor.sh` and/or ensure that `tor` is in `$PATH` -- run `flutter run -d linux` +- copy `libCwtch-go.so` to `linux/`, or run `fetch-libcwtch-go.sh` to download it +- set `LD_LIBRARY_PATH="$PWD/linux"` +- copy a `tor` binary to `linux/` or run `fetch-tor.sh` to download one +- run `flutter config --enable-linux-desktop` if you've never done so before +- optional: launch cwtch-ui directly by running `flutter run -d linux` +- to build cwtch-ui, run `flutter build linux` +- to package the build, run `linux/package-release.sh` ### Building on Windows (for Windows) -- run `fetch-libcwtch-go.ps1` to fetch a prebuild version of `libCwtch.dll` +- copy `libCwtch.dll` to `windows/`, or run `fetch-libcwtch-go.ps1` to download it - run `fetch-tor-win.ps1` to fetch Tor for windows -- run `flutter run -d windows` +- optional: launch cwtch-ui directly by running `flutter run -d windows` +- to build cwtch-ui, run `flutter build windows` ### Building on Linux/Windows (for Android) @@ -49,7 +63,7 @@ You will probably want to disable Analytics on the Flutter Tool: `flutter config ### Building on MacOS -- Navigate to https://git.openprivacy.ca/cwtch.im/libcwtch-go/releases and download the latest libCwtch.dylib into this folder +- Navigate to https://git.openprivacy.ca/cwtch.im/libcwtch-go/releases and download the latest libCwtch.dylib into this folder - Download and install Tor Browser (it's currently the only way to get tor for macos) - `flutter build macos` - `./macos/package-release.sh`