readme: clarify build instructions #167
34
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`.
|
||||
|
||||
mal marked this conversation as resolved
Outdated
|
||||
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
|
||||
mal marked this conversation as resolved
Outdated
dan
commented
might want to explain what a release build is (why it's different) which is building a local "dev" copy like this normally we use $CWTCH_HOME/dev/ for the profiles and the only way to make it use the $CWTCH_HOME is "release build" with these variables defined might want to explain what a release build is (why it's different) which is building a local "dev" copy like this normally we use $CWTCH_HOME/dev/ for the profiles and the only way to make it use the $CWTCH_HOME is "release build" with these variables defined
|
||||
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
|
||||
mal marked this conversation as resolved
Outdated
dan
commented
shoot was this neccesary? i guess i have tor installed on my system and assumed the pathing grabbed it from here for those who didn't. In this case it might be better to add another shoot was this neccesary? i guess i have tor installed on my system and assumed the pathing grabbed it from here for those who didn't. In this case it might be better to add another `if ( path check ) { }` to the tor bundled detection code in lib/cwtch/ffi.dart rather than having ppl set the path?
mal
commented
I kept it because it was there before, but cwtch does find linux/tor without changing $PATH as long as $PWD is the project root. Will remove. I kept it because it was there before, but cwtch does find linux/tor without changing $PATH as long as $PWD is the project root. Will remove.
https://git.openprivacy.ca/cwtch.im/cwtch-ui/src/commit/bc24c7f3c7f4cc5ca8694204951dedf55714ad68/lib/cwtch/ffi.dart#L102
|
||||
- run `flutter config --enable-linux-desktop` if you've never done so before
|
||||
mal marked this conversation as resolved
Outdated
dan
commented
the docs weren't super clear here, I thought this was just an operation that had to be done once to the repo project to auto gen files under the docs weren't super clear here, I thought this was just an operation that had to be done once to the repo project to auto gen files under `linux/` and not per checkout for each dev
mal
commented
Until I did the --enable, Until I did the --enable, `flutter run` gave "No devices found with name or id matching 'linux'" - so it seems to be a global flutter config option. I used archlinux AUR `flutter`/`flutter-beta` packages though, so it's possible those have different defaults.
dan
commented
eeeesh, ah well, cool! eeeesh, ah well, cool!
|
||||
- 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`
|
||||
|
|
ah yeah we're on the dev channel :)
Should I suggest
dev
, or is "beta or newer" sufficient?Interestingly, I originally had a
:thumbsup:
emoji at the beginning of that comment, and gitea reliably HTTP 500'd. Removing it worked. Seems to happen with other emoji too.ETA: It only seems to happen with the real emoji in the text field - a literal e.g.
:thumbsup:
seems to be successfully stored as-is and replaced on output 🤷ETA more: Possibly a MySQL db/table using utf8 instead of utf8mb4?
this gitea instance has been through some upgrades and migrations. not entirely shocked there may be a schema problem in some table
but yeah reccomend dev for now as that's what we're sticking with