Improve build docs and optimize Dockerfile for Android and Linux builds (#2016)

* Update build docs and migrate Android builds to Docker * Update NDK and move steps directly into Dockerfile * Fix NDK installation via script and Dockerfile * Migrate to @MrCyjaneK's existing Dockerfile (with optimizations) * Add .dockerignore and migrate Dockerfile to root of project * Revert .gitignore changes * Update Android and Linux builds and resolve Linux build issue * Fix git repo for Linux and Android build instructions * Set branch to latest release in build docs * Ensure `flutter clean` is run before building * Fix Linux completion example * Don't build Zano for Linux * Apply suggestions from code review Co-authored-by: cyan <cyjan@mrcyjanek.net> * Explicitly add automake package to Dockerfile * Improve logging on Android and Linux builds via Docker * Improve Dockerfile comments and ordering * Fix issues in macOS and iOS builds docs (thanks @MrCyjaneK) * Update docs/builds/IOS.md [skip ci] * Update docs/builds/IOS.md [skip ci] * Update docs/builds/MACOS.md [skip ci] * Update docs/builds/IOS.md [skip ci] * Fix and improve iOS and macOS build docs * Windows build doc improvements Co-authored-by: cyan <cyjan@mrcyjanek.net> * add missing dependency to Dockerfile * Update Windows build docs * More fixes and optimizations to the Windows build docs * Add git config to Windows build doc * Fix shell location/commands in Windows build doc * Fix WSL commands in Windows build doc * Apply suggestions from code review Co-authored-by: cyan <cyjan@mrcyjanek.net> --------- Co-authored-by: cyan <cyjan@mrcyjanek.net>

Seth For Privacy committed Mar 9, 2025 at 17:10 UTC 1cb8651ffcde44d69c7b6660ac1fb8b029e219de
18 files changed +587 -693
.dockerignore new
+1
@@ -0,0 +1 @@
1 +*
\ No newline at end of file
Dockerfile renamed
+57 -54
@@ -1,83 +1,87 @@
1 # Usage:
2 -# docker build . -f Dockerfile.linux -t ghcr.io/cake-tech/cake_wallet:main-linux
2 +# docker build . -f Dockerfile -t ghcr.io/cake-tech/cake_wallet:main-linux
3 # docker push ghcr.io/cake-tech/cake_wallet:main-linux
4
5 +# Heavily inspired by cirrusci images
6 +# https://github.com/cirruslabs/docker-images-android/blob/master/sdk/tools/Dockerfile
7 +# https://github.com/cirruslabs/docker-images-android/blob/master/sdk/34/Dockerfile
8 +# https://github.com/cirruslabs/docker-images-android/blob/master/sdk/34-ndk/Dockerfile
9 +# https://github.com/cirruslabs/docker-images-flutter/blob/master/sdk/Dockerfile
10 +
11 FROM --platform=linux/amd64 docker.io/debian:12
12
13 LABEL org.opencontainers.image.source=https://github.com/cake-tech/cake_wallet
14
15 +# Set necessary environment variables
16 +# Set Go version to latest known-working version
17 ENV GOLANG_VERSION=1.23.4
10 -# comes from https://developer.android.com/studio/#command-tools
18 +
19 +# Pin Flutter version to latest known-working version
20 +ENV FLUTTER_VERSION=3.24.4
21 +
22 +# Pin Android Studio, platform, and build tools versions to latest known-working version
23 +# Comes from https://developer.android.com/studio/#command-tools
24 ENV ANDROID_SDK_TOOLS_VERSION=11076708
12 -# https://developer.android.com/studio/releases/build-tools
25 +# Comes from https://developer.android.com/studio/releases/build-tools
26 ENV ANDROID_PLATFORM_VERSION=34
27 ENV ANDROID_BUILD_TOOLS_VERSION=34.0.0
28
16 -ENV FLUTTER_VERSION=3.24.0
17 -
29 # If we ever need to migrate the home directory...
30 RUN sed -i 's|^root:[^:]*:[^:]*:[^:]*:[^:]*:/root:|root:x:0:0:root:/root:|' /etc/passwd
31 # mkdir -p /root && rm -rf /root && cp -a /root /root
32 ENV HOME=/root
22 -# Heavily inspired by cirrusci images
23 -# https://github.com/cirruslabs/docker-images-android/blob/master/sdk/tools/Dockerfile
24 -# https://github.com/cirruslabs/docker-images-android/blob/master/sdk/34/Dockerfile
25 -# https://github.com/cirruslabs/docker-images-android/blob/master/sdk/34-ndk/Dockerfile
26 -# https://github.com/cirruslabs/docker-images-flutter/blob/master/sdk/Dockerfile
27 -
33 ENV ANDROID_HOME=/opt/android-sdk-linux \
34 LANG=en_US.UTF-8 \
35 LC_ALL=en_US.UTF-8 \
36 LANGUAGE=en_US:en
37
38 +# Set Android SDK paths
39 ENV ANDROID_SDK_ROOT=$ANDROID_HOME \
40 PATH=${PATH}:${ANDROID_HOME}/cmdline-tools/latest/bin:${ANDROID_HOME}/platform-tools:${ANDROID_HOME}/emulator
41
42 +# Upgrade base image
43 +RUN apt-get update \
44 + && apt-get upgrade -y
45 +
46 +# Install all build dependencies
47 RUN set -o xtrace \
48 && cd /opt \
38 - && apt-get update \
39 - && apt-get upgrade -y \
40 - && apt-get install -y jq \
41 - && apt-get install -y default-jdk \
42 - && apt-get install -y sudo wget zip unzip git openssh-client curl bc software-properties-common build-essential ruby-full ruby-bundler libstdc++6 libpulse0 libglu1-mesa locales lcov libsqlite3-dev --no-install-recommends \
49 + && apt-get install -y --no-install-recommends --no-install-suggests \
50 + # Core dependencies
51 + bc build-essential curl default-jdk git jq lcov libglu1-mesa libpulse0 libsqlite3-dev libstdc++6 locales openssh-client ruby-bundler ruby-full software-properties-common sudo unzip wget zip \
52 # for x86 emulators
44 - && apt-get install -y libxtst6 libnss3-dev libnspr4 libxss1 libatk-bridge2.0-0 libgtk-3-0 libgdk-pixbuf2.0-0 \
45 - && apt-get install -y -qq xxd \
46 - && apt-get install -y lftp \
47 - && apt-get install -qq -y sqlite3 libsqlite3-dev \
48 - # linux desktop dependencies
49 - && apt-get install -y clang cmake ninja-build pkg-config libgtk-3-dev \
53 + libatk-bridge2.0-0 libgdk-pixbuf2.0-0 libgtk-3-0 libnspr4 libnss3-dev libsqlite3-dev libxtst6 libxss1 lftp sqlite3 xxd \
54 + # Linux desktop dependencies
55 + clang cmake libgtk-3-dev ninja-build pkg-config \
56 # monero_c dependencies
51 - && apt-get install -y ccache build-essential autoconf libtool gperf llvm \
57 + autoconf automake build-essential ccache gperf libtool llvm \
58 # extra stuff for KVM
53 - && apt-get install -y udev qemu-kvm libvirt-daemon-system libvirt-clients bridge-utils \
54 - # for linux tests
55 - && apt-get install -y xvfb network-manager ffmpeg x11-utils \
56 - # for aarch64-linux-gnu
57 - && apt-get install -y gcc-aarch64-linux-gnu g++-aarch64-linux-gnu \
58 - && rm -rf /var/lib/apt/lists/* \
59 + bridge-utils libvirt-clients libvirt-daemon-system qemu-kvm udev \
60 + # Linux test dependencies
61 + ffmpeg network-manager x11-utils xvfb psmisc \
62 + # aarch64-linux-gnu dependencies
63 + g++-aarch64-linux-gnu gcc-aarch64-linux-gnu \
64 + && apt clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* \
65 && sh -c 'echo "en_US.UTF-8 UTF-8" > /etc/locale.gen' \
66 && locale-gen \
67 && update-locale LANG=en_US.UTF-8
68
63 -# install nodejs for actions
64 -RUN apt-get update && \
65 - apt-get install -y curl && \
66 - curl -fsSL https://deb.nodesource.com/setup_23.x | bash - && \
67 - apt-get install -y nodejs && \
68 - apt-get clean && \
69 - rm -rf /var/lib/apt/lists/*
70 -
71 -RUN wget https://go.dev/dl/go${GOLANG_VERSION}.linux-amd64.tar.gz &&\
72 - rm -rf /usr/local/go &&\
73 - tar -C /usr/local -xzf go${GOLANG_VERSION}.linux-amd64.tar.gz
69 +# Install nodejs for Github Actions
70 +RUN curl -fsSL https://deb.nodesource.com/setup_23.x | bash - && \
71 + apt-get install -y --no-install-recommends nodejs && \
72 + apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
73
74 +# Install Go
75 ENV PATH=${PATH}:/usr/local/go/bin:${HOME}/go/bin
76 ENV GOROOT=/usr/local/go
77 ENV GOPATH=${HOME}/go
78 -RUN go install golang.org/x/mobile/cmd/gomobile@latest
79 -RUN gomobile init
78 +RUN wget https://go.dev/dl/go${GOLANG_VERSION}.linux-amd64.tar.gz &&\
79 + rm -rf /usr/local/go &&\
80 + tar -C /usr/local -xzf go${GOLANG_VERSION}.linux-amd64.tar.gz && \
81 + go install golang.org/x/mobile/cmd/gomobile@latest && \
82 + gomobile init
83
84 +# Install Android SDK commandline tools and emulator
85 RUN wget -q https://dl.google.com/android/repository/commandlinetools-linux-${ANDROID_SDK_TOOLS_VERSION}_latest.zip -O android-sdk-tools.zip \
86 && mkdir -p ${ANDROID_HOME}/cmdline-tools/ \
87 && unzip -q android-sdk-tools.zip -d ${ANDROID_HOME}/cmdline-tools/ \
@@ -94,10 +98,10 @@ RUN wget -q https://dl.google.com/android/repository/commandlinetools-linux-${AN
98 && git config --global user.email "czarek@cakewallet.com" \
99 && git config --global user.name "CakeWallet CI"
100
97 -# emulator is not available on linux/arm64 (https://issuetracker.google.com/issues/227219818)
101 +# Handle emulator not being available on linux/arm64 (https://issuetracker.google.com/issues/227219818)
102 RUN if [ $(uname -m) == "x86_64" ]; then sdkmanager emulator ; fi
103
100 -# Extra dependencies to not download them for cake wallet build
104 +# Pre-install extra Android SDK dependencies in order to not have to download them for each build
105 RUN yes | sdkmanager \
106 "platforms;android-$ANDROID_PLATFORM_VERSION" \
107 "build-tools;$ANDROID_BUILD_TOOLS_VERSION" \
@@ -107,26 +111,26 @@ RUN yes | sdkmanager \
111 "build-tools;33.0.0" \
112 "build-tools;35.0.0"
113
114 +# Install extra NDK dependency for sp_scanner
115 ENV ANDROID_NDK_VERSION=27.2.12479018
111 -
112 -# Extra ndk dependency for sp_scanner
116 RUN yes | sdkmanager "ndk;$ANDROID_NDK_VERSION" \
117 "ndk;27.0.12077973"
118
116 -# https://github.com/ReactiveCircus/android-emulator-runner dependencies for tests
119 +# Install dependencies for tests
120 +# Comes from https://github.com/ReactiveCircus/android-emulator-runner
121 RUN yes | sdkmanager "system-images;android-29;default;x86" \
122 "system-images;android-29;default;x86_64" \
123 "system-images;android-31;default;x86_64" \
124 "platforms;android-29"
125
122 -# fake the KVM status so android emulator doesn't complain (that much)
126 +# Fake the KVM status so the Android emulator doesn't complain (that much)
127 RUN (addgroup kvm || true) && \
128 adduser root kvm && \
129 mkdir -p /etc/udev/rules.d/ && \
130 echo 'KERNEL=="kvm", GROUP="kvm", MODE="0666", OPTIONS+="static_node=kvm"' | tee /etc/udev/rules.d/99-kvm4all.rules
131
132 +# Install rustup, rust toolchains, and cargo-ndk
133 ENV PATH=${HOME}/.cargo/bin:${PATH}
129 -
134 RUN curl https://sh.rustup.rs -sSf | bash -s -- -y && \
135 cargo install cargo-ndk && \
136 for target in aarch64-linux-android armv7-linux-androideabi i686-linux-android x86_64-linux-android x86_64-unknown-linux-gnu; \
@@ -134,17 +138,16 @@ RUN curl https://sh.rustup.rs -sSf | bash -s -- -y && \
138 rustup target add --toolchain stable $target; \
139 done
140
137 -
141 +# Download and install Flutter
142 ENV HOME=${HOME}
143 ENV FLUTTER_HOME=${HOME}/sdks/flutter/${FLUTTER_VERSION}
144 ENV FLUTTER_ROOT=$FLUTTER_HOME
141 -
145 ENV PATH=${PATH}:${FLUTTER_HOME}/bin:${FLUTTER_HOME}/bin/cache/dart-sdk/bin
146
144 -RUN git clone --depth 1 --branch ${FLUTTER_VERSION} https://github.com/flutter/flutter.git ${FLUTTER_HOME}
145 -
146 -RUN yes | flutter doctor --android-licenses \
147 +RUN git clone --depth 1 --branch ${FLUTTER_VERSION} https://github.com/flutter/flutter.git ${FLUTTER_HOME} \
148 + && yes | flutter doctor --android-licenses \
149 && flutter doctor \
150 && chown -R root:root ${FLUTTER_HOME}
151
152 +# Download and pre-cache necessary Flutter artifacts to speed up builds
153 RUN flutter precache
build-guide-linux.md deleted
-176
@@ -1,176 +0,0 @@
1 -# Building CakeWallet for Linux
2 -
3 -## Requirements and Setup
4 -
5 -The following are the system requirements to build CakeWallet for your Linux device.
6 -
7 -```
8 -Ubuntu >= 16.04
9 -Flutter 3.10.x
10 -```
11 -
12 -## Building CakeWallet on Linux
13 -
14 -These steps will help you configure and execute a build of CakeWallet from its source code.
15 -
16 -### 1. Installing Package Dependencies
17 -
18 -CakeWallet requires some packages to be installed on your build system. You may easily install them on your build system with the following command:
19 -
20 -`$ sudo apt install build-essential cmake pkg-config git curl autoconf libtool`
21 -
22 -> [!WARNING]
23 ->
24 -> ### Check gcc version
25 ->
26 -> It is needed to use gcc 10 or 9 to successfully link dependencies with flutter.\
27 -> To check what gcc version you are using:
28 ->
29 -> ```bash
30 -> $ gcc --version
31 -> $ g++ --version
32 -> ```
33 ->
34 -> If you are using gcc version newer than 10, then you need to downgrade to version 10.4.0:
35 ->
36 -> ```bash
37 -> $ sudo apt install gcc-10 g++-10
38 -> $ sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-10 10
39 -> $ sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-10 10
40 -> ```
41 -
42 -> [!NOTE]
43 ->
44 -> Alternatively, you can use the [nix-shell](https://nixos.org/) with the `gcc10.nix` file\
45 -> present on `scripts/linux` like so:
46 -> ```bash
47 -> $ nix-shell gcc10.nix
48 -> ```
49 -> This will get you in a nix environment with all the required dependencies that you can use to build the software from,\
50 -> and it works in any linux distro.
51 -
52 -### 2. Installing Flutter
53 -
54 -Need to install flutter. For this please check section [How to install flutter on Linux](https://docs.flutter.dev/get-started/install/linux).
55 -
56 -### 3. Verify Installations
57 -
58 -Verify that the Flutter has been correctly installed on your system with the following command:
59 -
60 -`$ flutter doctor`
61 -
62 -The output of this command will appear like this, indicating successful installations. If there are problems with your installation, they **must** be corrected before proceeding.
63 -
64 -```
65 -Doctor summary (to see all details, run flutter doctor -v):
66 -[✓] Flutter (Channel stable, 3.10.x, on Linux, locale en_US.UTF-8)
67 -```
68 -
69 -### 4. Acquiring the CakeWallet Source Code
70 -
71 -Download CakeWallet source code
72 -
73 -`$ git clone https://github.com/cake-tech/cake_wallet.git --branch linux/password-direct-input`
74 -
75 -Proceed into the source code before proceeding with the next steps:
76 -
77 -`$ cd cake_wallet/scripts/linux/`
78 -
79 -To configure some project properties run:
80 -
81 -`$ ./cakewallet.sh`
82 -
83 -Build the Monero libraries and their dependencies:
84 -
85 -`$ ./build_all.sh`
86 -
87 -Now the dependencies need to be copied into the CakeWallet project with this command:
88 -
89 -`$ ./setup.sh`
90 -
91 -It is now time to change back to the base directory of the CakeWallet source code:
92 -
93 -`$ cd ../../`
94 -
95 -Install Flutter package dependencies with this command:
96 -
97 -`$ flutter pub get`
98 -
99 -> #### If you will get an error like:
100 ->
101 -> ```
102 -> The plugin `cw_shared_external` requires your app to be migrated to the Android embedding v2. Follow the steps on the migration doc above and re-run
103 -> this command.
104 -> ```
105 ->
106 -> Then need to config Android project settings. For this open `scripts/android` (`$ cd scripts/android`) directory and run followed commands:
107 ->
108 -> ```
109 -> $ source ./app_env.sh cakewallet
110 -> $ ./app_config.sh
111 -> $ cd ../..
112 -> ```
113 ->
114 -> Then re-configure Linux project again. For this open `scripts/linux` (`$cd scripts/linux`) directory and run:
115 -> `$ ./cakewallet.sh`
116 -> and back to project root directory:
117 -> `$ cd ../..`
118 -> and fetch dependencies again
119 -> `$ flutter pub get`
120 -
121 -Your CakeWallet binary will be built with some specific keys for iterate with 3rd party services. You may generate these secret keys placeholders with the following command:
122 -
123 -`$ dart run tool/generate_new_secrets.dart`
124 -
125 -We will generate mobx models for the project.
126 -
127 -`$ ./model_generator.sh`
128 -
129 -Then we need to generate localization files.
130 -
131 -`$ dart run tool/generate_localization.dart`
132 -
133 -### 5. Build!
134 -
135 -`$ flutter build linux --release`
136 -
137 -Path to executable file will be:
138 -
139 -`build/linux/x64/release/bundle/cake_wallet`
140 -
141 -> ### Troubleshooting
142 ->
143 -> If you got an error while building the application with `$ flutter build linux --release` command, add `-v` argument to the command (`$ flutter build linux -v --release`) to get details.\
144 -> If you got in flutter build logs: undefined reference to `hid_free_enumeration`, or another error with undefined reference to `hid_*`, then rebuild monero lib without hidapi lib. Check does exists `libhidapi-dev` in your scope and remove it from your scope for build without it.
145 -
146 -# Flatpak
147 -
148 -For package the built application into flatpak you need firstly to install `flatpak` and `flatpak-builder`:
149 -
150 -`$ sudo apt install flatpak flatpak-builder`
151 -
152 -Then need to [add flathub](https://flatpak.org/setup/Ubuntu) (or just `$ flatpak remote-add --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo`). Then need to install freedesktop runtime and sdk:
153 -
154 -`$ flatpak install flathub org.freedesktop.Platform//22.08 org.freedesktop.Sdk//22.08`
155 -
156 -To build with using of `flatpak-build` directory run next:
157 -
158 -`$ flatpak-builder --force-clean flatpak-build com.cakewallet.CakeWallet.yml`
159 -
160 -And then export bundle:
161 -
162 -`$ flatpak build-export export flatpak-build`
163 -
164 -`$ flatpak build-bundle export cake_wallet.flatpak com.cakewallet.CakeWallet`
165 -
166 -Result file: `cake_wallet.flatpak` should be generated in the current directory.
167 -
168 -For install generated flatpak file use:
169 -
170 -`$ flatpak --user install cake_wallet.flatpak`
171 -
172 -For run the installed application run:
173 -
174 -`$ flatpak run com.cakewallet.CakeWallet`
175 -
176 -Copyright (c) 2023 Cake Technologies LLC.
build-guide-win.md deleted
-38
@@ -1,38 +0,0 @@
1 -# Building CakeWallet for Windows
2 -
3 -## Requirements and Setup
4 -
5 -The following are the system requirements to build CakeWallet for your Windows PC.
6 -
7 -```
8 -Windows 10 or later (64-bit), x86-64 based
9 -Flutter 3 or above
10 -```
11 -
12 -## Building CakeWallet on Windows
13 -
14 -These steps will help you configure and execute a build of CakeWallet from its source code.
15 -
16 -### 1. Installing Package Dependencies
17 -
18 -For build CakeWallet windows application from sources you will be needed to have:
19 -> [Install Flutter]Follow installation guide (https://docs.flutter.dev/get-started/install/windows) and install do not miss to dev tools (install https://docs.flutter.dev/get-started/install/windows/desktop#development-tools) which are required for windows desktop development (need to install Git for Windows and Visual Studio 2022). Then install `Desktop development with C++` packages via GUI Visual Studio 2022, or Visual Studio Build Tools 2022 including: `C++ Build Tools core features`, `C++ 2022 Redistributable Update`, `C++ core desktop features`, `MVC v143 - VS 2022 C++ x64/x86 build tools`, `C++ CMake tools for Windows`, `Testing tools core features - Build Tools`, `C++ AddressSanitizer`.
20 -> [Install WSL] for building monero dependencies need to install Windows WSL (https://learn.microsoft.com/en-us/windows/wsl/install) and required packages for WSL (Ubuntu):
21 -`$ sudo apt update `
22 -`$ sudo apt build-essential cmake gcc-mingw-w64 g++-mingw-w64 autoconf libtool pkg-config`
23 -
24 -### 2. Pull CakeWallet source code
25 -
26 -You can download CakeWallet source code from our [GitHub repository](github.com/cake-tech/cake_wallet) via git by following next command:
27 -`$ git clone https://github.com/cake-tech/cake_wallet.git --branch MrCyjaneK-cyjan-monerodart`
28 -OR you can download it as [Zip archive](https://github.com/cake-tech/cake_wallet/archive/refs/heads/MrCyjaneK-cyjan-monerodart.zip)
29 -
30 -### 3. Build Monero, Monero_c and their dependencies
31 -
32 -For use monero in the application need to build Monero wrapper - Monero_C which will be used by monero.dart package. For that need to run shell (bash - typically same named utility should be available after WSL is enabled in your system) with previously installed WSL, then change current directory to the application project directory with your used shell and then change current directory to `scripts/windows`: `$ cd scripts/windows`. Run build script: `$ ./build_all.sh`.
33 -
34 -### 4. Configure and build CakeWallet application
35 -
36 -To configure the application open directory where you have downloaded or unarchived CakeWallet sources and run `cakewallet.bat`.
37 -Or if you used WSL and have active shell session you can run `$ ./cakewallet.sh` script in `scripts/windows` which will run `cakewallet.bat` in WSL.
38 -After execution of `cakewallet.bat` you should to get `Cake Wallet.zip` in project root directory which will contains `CakeWallet.exe` file and another needed files for run the application. Now you can extract files from `Cake Wallet.zip` archive and run the application.
docs/NEW_WALLET_TYPES.md renamed
docs/SECURITY.md renamed
docs/builds/ANDROID.md new
+60
@@ -0,0 +1,60 @@
1 +# Building Cake Wallet for Android
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:main-linux . # Uncomment to build the docker image yourself instead of pulling it from the registry
24 +docker run -v$(pwd):$(pwd) -w $(pwd) -i --rm ghcr.io/cake-tech/cake_wallet:main-linux bash -x << EOF
25 +set -x -e
26 +pushd scripts/android
27 + source ./app_env.sh cakewallet
28 + # source ./app_env.sh monero.com # Uncomment this line to build monero.com
29 + ./app_config.sh
30 + ./build_monero_all.sh
31 + ./build_mwebd.sh --dont-install
32 +popd
33 +pushd android/app
34 + [[ -f key.jks ]] || keytool -genkey -v -keystore key.jks -keyalg RSA -keysize 2048 -validity 10000 -alias testKey -noprompt -dname "CN=CakeWallet, OU=CakeWallet, O=CakeWallet, L=Florida, S=America, C=USA" -storepass hunter1 -keypass hunter1
35 +popd
36 +flutter clean
37 +./model_generator.sh
38 +dart run tool/generate_android_key_properties.dart keyAlias=testKey storeFile=key.jks storePassword=hunter1 keyPassword=hunter1
39 +dart run tool/generate_localization.dart
40 +dart run tool/generate_new_secrets.dart
41 +flutter build apk --release --split-per-abi
42 +EOF
43 +```
44 +
45 +You should see the command complete with similar output:
46 +
47 +```bash
48 +Running Gradle task 'assembleRelease'... 519.1s
49 +✓ Built build/app/outputs/flutter-apk/app-armeabi-v7a-release.apk (56.3MB)
50 +✓ Built build/app/outputs/flutter-apk/app-arm64-v8a-release.apk (55.8MB)
51 +✓ Built build/app/outputs/flutter-apk/app-x86_64-release.apk (56.4MB)
52 +```
53 +
54 +Final builds can be found in `build/app/outputs/flutter-apk/` as seen above.
55 +
56 +## Signing builds
57 +
58 +While properly signing builds is outside of the scope of this guide (very few users want or need to run their own built APKs), to learn more about how to sign APKs you can check out the Zeus team's fantastic guide:
59 +
60 +- <https://github.com/ZeusLN/zeus/blob/master/docs/ReproducibleBuilds.md#signing-apks>
docs/builds/IOS.md new
+143
@@ -0,0 +1,143 @@
1 +# Building Cake Wallet for iOS
2 +
3 +## Requirements and Setup
4 +
5 +The following are the system requirements to build Cake Wallet for your iOS device.
6 +
7 +```txt
8 +macOS 15.3.1
9 +Xcode 16.2
10 +Flutter 3.24.4
11 +```
12 +
13 +NOTE: Newer versions of macOS and Xcode may also work, but have not been confirmed to work by the Cake team.
14 +
15 +### 1. Installing dependencies
16 +
17 +For installing dependency tools you can use brew [Install brew](https://brew.sh).
18 +
19 +You may easily install them on your build system with the following command:
20 +
21 +```zsh
22 +brew install automake ccache cmake cocoapods go libtool pkgconfig xz
23 +sudo softwareupdate --install-rosetta --agree-to-license
24 +```
25 +
26 +### 2. Installing Xcode
27 +
28 +Download and install the latest version of [Xcode](https://developer.apple.com/xcode/) from macOS App Store.
29 +
30 +Run the following to properly initialize Xcode:
31 +
32 +```zsh
33 +sudo xcode-select --switch /Applications/Xcode.app/Contents/Developer
34 +sudo xcodebuild -runFirstLaunch
35 +```
36 +
37 +To enable iOS build support for Xcode, perform the following:
38 +
39 +1. Open Xcode
40 +2. Navigate to settings
41 +3. Open Components tab
42 +4. Click "Get" next to iOS 18.2 (or any other version that is showing up as default)
43 +
44 +### 3. Installing Flutter
45 +
46 +Install Flutter, specifically version `3.24.4` by following the [official docs](https://docs.flutter.dev/get-started/install/macos/desktop?tab=download).
47 +
48 +NOTE: as `3.24.4` is not the latest version, you'll need to download it from <https://docs.flutter.dev/release/archive> instead of the link in the docs above.
49 +
50 +### 4. Installing Rust
51 +
52 +Install Rust from the [rustup.rs](https://rustup.rs/) website.
53 +
54 +```zsh
55 +curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
56 +```
57 +
58 +### 5. Verify Flutter and Xcode installation
59 +
60 +Verify that Flutter and Xcode have been correctly installed on your system with the following command:
61 +
62 +`flutter doctor`
63 +
64 +The output of this command should appear like this, indicating successful installations. If there are problems with your installation, they **must** be corrected before proceeding.
65 +
66 +```zsh
67 +Doctor summary (to see all details, run flutter doctor -v):
68 +[✓] Flutter (Channel stable, 3.24.4, on macOS 15.x.x)
69 +[✓] Xcode - develop for iOS and macOS (Xcode 16.2)
70 +```
71 +
72 +### 6. Acquiring the Cake Wallet source code
73 +
74 +Download the latest release tag of Cake Wallet and enter the source code directory:
75 +
76 +```zsh
77 +git clone https://github.com/cake-tech/cake_wallet.git --branch main
78 +cd cake_wallet/scripts/ios/
79 +```
80 +
81 +NOTE: Replace `main` with the latest release tag available at <https://github.com/cake-tech/cake_wallet/releases/latest>.
82 +
83 +### 7. Setup and build Cake Wallet from source
84 +
85 +We need to generate project settings like app name, app icon, package name, etc, including what specific variant of the app we want to build.
86 +
87 +To build Cake Wallet from source, run the following:
88 +
89 +```zsh
90 +source ./app_env.sh cakewallet
91 +```
92 +
93 +For Monero.com, instead do:
94 +
95 +```zsh
96 +source ./app_env.sh monero.com
97 +```
98 +
99 +Build the necessary libraries and their dependencies:
100 +
101 +```zsh
102 +./build_monero_all.sh
103 +./build_mwebd.sh
104 +```
105 +
106 +NOTE: This step will take quite a while, so be sure you grab a cup of coffee or a good book!
107 +
108 +Then run the configuration script to setup app name, app icon, etc:
109 +
110 +```zsh
111 +./app_config.sh
112 +```
113 +
114 +### 8. Prepare Flutter
115 +
116 +Change back to the root directory of the Cake Wallet source code and install Flutter package dependencies:
117 +
118 +```zsh
119 +cd ../../
120 +flutter pub get
121 +```
122 +
123 +Generate secrets as placeholders for official API keys etc. along with localization files and mobx models:
124 +
125 +```zsh
126 +dart run tool/generate_new_secrets.dart
127 +dart run tool/generate_localization.dart
128 +./model_generator.sh
129 +```
130 +
131 +### 9. Build
132 +
133 +```zsh
134 +flutter build ios --release --no-codesign
135 +```
136 +
137 +Then you can open `ios/Runner.xcworkspace` with Xcode to archive the application.
138 +
139 +If you want to run on a connected device, simply run:
140 +
141 +```zsh
142 +flutter run
143 +```
docs/builds/LINUX.md new
+96
@@ -0,0 +1,96 @@
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:main-linux . # Uncomment to build the docker image yourself instead of pulling it from the registry
24 +docker run -v$(pwd):$(pwd) -w $(pwd) -i --rm ghcr.io/cake-tech/cake_wallet:main-linux bash -x << EOF
25 +set -x -e
26 +pushd scripts
27 + ./gen_android_manifest.sh
28 +popd
29 +pushd scripts/linux
30 + source ./app_env.sh cakewallet
31 + # source ./app_env.sh monero.com # Uncomment this line to build monero.com
32 + ./app_config.sh
33 + ./build_monero_all.sh
34 +popd
35 +flutter clean
36 +./model_generator.sh
37 +dart run tool/generate_localization.dart
38 +dart run tool/generate_new_secrets.dart
39 +flutter build linux
40 +EOF
41 +```
42 +
43 +You should see the command complete with similar output:
44 +
45 +```bash
46 ++ dart run tool/generate_localization.dart
47 ++ dart run tool/generate_new_secrets.dart
48 ++ flutter build linux
49 +
50 +Building Linux application...
51 +✓ Built build/linux/x64/release/bundle/cake_wallet
52 +```
53 +
54 +Final builds can be found in `build/linux/x64/release/bundle/` as seen above.
55 +
56 +
57 +## Flatpak (optional)
58 +
59 +To package the built binaries as a flatpak, you need first to install `flatpak` and `flatpak-builder`:
60 +
61 +```bash
62 +sudo apt install flatpak flatpak-builder
63 +```
64 +
65 +Add the necessary Flathub:
66 +
67 +```bash
68 +flatpak remote-add --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo
69 +```
70 +
71 +Then need to install freedesktop runtime and sdk:
72 +
73 +```bash
74 +flatpak install flathub org.freedesktop.Platform//22.08 org.freedesktop.Sdk//22.08
75 +```
76 +
77 +Next, build the flatpak bundle:
78 +
79 +```bash
80 +flatpak-builder --force-clean flatpak-build com.cakewallet.CakeWallet.yml
81 +```
82 +
83 +And then export bundle:
84 +
85 +```bash
86 +flatpak build-export export flatpak-build
87 +flatpak build-bundle export cake_wallet.flatpak com.cakewallet.CakeWallet
88 +```
89 +
90 +The Flatpak file, `cake_wallet.flatpak`, should be generated in the current directory.
91 +
92 +To install the newly built Flatpak, run:
93 +
94 +```bash
95 +flatpak --user install cake_wallet.flatpak
96 +```
docs/builds/MACOS.md new
+135
@@ -0,0 +1,135 @@
1 +# Building Cake Wallet for macOS
2 +
3 +## Requirements and Setup
4 +
5 +The following are the system requirements to build Cake Wallet for your macOS device.
6 +
7 +```txt
8 +macOS 15.3.1
9 +Xcode 16.2
10 +Flutter 3.24.4
11 +```
12 +
13 +### 1. Installing dependencies
14 +
15 +For installing dependency tools you can use brew [Install brew](https://brew.sh).
16 +
17 +You may easily install them on your build system with the following command:
18 +
19 +```zsh
20 +brew install autoconf automake binutils ccache cmake cocoapods go libtool pigz pkg-config
21 +sudo softwareupdate --install-rosetta --agree-to-license
22 +```
23 +
24 +### 2. Installing Xcode
25 +
26 +Download and install the latest version of [Xcode](https://developer.apple.com/xcode/) from macOS App Store.
27 +
28 +Run the following to properly initialize Xcode:
29 +
30 +```zsh
31 +sudo xcode-select --switch /Applications/Xcode.app/Contents/Developer
32 +sudo xcodebuild -runFirstLaunch
33 +```
34 +
35 +### 3. Installing Flutter
36 +
37 +Install Flutter, specifically version `3.24.4` by following the [official docs](https://docs.flutter.dev/get-started/install/macos/desktop?tab=download).
38 +
39 +NOTE: as `3.24.4` is not the latest version, you'll need to download it from <https://docs.flutter.dev/release/archive> instead of the link in the docs above.
40 +
41 +### 4. Installing Rust
42 +
43 +Install Rust from the [rustup.rs](https://rustup.rs/) website.
44 +
45 +```zsh
46 +curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
47 +```
48 +
49 +### 5. Verify Flutter and Xcode installation
50 +
51 +Verify that Flutter and Xcode have been correctly installed on your system with the following command:
52 +
53 +`flutter doctor`
54 +
55 +The output of this command should appear like this, indicating successful installations. If there are problems with your installation of Flutter or Xcode, they **must** be corrected before proceeding.
56 +
57 +```zsh
58 +Doctor summary (to see all details, run flutter doctor -v):
59 +[✓] Flutter (Channel stable, 3.24.4, on macOS 15.x.x)
60 +...
61 +[✓] Xcode - develop for iOS and macOS (Xcode 16.2)
62 +...
63 +```
64 +
65 +### 6. Acquiring the Cake Wallet source code
66 +
67 +Download the latest release tag of Cake Wallet and enter the source code directory:
68 +
69 +```zsh
70 +git clone https://github.com/cake-tech/cake_wallet.git --branch main
71 +cd cake_wallet/scripts/macos/
72 +```
73 +
74 +NOTE: Replace `main` with the latest release tag available at <https://github.com/cake-tech/cake_wallet/releases/latest>.
75 +
76 +### 7. Setup and build Cake Wallet from source
77 +
78 +We need to generate project settings like app name, app icon, package name, etc, including what specific variant of the app we want to build.
79 +
80 +To build Cake Wallet from source, run the following:
81 +
82 +```zsh
83 +source ./app_env.sh cakewallet
84 +```
85 +
86 +For Monero.com, instead do:
87 +
88 +```zsh
89 +source ./app_env.sh monero.com
90 +```
91 +
92 +Build the necessary libraries and their dependencies:
93 +
94 +```zsh
95 +./build_monero_all.sh
96 +```
97 +
98 +NOTE: This step will take quite a while, so be sure you grab a cup of coffee or a good book!
99 +
100 +Then run the configuration script to setup app name, app icon, etc:
101 +
102 +```zsh
103 +./app_config.sh
104 +```
105 +
106 +### 8. Prepare Flutter
107 +
108 +Change back to the root directory of the Cake Wallet source code and install Flutter package dependencies:
109 +
110 +```zsh
111 +cd ../../
112 +flutter pub get
113 +```
114 +
115 +Generate secrets as placeholders for official API keys etc. along with localization files and mobx models:
116 +
117 +```zsh
118 +dart run tool/generate_new_secrets.dart
119 +dart run tool/generate_localization.dart
120 +./model_generator.sh
121 +```
122 +
123 +### 9. Build
124 +
125 +```zsh
126 +flutter build macos --release
127 +```
128 +
129 +Then you can open `macos/Runner.xcworkspace` with Xcode to archive the application.
130 +
131 +If you want to run on a connected device, simply run:
132 +
133 +```zsh
134 +flutter run
135 +```
docs/builds/WINDOWS.md new
+92
@@ -0,0 +1,92 @@
1 +# Building Cake Wallet for Windows
2 +
3 +## Requirements and Setup
4 +
5 +The following are the system requirements to build Cake Wallet for your Windows PC.
6 +
7 +```txt
8 +Windows 10 or later (64-bit), x86-64 based
9 +Flutter 3.24.4
10 +```
11 +
12 +### 1. Installing Flutter
13 +
14 +Install Flutter, specifically version `3.24.4` by following the [official docs](https://docs.flutter.dev/get-started/install/windows).
15 +
16 +In order for Flutter to function, you'll also need to enable Developer Mode:
17 +
18 +Start Menu > search for "Run" > type `ms-settings:developers`, and turn on Developer Mode.
19 +
20 +NOTE: as `3.24.4` is not the latest version, you'll need to download it from <https://docs.flutter.dev/release/archive> instead of the link in the docs above.
21 +
22 +### 2. Install Development Tools
23 +
24 +Install Git for Windows and Visual Studio 2022:
25 +
26 +1. Follow the [Development Tools](https://docs.flutter.dev/get-started/install/windows/desktop#development-tools) installation instructions
27 + 1. NOTE: Be sure to install the `Desktop Development with C++` workload in Visual Studio as outlined in the docs.
28 +2. Add `git` to your path by going to Start Menu > search "environment" > Environment Variables > double-click Path > Add `C:\Program Files\Git\bin\` on a new line.
29 +
30 +Lastly, you'll need to install Nuget separately:
31 +
32 +1. Download the exe from <https://dist.nuget.org/win-x86-commandline/latest/nuget.exe>
33 +2. Create a new directory, `C:\Program Files\Nuget\`
34 +3. Move or copy the `nuget.exe` binary you just downloaded into the newly created directory above.
35 +4. Add `nuget` to your path by going to Start Menu > search "environment" > Environment Variables > double-click Path > Add `C:\Program Files\Nuget\` on a new line.
36 +
37 +### 3. Installing WSL (Windows Subsystem for Linux)
38 +
39 +For building Monero dependencies, it is required to install Windows [WSL](https://learn.microsoft.com/en-us/windows/wsl) and required packages for WSL (Ubuntu).
40 +
41 +1. Open a Powershell window by going to the Start Menu and searching for "Powershell"
42 +2. Install WSL with the command `wsl --install`
43 +3. Install the necessary Ubuntu dependencies
44 +
45 +```powershell
46 +wsl --install
47 +wsl sudo apt update
48 +wsl sudo apt install -y autoconf build-essential ccache cmake curl gcc gcc-mingw-w64-x86-64 git g++ g++-mingw-w64-x86-64 gperf lbzip2 libtool make pkg-config pigz
49 +```
50 +
51 +### 4. Installing Rust
52 +
53 +Install Rust and other Rust-related dependencies using [rustup.rs](https://rustup.rs/#) by running the following command:
54 +
55 +```bash
56 +wsl curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
57 +```
58 +
59 +### 5. Acquiring the Cake Wallet source code
60 +
61 +Download the latest release tag of Cake Wallet and enter the source code directory:
62 +
63 +```powershell
64 +git clone https://github.com/cake-tech/cake_wallet.git --branch main
65 +cd cake_wallet
66 +```
67 +
68 +NOTE: Replace `main` with the latest release tag available at <https://github.com/cake-tech/cake_wallet/releases/latest>.
69 +
70 +### 6. Build Monero, monero_c, and dependencies
71 +
72 +To use Monero in Cake Wallet, you must build the Monero_C wrapper which will be used by monero.dart package.
73 +
74 +Run the following in a WSL terminal window (set the Git username and email as desired):
75 +
76 +```powershell
77 +wsl
78 +git config --global user.email "builds@cakewallet.com"
79 +git config --global user.name "builds"
80 +./build_all.sh
81 +```
82 +
83 +### 7. Configure and build Cake Wallet application
84 +
85 +To configure the application, run the following:
86 +
87 +```powershell
88 +exit
89 +.\cakewallet.bat
90 +```
91 +
92 +After running the script above, you should get `Cake Wallet.zip` in the project's root directory which will contain `CakeWallet.exe` and other needed files for running the application. Now you can extract files from `Cake Wallet.zip` archive and run the application.
howto-build-android.md deleted
-149
@@ -1,149 +0,0 @@
1 -# Building Cake Wallet for Android
2 -
3 -## Requirements and Setup
4 -
5 -The following are the system requirements to build Cake Wallet for your Android device.
6 -
7 -```
8 -Ubuntu >= 20.04
9 -Android SDK 29 or higher (better to have the latest one 33)
10 -Android NDK 17c
11 -Flutter 3.24.4
12 -```
13 -
14 -### 1. Installing Package Dependencies
15 -
16 -CakeWallet cannot be built without the following packages installed on your system.
17 -
18 -- curl
19 -
20 -- unzip
21 -
22 -- automake
23 -
24 -- build-essential
25 -
26 -- file
27 -
28 -- pkg-config
29 -
30 -- git
31 -
32 -- python
33 -
34 -- libtool
35 -
36 -- libtinfo5
37 -
38 -- cmake
39 -
40 -- openjdk-8-jre-headless
41 -
42 -- clang
43 -
44 -You may easily install them on your build system with the following command:
45 -
46 -`$ sudo apt-get install -y curl unzip automake build-essential file pkg-config git python libtool libtinfo5 cmake openjdk-8-jre-headless clang`
47 -
48 -### 2. Installing Android Studio and Android toolchain
49 -
50 -You may download and install the latest version of Android Studio [here](https://developer.android.com/studio#downloads). After installing, start Android Studio, and go through the "Setup Wizard." This installs the latest Android SDK, Android SDK Command-line Tools, and Android SDK Build-Tools, which are required by Cake Wallet. **Be sure you are installing SDK version 28 or later when stepping through the wizard**
51 -
52 -### 3. Installing Flutter
53 -
54 -Install Flutter with version `3.24.4`. For this please check section [Install Flutter manually](https://docs.flutter.dev/get-started/install/linux#install-flutter-manually).
55 -
56 -### 4. Installing rustup
57 -
58 -Install rustup from the [rustup.rs](https://rustup.rs/) website.
59 -
60 -### 5. Verify Installations
61 -
62 -Verify that the Android toolchain, Flutter, and Android Studio have been correctly installed on your system with the following command:
63 -
64 -`$ flutter doctor`
65 -
66 -The output of this command will appear like this, indicating successful installations. If there are problems with your installation, they **must** be corrected before proceeding.
67 -```
68 -Doctor summary (to see all details, run flutter doctor -v):
69 -[✓] Flutter (Channel stable, 3.24.4, on Linux, locale en_US.UTF-8)
70 -[✓] Android toolchain - develop for Android devices (Android SDK version 29 or higher)
71 -[✓] Android Studio (version 4.0 or higher)
72 -```
73 -
74 -### 6. Generate a secure keystore for Android
75 -
76 -`$ keytool -genkey -v -keystore $HOME/key.jks -keyalg RSA -keysize 2048 -validity 10000 -alias key`
77 -
78 -You will be prompted to create two passwords. First you will be prompted for the "store password", followed by a "key password" towards the end of the creation process. **TAKE NOTE OF THESE PASSWORDS!** You will need them in later steps.
79 -
80 -### 7. Acquiring the Cake Wallet Source Code
81 -
82 -Create the directory that will be use to store the Cake Wallet source...
83 -
84 -```
85 -$ sudo mkdir -p /opt/android
86 -$ sudo chown $USER /opt/android
87 -$ cd /opt/android
88 -```
89 -
90 -..and download the source code into that directory.
91 -
92 -`$ git clone https://github.com/cake-tech/cake_wallet.git --branch main`
93 -
94 -Proceed into the source code before proceeding with the next steps:
95 -
96 -`$ cd cake_wallet/scripts/android/`
97 -
98 -### 8. Installing Android NDK
99 -
100 -`$ ./install_ndk.sh`
101 -
102 -### 9. Execute Build & Setup Commands for Cak eWallet
103 -
104 -We need to generate project settings like app name, app icon, package name, etc. For this need to setup environment variables and configure project files.
105 -
106 -Please pick what app you want to build: cakewallet or monero.com.
107 -
108 -`$ source ./app_env.sh <cakewallet OR monero.com>`
109 -(it should be like `$ source ./app_env.sh cakewallet` or `$ source ./app_env.sh monero.com`)
110 -
111 -Then run configuration script for setup app name, app icon and etc:
112 -
113 -`$ ./app_config.sh`
114 -
115 -Build the Monero libraries and their dependencies:
116 -
117 -`$ ./build_all.sh`
118 -
119 -It is now time to change back to the base directory of the Cake Wallet source code:
120 -
121 -`$ cd ../../`
122 -
123 -Install Flutter package dependencies with this command:
124 -
125 -`$ flutter pub get`
126 -
127 -Your Cake Wallet binary will be built with cryptographic salts, which are used for secure encryption of your data. You may generate these secret salts with the following command:
128 -
129 -`$ dart run tool/generate_new_secrets.dart`
130 -
131 -Next, we must generate key properties based on the secure keystore you generated for Android (in step 5). **MODIFY THE FOLLOWING COMMAND** with the "store password" and "key password" you assigned when creating your keystore (in step 5).
132 -
133 -`$ dart run tool/generate_android_key_properties.dart keyAlias=key storeFile=$HOME/key.jks storePassword=<store password> keyPassword=<key password>`
134 -
135 -**REMINDER:** The *above* command will **not** succeed unless you replaced the `storePassword` and `keyPassword` variables with the correct passwords for your keystore.
136 -
137 -Then we need to generate localization files.
138 -
139 -`$ dart run tool/generate_localization.dart`
140 -
141 -Finally build mobx models for the app:
142 -
143 -`$ ./model_generator.sh`
144 -
145 -### 10. Build!
146 -
147 -`$ flutter build apk --release`
148 -
149 -Copyright (c) 2024 Cake Labs LLC
howto-build-ios.md deleted
-101
@@ -1,101 +0,0 @@
1 -# Building Cake Wallet for iOS
2 -
3 -## Requirements and Setup
4 -
5 -The following are the system requirements to build Cake Wallet for your iOS device.
6 -
7 -```
8 -macOS >= 14.0
9 -Xcode 15.3
10 -Flutter 3.24.4
11 -```
12 -
13 -### 1. Installing Package Dependencies
14 -
15 -Cake Wallet cannot be built without the following packages installed on your build system.
16 -
17 -For installing dependency tools you can use brew [Install brew](https://brew.sh).
18 -
19 -You may easily install them on your build system with the following command:
20 -
21 -`$ brew install cmake xz cocoapods`
22 -
23 -### 2. Installing Xcode
24 -
25 -You may download and install the latest version of [Xcode](https://developer.apple.com/xcode/) from macOS App Store.
26 -
27 -### 3. Installing Flutter
28 -
29 -Need to install flutter with version `3.24.4`. For this please check section [Install Flutter](https://docs.flutter.dev/get-started/install/macos/mobile-ios?tab=download).
30 -
31 -### 4. Installing rustup
32 -
33 -Install rustup from the [rustup.rs](https://rustup.rs/) website.
34 -
35 -### 5. Verify Installations
36 -
37 -Verify that the Flutter and Xcode have been correctly installed on your system with the following command:
38 -
39 -`$ flutter doctor`
40 -
41 -The output of this command will appear like this, indicating successful installations. If there are problems with your installation, they **must** be corrected before proceeding.
42 -```
43 -Doctor summary (to see all details, run flutter doctor -v):
44 -[✓] Flutter (Channel stable, 3.24.4, on macOS 14.x.x)
45 -[✓] Xcode - develop for iOS and macOS (Xcode 15.3)
46 -```
47 -
48 -### 6. Acquiring the CakeWallet source code
49 -
50 -Download the source code.
51 -
52 -`$ git clone https://github.com/cake-tech/cake_wallet.git --branch main`
53 -
54 -Proceed into the source code before proceeding with the next steps:
55 -
56 -`$ cd cake_wallet/scripts/ios/`
57 -
58 -### 7. Execute Build & Setup Commands for Cake Wallet
59 -
60 -We need to generate project settings like app name, app icon, package name, etc. For this, we need to setup environment variables and configure project files.
61 -
62 -Please pick what app you want to build: cakewallet or monero.com.
63 -
64 -`$ source ./app_env.sh <cakewallet OR monero.com>`
65 -(it should be like `$ source ./app_env.sh cakewallet` or `$ source ./app_env.sh monero.com`)
66 -
67 -Then run configuration script for setup app name, app icon and etc:
68 -
69 -`$ ./app_config.sh`
70 -
71 -Build the Monero libraries and their dependencies:
72 -
73 -`$ ./build_monero_all.sh`
74 -
75 -It is now time to change back to the base directory of the Cake Wallet source code:
76 -
77 -`$ cd ../../`
78 -
79 -Install Flutter package dependencies with this command:
80 -
81 -`$ flutter pub get`
82 -
83 -Your Cake Wallet binary will be built with cryptographic salts, which are used for secure encryption of your data. You may generate these secret salts with the following command:
84 -
85 -`$ dart run tool/generate_new_secrets.dart`
86 -
87 -Then we need to generate localization files and mobx models.
88 -
89 -`$ ./configure_cake_wallet.sh ios`
90 -
91 -### 8. Build!
92 -
93 -`$ flutter build ios --release`
94 -
95 -Then you can open `ios/Runner.xcworkspace` with Xcode and you can archive the application.
96 -
97 -Or if you want to run to connected device:
98 -
99 -`$ flutter run --release`
100 -
101 -Copyright (c) 2024 Cake Labs LLC
howto-build-macos.md deleted
-112
@@ -1,112 +0,0 @@
1 -# Building Cake Wallet for macOS
2 -
3 -## Requirements and Setup
4 -
5 -The following are the system requirements to build Cake Wallet for your macOS device.
6 -
7 -```
8 -macOS >= 14.0
9 -Xcode 15.3
10 -Flutter 3.24.4
11 -```
12 -
13 -### 1. Installing Package Dependencies
14 -
15 -Cake Wallet cannot be built without the following packages installed on your build system.
16 -
17 -For installing dependency tools you can use brew [Install brew](https://brew.sh).
18 -
19 -You may easily install them on your build system with the following command:
20 -
21 -`$ brew install cmake xz automake autoconf libtool boost@1.76 zmq cocoapods`
22 -
23 -`$ brew link boost@1.76`
24 -
25 -### 2. Installing Xcode
26 -
27 -You may download and install the latest version of [Xcode](https://developer.apple.com/xcode/) from macOS App Store.
28 -
29 -### 3. Installing Flutter
30 -
31 -Need to install flutter with version `3.24.4`. For this please check section [Install Flutter](https://docs.flutter.dev/get-started/install/macos/desktop?tab=download).
32 -
33 -### 4. Installing rustup
34 -
35 -Install rustup from the [rustup.rs](https://rustup.rs/) website.
36 -
37 -### 5. Verify Installations
38 -
39 -Verify that Flutter and Xcode have been correctly installed on your system with the following command:
40 -
41 -`$ flutter doctor`
42 -
43 -The output of this command will appear like this, indicating successful installations. If there are problems with your installation, they **must** be corrected before proceeding.
44 -```
45 -Doctor summary (to see all details, run flutter doctor -v):
46 -[✓] Flutter (Channel stable, 3.24.4, on macOS 14.x.x)
47 -[✓] Xcode - develop for iOS and macOS (Xcode 15.3)
48 -```
49 -
50 -### 6. Acquiring the Cake Wallet source code
51 -
52 -Download the source code.
53 -
54 -`$ git clone https://github.com/cake-tech/cake_wallet.git --branch main`
55 -
56 -Proceed into the source code before proceeding with the next steps:
57 -
58 -`$ cd cake_wallet/scripts/macos/`
59 -
60 -### 7. Execute Build & Setup Commands for Cake Wallet
61 -
62 -We need to generate project settings like app name, app icon, package name, etc. For this need to setup environment variables and configure project files.
63 -
64 -Please pick what app you want to build: cakewallet or monero.com.
65 -
66 -`$ source ./app_env.sh <cakewallet OR monero.com>`
67 -(it should be like `$ source ./app_env.sh cakewallet` or `$ source ./app_env.sh monero.com`)
68 -
69 -Then run configuration script for setup app name, app icon and etc:
70 -
71 -`$ ./app_config.sh`
72 -
73 -Build the Monero libraries and their dependencies:
74 -
75 -`$ ./build_monero_all.sh`
76 -
77 -If you be needed to build universal monero lib, then it will require additional steps. Steps for build universal monero lib on mac with Apple Silicon (arm64):
78 -
79 -- Need to install Rosetta: `$ softwareupdate --install-rosetta`
80 -- Need to install [Brew](https://brew.sh/) with rosetta: `$ arch -x86_64 /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"` (or take another way to install brew, but be use that you have installed it into /usr/local as it's using for x86_64 macs)
81 -- Install dependencies for build monero wallet lib for x86_64 with brew: `$ arch -x86_64 /usr/local/bin/brew install automake autoconf libtool openssl boost@1.76 zmq` and link installed boost@1.76 for x86_64 `$ arch -x86_64 /usr/local/bin/brew link boost@1.76`
82 -- Run building script with additional argument: `$ ./build_monero_all.sh universal`
83 -
84 -If you will be needed to build monero wallet lib only for x86_64 on arm64 mac, then you need use steps above, but run build script with rosetta without arguments: `$ arch -x86_64 ./build_monero_all.sh`.
85 -
86 -It is now time to change back to the base directory of the Cake Wallet source code:
87 -
88 -`$ cd ../../`
89 -
90 -Install Flutter package dependencies with this command:
91 -
92 -`$ flutter pub get`
93 -
94 -Your Cake Wallet binary will be built with cryptographic salts, which are used for secure encryption of your data. You may generate these secret salts with the following command:
95 -
96 -`$ dart run tool/generate_new_secrets.dart`
97 -
98 -Then we need to generate localization files and mobx models.
99 -
100 -`$ ./configure_cake_wallet.sh macos`
101 -
102 -### 8. Build!
103 -
104 -`$ flutter build macos --release`
105 -
106 -Then you can open `macos/Runner.xcworkspace` with Xcode and you can to archive the application.
107 -
108 -Or if you want to run to connected device:
109 -
110 -`$ flutter run --release`
111 -
112 -Copyright (c) 2024 Cake Labs LLC
howto-build-windows.md deleted
-57
@@ -1,57 +0,0 @@
1 -# Building Cake Wallet for Windows
2 -
3 -## Requirements and Setup
4 -
5 -The following are the system requirements to build CakeWallet for your Windows PC.
6 -
7 -```
8 -Windows 10 or later (64-bit), x86-64 based
9 -Flutter 3.24.4
10 -```
11 -
12 -### 1. Installing Flutter
13 -
14 -Install Flutter with version `3.24.4`. Follow the Flutter [installation guide](https://docs.flutter.dev/get-started/install/windows).
15 -
16 -### 2. Install Development Tools
17 -
18 -Install Git for Windows and Visual Studio 2022. Follow the [Development Tools](https://docs.flutter.dev/get-started/install/windows/desktop#development-tools) installation instructions.
19 -
20 -Then install `Desktop development with C++` packages via Visual Studio 2022, or Visual Studio Build Tools 2022 including:
21 -- `C++ Build Tools core features`
22 -- `C++ 2022 Redistributable Update`
23 -- `C++ core desktop features`
24 -- `MVC v143 - VS 2022 C++ x64/x86 build tools`
25 -- `C++ CMake tools for Windows`
26 -- `Testing tools core features - Build Tools`
27 -- `C++ AddressSanitizer`.
28 -
29 -### 3. Installing rustup
30 -
31 -Install rustup from the [rustup.rs](https://rustup.rs/#) website. Download and run the 64-bit rustup-init.exe
32 -
33 -### 4. Installing WSL (Windows Subsystem for Linux)
34 -
35 -For building monero dependencies, it is required to install Windows WSL (https://learn.microsoft.com/en-us/windows/wsl/install) and required packages for WSL (Ubuntu):
36 -`$ sudo apt update `
37 -`$ sudo apt build-essential cmake gcc-mingw-w64 g++-mingw-w64 autoconf libtool pkg-config`
38 -
39 -### 5. Pull Cake Wallet source code
40 -
41 -You can download CakeWallet source code from our [GitHub repository](github.com/cake-tech/cake_wallet) via git:
42 -`$ git clone https://github.com/cake-tech/cake_wallet.git --branch MrCyjaneK-cyjan-monerodart`
43 -OR you can download it as [Zip archive](https://github.com/cake-tech/cake_wallet/archive/refs/heads/MrCyjaneK-cyjan-monerodart.zip)
44 -
45 -### 6. Build Monero, monero_c and their dependencies
46 -
47 -To use Monero in Cake Wallet, you must build the Monero_C wrapper which will be used by monero.dart package.
48 -
49 -For that you need to run the shell (bash - typically same named utility should be available after WSL is enabled in your system) with the previously installed WSL install, then change current directory to the application project directory with your shell then change current directory to `scripts/windows`: `$ cd scripts/windows`. Run build script: `$ ./build_all.sh`.
50 -
51 -### 7. Configure and build Cake Wallet application
52 -
53 -To configure the application, open the directory where you have downloaded or unarchived Cake Wallet sources and run `cakewallet.bat`.
54 -Or if you used WSL and have active shell session you can run `$ ./cakewallet.sh` script in `scripts/windows` which will run `cakewallet.bat` in WSL.
55 -After execution of `cakewallet.bat` you should to get `Cake Wallet.zip` in project root directory which will contain `CakeWallet.exe` file and another needed files for run the application. Now you can extract files from `Cake Wallet.zip` archive and run the application.
56 -
57 -Copyright (c) 2024 Cake Labs LLC.
linux/CMakeLists.txt
-3
@@ -119,9 +119,6 @@ install(FILES "${CMAKE_CURRENT_SOURCE_DIR}/../scripts/monero_c/release/monero/${
119 install(FILES "${CMAKE_CURRENT_SOURCE_DIR}/../scripts/monero_c/release/wownero/${LIB_TRIPLET}_libwallet2_api_c.so" DESTINATION "${INSTALL_BUNDLE_LIB_DIR}" RENAME "wownero_libwallet2_api_c.so"
120 COMPONENT Runtime)
121
122 -install(FILES "${CMAKE_CURRENT_SOURCE_DIR}/../scripts/monero_c/release/zano/${LIB_TRIPLET}_libwallet2_api_c.so" DESTINATION "${INSTALL_BUNDLE_LIB_DIR}" RENAME "zano_libwallet2_api_c.so"
123 - COMPONENT Runtime)
124 -
122 install(TARGETS ${BINARY_NAME} RUNTIME DESTINATION "${CMAKE_INSTALL_PREFIX}"
123 COMPONENT Runtime)
124
scripts/android/install_ndk.sh
+2 -2
@@ -6,9 +6,9 @@ TOOLCHAIN_A32_DIR=${TOOLCHAIN_DIR}_aarch
6 TOOLCHAIN_A64_DIR=${TOOLCHAIN_DIR}_aarch64
7 TOOLCHAIN_x86_DIR=${TOOLCHAIN_DIR}_i686
8 TOOLCHAIN_x86_64_DIR=${TOOLCHAIN_DIR}_x86_64
9 -ANDROID_NDK_SHA256="3f541adbd0330a9205ba12697f6d04ec90752c53d6b622101a2a8a856e816589"
9 +ANDROID_NDK_SHA256="7a1302d9bfbc37d46be90b2285f4737508ffe08a346cf2424c5c6a744de2db22"
10
11 - curl https://dl.google.com/android/repository/android-ndk-r17c-linux-x86_64.zip -o ${ANDROID_NDK_ZIP}
11 + curl https://dl.google.com/android/repository/android-ndk-r27c-linux.zip -o ${ANDROID_NDK_ZIP}
12 echo $ANDROID_NDK_SHA256 $ANDROID_NDK_ZIP | sha256sum -c || exit 1
13 unzip $ANDROID_NDK_ZIP -d $WORKDIR
14
scripts/linux/build_monero_all.sh
+1 -1
@@ -7,7 +7,7 @@ cd "$(dirname "$0")"
7
8 ../prepare_moneroc.sh
9
10 -for COIN in monero wownero zano;
10 +for COIN in monero wownero;
11 do
12 pushd ../monero_c
13 for target in x86_64-linux-gnu # aarch64-linux-gnu