proton-bridge/BUILDS.md

81 lines
3.2 KiB
Markdown
Raw Normal View History

# Building ProtonMail Bridge and Import-Export app
## Prerequisites
* Go 1.13
2020-04-15 17:14:18 +00:00
* Bash with basic build utils: make, gcc, sed, find, grep, ...
* For Windows it is recommended to use MinGW 64bit shell from [MSYS2](https://www.msys2.org/)
* GCC (linux, windows) or Xcode (macOS)
* Windres (windows)
* libglvnd and libsecret development files (linux)
To enable the sending of crash reports using Sentry please set the
2020-04-15 17:14:18 +00:00
`main.DSNSentry` value with the client key of your sentry project before build.
Otherwise, the sending of crash reports will be disabled.
## Build
In order to build Bridge or Import-Export app with Qt interface we are using
[Qt Go Binding](https://github.com/therecipe/qt). The dependencies and
installation of this tool is part of `make build` target. If you have issues
with installation of therecipe/qt we recommend to follow [this
wiki](https://github.com/therecipe/qt/wiki/Installation-on-Linux)
Please note that `$(go env GOPATH)/bin` must be in your `PATH` to ensure
binaries installed by `therecipe/qt` (such as `qtdeploy`) are found. Also,
before you start build **on Windows**, please unset the `MSYSTEM` variable
```bash
export MSYSTEM=
```
### Build Bridge
* in project root run
```bash
make build
```
* The result will be stored in `./cmd/Destop-Bridge/deploy/${GOOS}/`
* for `linux`, the binary will have the name of the project directory (e.g `proton-bridge`)
* for `windows`, the binary will have the file extension `.exe` (e.g `proton-bridge.exe`)
* for `darwin`, the application will be created with name of the project directory (e.g `proton-bridge.app`)
2020-12-10 09:02:22 +00:00
#### Build Bridge without GUI
2020-12-11 11:36:21 +00:00
* If you need to build bridge without Qt dependencies, you can do so by running
2020-12-10 09:02:22 +00:00
```bash
make build-nogui
```
* Bridge without GUI will start by default without any interface (i.e., there is no way to add or remove client, get bridge password, etc)
2020-12-11 11:36:28 +00:00
* Bridge always has the option (whether built with Qt or without) to use a CLI interface by starting it with the argument `-c`
2020-12-10 09:02:22 +00:00
* NOTE: You still need to setup supported keychain on your system
### Build Import-Export
* in project root run
```bash
make build-ie
```
* The result will be stored in `./cmd/Import-Export/deploy/${GOOS}/`
* for `linux`, the binary will have the name of the project directory (e.g `proton-bridge`)
* for `windows`, the binary will have the file extension `.exe` (e.g `proton-bridge.exe`)
* for `darwin`, the application will be created with name of the project directory (e.g `proton-bridge.app`)
### Tags
Note that repository contains both Bridge and Import-Export apps and they are
not released together. Therefore, each app has own tag prefix. Bridge tags
2020-10-22 08:26:35 +00:00
starts with `br-` and Import-Export tags starts with `ie-`. Both tags continue
with semantic versioning `MAJOR.MINOR.PATCH`. An example of full tag is
`br-1.4.4` or `ie-1.1.2` (current versions in October 2020).
2020-04-15 17:14:18 +00:00
## Useful tests, lints and checks
In order to be able to run following commands please install the development dependencies:
`make install-dev-dependencies`
* `make test` will run all unit tests
* `make lint` will lint the whole project
* `make -C ./test test` will run the integration tests
2020-04-15 17:14:18 +00:00
* `make run` will build Bridge without a GUI and start it in CLI mode