| 1 | # Building Cake Wallet for Linux |
| 2 | |
| 3 | ## Requirements and Setup |
| 4 | |
| 5 | As we use Docker with a custom Dockerfile to build Cake Wallet, the only dependency for building Cake on your local host is the Docker Engine. |
| 6 | |
| 7 | You can find the latest instructions for installing Docker on your given OS on the official website: |
| 8 | |
| 9 | - <https://docs.docker.com/engine/install/> |
| 10 | |
| 11 | NOTE: If building on a Mac with an M-series CPU (arm64), you may encounter segmentation faults when building. If you do, simply retry the build. |
| 12 | |
| 13 | ## Building Cake Wallet or Monero.com |
| 14 | |
| 15 | ### Using the pre-built builder image |
| 16 | |
| 17 | In order to build the latest version of Cake Wallet, simply run the following: |
| 18 | |
| 19 | ```bash |
| 20 | git clone --branch main https://github.com/cake-tech/cake_wallet.git |
| 21 | # NOTE: Replace `main` with the latest release tag available at https://github.com/cake-tech/cake_wallet/releases/latest. |
| 22 | cd cake_wallet |
| 23 | # docker build -t ghcr.io/cake-tech/cake_wallet:debian13-flutter3.41.9-ndkr28-go1.24.1-ruststablenightly . # Uncomment to build the docker image yourself instead of pulling it from the registry |
| 24 | docker run --privileged -v$(pwd):$(pwd) -w $(pwd) -i --rm ghcr.io/cake-tech/cake_wallet:debian13-flutter3.41.9-ndkr28-go1.24.1-ruststablenightly bash -x << EOF |
| 25 | set -x -e |
| 26 | git config --global --add safe.directory '*' |
| 27 | pushd scripts |
| 28 | ./gen_android_manifest.sh |
| 29 | ./prepare_moneroc.sh |
| 30 | ./prepare_torch.sh |
| 31 | ./prepare_zcash.sh |
| 32 | ./prepare_reown.sh |
| 33 | ./build_bitbox_flutter.sh |
| 34 | pushd android |
| 35 | ./build_mwebd.sh |
| 36 | popd |
| 37 | popd |
| 38 | pushd scripts/linux |
| 39 | ./build_monero_all.sh |
| 40 | ./build_zcash.sh |
| 41 | source ./app_env.sh cakewallet |
| 42 | # source ./app_env.sh monero.com # Uncomment this line to build monero.com |
| 43 | ./app_config.sh |
| 44 | popd |
| 45 | flutter clean |
| 46 | ./model_generator.sh |
| 47 | dart run tool/generate_localization.dart |
| 48 | dart run tool/generate_new_secrets.dart |
| 49 | flutter build linux |
| 50 | cp -r build/linux/x64 build/linux/current |
| 51 | # use line below if you are building on arm64 |
| 52 | # cp -r build/linux/arm64 build/linux/current |
| 53 | # If you want to build flatpak you need --privileged flag |
| 54 | flatpak-builder --force-clean flatpak-build com.cakewallet.CakeWallet.yml |
| 55 | flatpak build-export export flatpak-build |
| 56 | flatpak build-bundle export build/linux/current/cake_wallet.flatpak com.cakewallet.CakeWallet |
| 57 | EOF |
| 58 | ``` |
| 59 | |
| 60 | You should see the command complete with similar output: |
| 61 | |
| 62 | ```bash |
| 63 | + dart run tool/generate_localization.dart |
| 64 | + dart run tool/generate_new_secrets.dart |
| 65 | + flutter build linux |
| 66 | |
| 67 | Building Linux application... |
| 68 | ✓ Built build/linux/x64/release/bundle/cake_wallet |
| 69 | ``` |
| 70 | |
| 71 | Final builds can be found in `build/linux/current/release/bundle/` as seen above. |
| 72 | |
| 73 | |
| 74 | To install the newly built Flatpak, run: |
| 75 | |
| 76 | ```bash |
| 77 | flatpak --user install build/linux/current/cake_wallet.flatpak |
| 78 | ``` |