mirror of
https://github.com/cake-tech/cake_wallet.git
synced 2025-03-31 19:49:04 +00:00
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>
This commit is contained in:
parent
be4e0d6ac8
commit
1cb8651ffc
18 changed files with 594 additions and 700 deletions
1
.dockerignore
Normal file
1
.dockerignore
Normal file
|
@ -0,0 +1 @@
|
|||
*
|
|
@ -1,83 +1,87 @@
|
|||
# Usage:
|
||||
# docker build . -f Dockerfile.linux -t ghcr.io/cake-tech/cake_wallet:main-linux
|
||||
# docker build . -f Dockerfile -t ghcr.io/cake-tech/cake_wallet:main-linux
|
||||
# docker push ghcr.io/cake-tech/cake_wallet:main-linux
|
||||
|
||||
FROM --platform=linux/amd64 docker.io/debian:12
|
||||
|
||||
LABEL org.opencontainers.image.source=https://github.com/cake-tech/cake_wallet
|
||||
|
||||
ENV GOLANG_VERSION=1.23.4
|
||||
# comes from https://developer.android.com/studio/#command-tools
|
||||
ENV ANDROID_SDK_TOOLS_VERSION=11076708
|
||||
# https://developer.android.com/studio/releases/build-tools
|
||||
ENV ANDROID_PLATFORM_VERSION=34
|
||||
ENV ANDROID_BUILD_TOOLS_VERSION=34.0.0
|
||||
|
||||
ENV FLUTTER_VERSION=3.24.0
|
||||
|
||||
# If we ever need to migrate the home directory...
|
||||
RUN sed -i 's|^root:[^:]*:[^:]*:[^:]*:[^:]*:/root:|root:x:0:0:root:/root:|' /etc/passwd
|
||||
# mkdir -p /root && rm -rf /root && cp -a /root /root
|
||||
ENV HOME=/root
|
||||
# Heavily inspired by cirrusci images
|
||||
# https://github.com/cirruslabs/docker-images-android/blob/master/sdk/tools/Dockerfile
|
||||
# https://github.com/cirruslabs/docker-images-android/blob/master/sdk/34/Dockerfile
|
||||
# https://github.com/cirruslabs/docker-images-android/blob/master/sdk/34-ndk/Dockerfile
|
||||
# https://github.com/cirruslabs/docker-images-flutter/blob/master/sdk/Dockerfile
|
||||
|
||||
FROM --platform=linux/amd64 docker.io/debian:12
|
||||
|
||||
LABEL org.opencontainers.image.source=https://github.com/cake-tech/cake_wallet
|
||||
|
||||
# Set necessary environment variables
|
||||
# Set Go version to latest known-working version
|
||||
ENV GOLANG_VERSION=1.23.4
|
||||
|
||||
# Pin Flutter version to latest known-working version
|
||||
ENV FLUTTER_VERSION=3.24.4
|
||||
|
||||
# Pin Android Studio, platform, and build tools versions to latest known-working version
|
||||
# Comes from https://developer.android.com/studio/#command-tools
|
||||
ENV ANDROID_SDK_TOOLS_VERSION=11076708
|
||||
# Comes from https://developer.android.com/studio/releases/build-tools
|
||||
ENV ANDROID_PLATFORM_VERSION=34
|
||||
ENV ANDROID_BUILD_TOOLS_VERSION=34.0.0
|
||||
|
||||
# If we ever need to migrate the home directory...
|
||||
RUN sed -i 's|^root:[^:]*:[^:]*:[^:]*:[^:]*:/root:|root:x:0:0:root:/root:|' /etc/passwd
|
||||
# mkdir -p /root && rm -rf /root && cp -a /root /root
|
||||
ENV HOME=/root
|
||||
ENV ANDROID_HOME=/opt/android-sdk-linux \
|
||||
LANG=en_US.UTF-8 \
|
||||
LC_ALL=en_US.UTF-8 \
|
||||
LANGUAGE=en_US:en
|
||||
|
||||
# Set Android SDK paths
|
||||
ENV ANDROID_SDK_ROOT=$ANDROID_HOME \
|
||||
PATH=${PATH}:${ANDROID_HOME}/cmdline-tools/latest/bin:${ANDROID_HOME}/platform-tools:${ANDROID_HOME}/emulator
|
||||
|
||||
# Upgrade base image
|
||||
RUN apt-get update \
|
||||
&& apt-get upgrade -y
|
||||
|
||||
# Install all build dependencies
|
||||
RUN set -o xtrace \
|
||||
&& cd /opt \
|
||||
&& apt-get update \
|
||||
&& apt-get upgrade -y \
|
||||
&& apt-get install -y jq \
|
||||
&& apt-get install -y default-jdk \
|
||||
&& 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 \
|
||||
&& apt-get install -y --no-install-recommends --no-install-suggests \
|
||||
# Core dependencies
|
||||
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 \
|
||||
# for x86 emulators
|
||||
&& apt-get install -y libxtst6 libnss3-dev libnspr4 libxss1 libatk-bridge2.0-0 libgtk-3-0 libgdk-pixbuf2.0-0 \
|
||||
&& apt-get install -y -qq xxd \
|
||||
&& apt-get install -y lftp \
|
||||
&& apt-get install -qq -y sqlite3 libsqlite3-dev \
|
||||
# linux desktop dependencies
|
||||
&& apt-get install -y clang cmake ninja-build pkg-config libgtk-3-dev \
|
||||
libatk-bridge2.0-0 libgdk-pixbuf2.0-0 libgtk-3-0 libnspr4 libnss3-dev libsqlite3-dev libxtst6 libxss1 lftp sqlite3 xxd \
|
||||
# Linux desktop dependencies
|
||||
clang cmake libgtk-3-dev ninja-build pkg-config \
|
||||
# monero_c dependencies
|
||||
&& apt-get install -y ccache build-essential autoconf libtool gperf llvm \
|
||||
autoconf automake build-essential ccache gperf libtool llvm \
|
||||
# extra stuff for KVM
|
||||
&& apt-get install -y udev qemu-kvm libvirt-daemon-system libvirt-clients bridge-utils \
|
||||
# for linux tests
|
||||
&& apt-get install -y xvfb network-manager ffmpeg x11-utils \
|
||||
# for aarch64-linux-gnu
|
||||
&& apt-get install -y gcc-aarch64-linux-gnu g++-aarch64-linux-gnu \
|
||||
&& rm -rf /var/lib/apt/lists/* \
|
||||
bridge-utils libvirt-clients libvirt-daemon-system qemu-kvm udev \
|
||||
# Linux test dependencies
|
||||
ffmpeg network-manager x11-utils xvfb psmisc \
|
||||
# aarch64-linux-gnu dependencies
|
||||
g++-aarch64-linux-gnu gcc-aarch64-linux-gnu \
|
||||
&& apt clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* \
|
||||
&& sh -c 'echo "en_US.UTF-8 UTF-8" > /etc/locale.gen' \
|
||||
&& locale-gen \
|
||||
&& update-locale LANG=en_US.UTF-8
|
||||
|
||||
# install nodejs for actions
|
||||
RUN apt-get update && \
|
||||
apt-get install -y curl && \
|
||||
curl -fsSL https://deb.nodesource.com/setup_23.x | bash - && \
|
||||
apt-get install -y nodejs && \
|
||||
apt-get clean && \
|
||||
rm -rf /var/lib/apt/lists/*
|
||||
|
||||
RUN wget https://go.dev/dl/go${GOLANG_VERSION}.linux-amd64.tar.gz &&\
|
||||
rm -rf /usr/local/go &&\
|
||||
tar -C /usr/local -xzf go${GOLANG_VERSION}.linux-amd64.tar.gz
|
||||
# Install nodejs for Github Actions
|
||||
RUN curl -fsSL https://deb.nodesource.com/setup_23.x | bash - && \
|
||||
apt-get install -y --no-install-recommends nodejs && \
|
||||
apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
|
||||
|
||||
# Install Go
|
||||
ENV PATH=${PATH}:/usr/local/go/bin:${HOME}/go/bin
|
||||
ENV GOROOT=/usr/local/go
|
||||
ENV GOPATH=${HOME}/go
|
||||
RUN go install golang.org/x/mobile/cmd/gomobile@latest
|
||||
RUN gomobile init
|
||||
RUN wget https://go.dev/dl/go${GOLANG_VERSION}.linux-amd64.tar.gz &&\
|
||||
rm -rf /usr/local/go &&\
|
||||
tar -C /usr/local -xzf go${GOLANG_VERSION}.linux-amd64.tar.gz && \
|
||||
go install golang.org/x/mobile/cmd/gomobile@latest && \
|
||||
gomobile init
|
||||
|
||||
# Install Android SDK commandline tools and emulator
|
||||
RUN wget -q https://dl.google.com/android/repository/commandlinetools-linux-${ANDROID_SDK_TOOLS_VERSION}_latest.zip -O android-sdk-tools.zip \
|
||||
&& mkdir -p ${ANDROID_HOME}/cmdline-tools/ \
|
||||
&& 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
|
|||
&& git config --global user.email "czarek@cakewallet.com" \
|
||||
&& git config --global user.name "CakeWallet CI"
|
||||
|
||||
# emulator is not available on linux/arm64 (https://issuetracker.google.com/issues/227219818)
|
||||
# Handle emulator not being available on linux/arm64 (https://issuetracker.google.com/issues/227219818)
|
||||
RUN if [ $(uname -m) == "x86_64" ]; then sdkmanager emulator ; fi
|
||||
|
||||
# Extra dependencies to not download them for cake wallet build
|
||||
# Pre-install extra Android SDK dependencies in order to not have to download them for each build
|
||||
RUN yes | sdkmanager \
|
||||
"platforms;android-$ANDROID_PLATFORM_VERSION" \
|
||||
"build-tools;$ANDROID_BUILD_TOOLS_VERSION" \
|
||||
|
@ -107,26 +111,26 @@ RUN yes | sdkmanager \
|
|||
"build-tools;33.0.0" \
|
||||
"build-tools;35.0.0"
|
||||
|
||||
# Install extra NDK dependency for sp_scanner
|
||||
ENV ANDROID_NDK_VERSION=27.2.12479018
|
||||
|
||||
# Extra ndk dependency for sp_scanner
|
||||
RUN yes | sdkmanager "ndk;$ANDROID_NDK_VERSION" \
|
||||
"ndk;27.0.12077973"
|
||||
|
||||
# https://github.com/ReactiveCircus/android-emulator-runner dependencies for tests
|
||||
# Install dependencies for tests
|
||||
# Comes from https://github.com/ReactiveCircus/android-emulator-runner
|
||||
RUN yes | sdkmanager "system-images;android-29;default;x86" \
|
||||
"system-images;android-29;default;x86_64" \
|
||||
"system-images;android-31;default;x86_64" \
|
||||
"platforms;android-29"
|
||||
|
||||
# fake the KVM status so android emulator doesn't complain (that much)
|
||||
# Fake the KVM status so the Android emulator doesn't complain (that much)
|
||||
RUN (addgroup kvm || true) && \
|
||||
adduser root kvm && \
|
||||
mkdir -p /etc/udev/rules.d/ && \
|
||||
echo 'KERNEL=="kvm", GROUP="kvm", MODE="0666", OPTIONS+="static_node=kvm"' | tee /etc/udev/rules.d/99-kvm4all.rules
|
||||
|
||||
# Install rustup, rust toolchains, and cargo-ndk
|
||||
ENV PATH=${HOME}/.cargo/bin:${PATH}
|
||||
|
||||
RUN curl https://sh.rustup.rs -sSf | bash -s -- -y && \
|
||||
cargo install cargo-ndk && \
|
||||
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 && \
|
|||
rustup target add --toolchain stable $target; \
|
||||
done
|
||||
|
||||
|
||||
# Download and install Flutter
|
||||
ENV HOME=${HOME}
|
||||
ENV FLUTTER_HOME=${HOME}/sdks/flutter/${FLUTTER_VERSION}
|
||||
ENV FLUTTER_ROOT=$FLUTTER_HOME
|
||||
|
||||
ENV PATH=${PATH}:${FLUTTER_HOME}/bin:${FLUTTER_HOME}/bin/cache/dart-sdk/bin
|
||||
|
||||
RUN git clone --depth 1 --branch ${FLUTTER_VERSION} https://github.com/flutter/flutter.git ${FLUTTER_HOME}
|
||||
|
||||
RUN yes | flutter doctor --android-licenses \
|
||||
RUN git clone --depth 1 --branch ${FLUTTER_VERSION} https://github.com/flutter/flutter.git ${FLUTTER_HOME} \
|
||||
&& yes | flutter doctor --android-licenses \
|
||||
&& flutter doctor \
|
||||
&& chown -R root:root ${FLUTTER_HOME}
|
||||
|
||||
# Download and pre-cache necessary Flutter artifacts to speed up builds
|
||||
RUN flutter precache
|
|
@ -1,176 +0,0 @@
|
|||
# Building CakeWallet for Linux
|
||||
|
||||
## Requirements and Setup
|
||||
|
||||
The following are the system requirements to build CakeWallet for your Linux device.
|
||||
|
||||
```
|
||||
Ubuntu >= 16.04
|
||||
Flutter 3.10.x
|
||||
```
|
||||
|
||||
## Building CakeWallet on Linux
|
||||
|
||||
These steps will help you configure and execute a build of CakeWallet from its source code.
|
||||
|
||||
### 1. Installing Package Dependencies
|
||||
|
||||
CakeWallet requires some packages to be installed on your build system. You may easily install them on your build system with the following command:
|
||||
|
||||
`$ sudo apt install build-essential cmake pkg-config git curl autoconf libtool`
|
||||
|
||||
> [!WARNING]
|
||||
>
|
||||
> ### Check gcc version
|
||||
>
|
||||
> It is needed to use gcc 10 or 9 to successfully link dependencies with flutter.\
|
||||
> To check what gcc version you are using:
|
||||
>
|
||||
> ```bash
|
||||
> $ gcc --version
|
||||
> $ g++ --version
|
||||
> ```
|
||||
>
|
||||
> If you are using gcc version newer than 10, then you need to downgrade to version 10.4.0:
|
||||
>
|
||||
> ```bash
|
||||
> $ sudo apt install gcc-10 g++-10
|
||||
> $ sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-10 10
|
||||
> $ sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-10 10
|
||||
> ```
|
||||
|
||||
> [!NOTE]
|
||||
>
|
||||
> Alternatively, you can use the [nix-shell](https://nixos.org/) with the `gcc10.nix` file\
|
||||
> present on `scripts/linux` like so:
|
||||
> ```bash
|
||||
> $ nix-shell gcc10.nix
|
||||
> ```
|
||||
> This will get you in a nix environment with all the required dependencies that you can use to build the software from,\
|
||||
> and it works in any linux distro.
|
||||
|
||||
### 2. Installing Flutter
|
||||
|
||||
Need to install flutter. For this please check section [How to install flutter on Linux](https://docs.flutter.dev/get-started/install/linux).
|
||||
|
||||
### 3. Verify Installations
|
||||
|
||||
Verify that the Flutter has been correctly installed on your system with the following command:
|
||||
|
||||
`$ flutter doctor`
|
||||
|
||||
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.
|
||||
|
||||
```
|
||||
Doctor summary (to see all details, run flutter doctor -v):
|
||||
[✓] Flutter (Channel stable, 3.10.x, on Linux, locale en_US.UTF-8)
|
||||
```
|
||||
|
||||
### 4. Acquiring the CakeWallet Source Code
|
||||
|
||||
Download CakeWallet source code
|
||||
|
||||
`$ git clone https://github.com/cake-tech/cake_wallet.git --branch linux/password-direct-input`
|
||||
|
||||
Proceed into the source code before proceeding with the next steps:
|
||||
|
||||
`$ cd cake_wallet/scripts/linux/`
|
||||
|
||||
To configure some project properties run:
|
||||
|
||||
`$ ./cakewallet.sh`
|
||||
|
||||
Build the Monero libraries and their dependencies:
|
||||
|
||||
`$ ./build_all.sh`
|
||||
|
||||
Now the dependencies need to be copied into the CakeWallet project with this command:
|
||||
|
||||
`$ ./setup.sh`
|
||||
|
||||
It is now time to change back to the base directory of the CakeWallet source code:
|
||||
|
||||
`$ cd ../../`
|
||||
|
||||
Install Flutter package dependencies with this command:
|
||||
|
||||
`$ flutter pub get`
|
||||
|
||||
> #### If you will get an error like:
|
||||
>
|
||||
> ```
|
||||
> 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
|
||||
> this command.
|
||||
> ```
|
||||
>
|
||||
> Then need to config Android project settings. For this open `scripts/android` (`$ cd scripts/android`) directory and run followed commands:
|
||||
>
|
||||
> ```
|
||||
> $ source ./app_env.sh cakewallet
|
||||
> $ ./app_config.sh
|
||||
> $ cd ../..
|
||||
> ```
|
||||
>
|
||||
> Then re-configure Linux project again. For this open `scripts/linux` (`$cd scripts/linux`) directory and run:
|
||||
> `$ ./cakewallet.sh`
|
||||
> and back to project root directory:
|
||||
> `$ cd ../..`
|
||||
> and fetch dependencies again
|
||||
> `$ flutter pub get`
|
||||
|
||||
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:
|
||||
|
||||
`$ dart run tool/generate_new_secrets.dart`
|
||||
|
||||
We will generate mobx models for the project.
|
||||
|
||||
`$ ./model_generator.sh`
|
||||
|
||||
Then we need to generate localization files.
|
||||
|
||||
`$ dart run tool/generate_localization.dart`
|
||||
|
||||
### 5. Build!
|
||||
|
||||
`$ flutter build linux --release`
|
||||
|
||||
Path to executable file will be:
|
||||
|
||||
`build/linux/x64/release/bundle/cake_wallet`
|
||||
|
||||
> ### Troubleshooting
|
||||
>
|
||||
> 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.\
|
||||
> 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.
|
||||
|
||||
# Flatpak
|
||||
|
||||
For package the built application into flatpak you need firstly to install `flatpak` and `flatpak-builder`:
|
||||
|
||||
`$ sudo apt install flatpak flatpak-builder`
|
||||
|
||||
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:
|
||||
|
||||
`$ flatpak install flathub org.freedesktop.Platform//22.08 org.freedesktop.Sdk//22.08`
|
||||
|
||||
To build with using of `flatpak-build` directory run next:
|
||||
|
||||
`$ flatpak-builder --force-clean flatpak-build com.cakewallet.CakeWallet.yml`
|
||||
|
||||
And then export bundle:
|
||||
|
||||
`$ flatpak build-export export flatpak-build`
|
||||
|
||||
`$ flatpak build-bundle export cake_wallet.flatpak com.cakewallet.CakeWallet`
|
||||
|
||||
Result file: `cake_wallet.flatpak` should be generated in the current directory.
|
||||
|
||||
For install generated flatpak file use:
|
||||
|
||||
`$ flatpak --user install cake_wallet.flatpak`
|
||||
|
||||
For run the installed application run:
|
||||
|
||||
`$ flatpak run com.cakewallet.CakeWallet`
|
||||
|
||||
Copyright (c) 2023 Cake Technologies LLC.
|
|
@ -1,38 +0,0 @@
|
|||
# Building CakeWallet for Windows
|
||||
|
||||
## Requirements and Setup
|
||||
|
||||
The following are the system requirements to build CakeWallet for your Windows PC.
|
||||
|
||||
```
|
||||
Windows 10 or later (64-bit), x86-64 based
|
||||
Flutter 3 or above
|
||||
```
|
||||
|
||||
## Building CakeWallet on Windows
|
||||
|
||||
These steps will help you configure and execute a build of CakeWallet from its source code.
|
||||
|
||||
### 1. Installing Package Dependencies
|
||||
|
||||
For build CakeWallet windows application from sources you will be needed to have:
|
||||
> [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`.
|
||||
> [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):
|
||||
`$ sudo apt update `
|
||||
`$ sudo apt build-essential cmake gcc-mingw-w64 g++-mingw-w64 autoconf libtool pkg-config`
|
||||
|
||||
### 2. Pull CakeWallet source code
|
||||
|
||||
You can download CakeWallet source code from our [GitHub repository](github.com/cake-tech/cake_wallet) via git by following next command:
|
||||
`$ git clone https://github.com/cake-tech/cake_wallet.git --branch MrCyjaneK-cyjan-monerodart`
|
||||
OR you can download it as [Zip archive](https://github.com/cake-tech/cake_wallet/archive/refs/heads/MrCyjaneK-cyjan-monerodart.zip)
|
||||
|
||||
### 3. Build Monero, Monero_c and their dependencies
|
||||
|
||||
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`.
|
||||
|
||||
### 4. Configure and build CakeWallet application
|
||||
|
||||
To configure the application open directory where you have downloaded or unarchived CakeWallet sources and run `cakewallet.bat`.
|
||||
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.
|
||||
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.
|
60
docs/builds/ANDROID.md
Normal file
60
docs/builds/ANDROID.md
Normal file
|
@ -0,0 +1,60 @@
|
|||
# Building Cake Wallet for Android
|
||||
|
||||
## Requirements and Setup
|
||||
|
||||
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.
|
||||
|
||||
You can find the latest instructions for installing Docker on your given OS on the official website:
|
||||
|
||||
- <https://docs.docker.com/engine/install/>
|
||||
|
||||
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.
|
||||
|
||||
## Building Cake Wallet or Monero.com
|
||||
|
||||
### Using the pre-built builder image
|
||||
|
||||
In order to build the latest version of Cake Wallet, simply run the following:
|
||||
|
||||
```bash
|
||||
git clone --branch main https://github.com/cake-tech/cake_wallet.git
|
||||
# NOTE: Replace `main` with the latest release tag available at https://github.com/cake-tech/cake_wallet/releases/latest.
|
||||
cd cake_wallet
|
||||
# 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
|
||||
docker run -v$(pwd):$(pwd) -w $(pwd) -i --rm ghcr.io/cake-tech/cake_wallet:main-linux bash -x << EOF
|
||||
set -x -e
|
||||
pushd scripts/android
|
||||
source ./app_env.sh cakewallet
|
||||
# source ./app_env.sh monero.com # Uncomment this line to build monero.com
|
||||
./app_config.sh
|
||||
./build_monero_all.sh
|
||||
./build_mwebd.sh --dont-install
|
||||
popd
|
||||
pushd android/app
|
||||
[[ -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
|
||||
popd
|
||||
flutter clean
|
||||
./model_generator.sh
|
||||
dart run tool/generate_android_key_properties.dart keyAlias=testKey storeFile=key.jks storePassword=hunter1 keyPassword=hunter1
|
||||
dart run tool/generate_localization.dart
|
||||
dart run tool/generate_new_secrets.dart
|
||||
flutter build apk --release --split-per-abi
|
||||
EOF
|
||||
```
|
||||
|
||||
You should see the command complete with similar output:
|
||||
|
||||
```bash
|
||||
Running Gradle task 'assembleRelease'... 519.1s
|
||||
✓ Built build/app/outputs/flutter-apk/app-armeabi-v7a-release.apk (56.3MB)
|
||||
✓ Built build/app/outputs/flutter-apk/app-arm64-v8a-release.apk (55.8MB)
|
||||
✓ Built build/app/outputs/flutter-apk/app-x86_64-release.apk (56.4MB)
|
||||
```
|
||||
|
||||
Final builds can be found in `build/app/outputs/flutter-apk/` as seen above.
|
||||
|
||||
## Signing builds
|
||||
|
||||
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:
|
||||
|
||||
- <https://github.com/ZeusLN/zeus/blob/master/docs/ReproducibleBuilds.md#signing-apks>
|
143
docs/builds/IOS.md
Normal file
143
docs/builds/IOS.md
Normal file
|
@ -0,0 +1,143 @@
|
|||
# Building Cake Wallet for iOS
|
||||
|
||||
## Requirements and Setup
|
||||
|
||||
The following are the system requirements to build Cake Wallet for your iOS device.
|
||||
|
||||
```txt
|
||||
macOS 15.3.1
|
||||
Xcode 16.2
|
||||
Flutter 3.24.4
|
||||
```
|
||||
|
||||
NOTE: Newer versions of macOS and Xcode may also work, but have not been confirmed to work by the Cake team.
|
||||
|
||||
### 1. Installing dependencies
|
||||
|
||||
For installing dependency tools you can use brew [Install brew](https://brew.sh).
|
||||
|
||||
You may easily install them on your build system with the following command:
|
||||
|
||||
```zsh
|
||||
brew install automake ccache cmake cocoapods go libtool pkgconfig xz
|
||||
sudo softwareupdate --install-rosetta --agree-to-license
|
||||
```
|
||||
|
||||
### 2. Installing Xcode
|
||||
|
||||
Download and install the latest version of [Xcode](https://developer.apple.com/xcode/) from macOS App Store.
|
||||
|
||||
Run the following to properly initialize Xcode:
|
||||
|
||||
```zsh
|
||||
sudo xcode-select --switch /Applications/Xcode.app/Contents/Developer
|
||||
sudo xcodebuild -runFirstLaunch
|
||||
```
|
||||
|
||||
To enable iOS build support for Xcode, perform the following:
|
||||
|
||||
1. Open Xcode
|
||||
2. Navigate to settings
|
||||
3. Open Components tab
|
||||
4. Click "Get" next to iOS 18.2 (or any other version that is showing up as default)
|
||||
|
||||
### 3. Installing Flutter
|
||||
|
||||
Install Flutter, specifically version `3.24.4` by following the [official docs](https://docs.flutter.dev/get-started/install/macos/desktop?tab=download).
|
||||
|
||||
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.
|
||||
|
||||
### 4. Installing Rust
|
||||
|
||||
Install Rust from the [rustup.rs](https://rustup.rs/) website.
|
||||
|
||||
```zsh
|
||||
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
|
||||
```
|
||||
|
||||
### 5. Verify Flutter and Xcode installation
|
||||
|
||||
Verify that Flutter and Xcode have been correctly installed on your system with the following command:
|
||||
|
||||
`flutter doctor`
|
||||
|
||||
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.
|
||||
|
||||
```zsh
|
||||
Doctor summary (to see all details, run flutter doctor -v):
|
||||
[✓] Flutter (Channel stable, 3.24.4, on macOS 15.x.x)
|
||||
[✓] Xcode - develop for iOS and macOS (Xcode 16.2)
|
||||
```
|
||||
|
||||
### 6. Acquiring the Cake Wallet source code
|
||||
|
||||
Download the latest release tag of Cake Wallet and enter the source code directory:
|
||||
|
||||
```zsh
|
||||
git clone https://github.com/cake-tech/cake_wallet.git --branch main
|
||||
cd cake_wallet/scripts/ios/
|
||||
```
|
||||
|
||||
NOTE: Replace `main` with the latest release tag available at <https://github.com/cake-tech/cake_wallet/releases/latest>.
|
||||
|
||||
### 7. Setup and build Cake Wallet from source
|
||||
|
||||
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.
|
||||
|
||||
To build Cake Wallet from source, run the following:
|
||||
|
||||
```zsh
|
||||
source ./app_env.sh cakewallet
|
||||
```
|
||||
|
||||
For Monero.com, instead do:
|
||||
|
||||
```zsh
|
||||
source ./app_env.sh monero.com
|
||||
```
|
||||
|
||||
Build the necessary libraries and their dependencies:
|
||||
|
||||
```zsh
|
||||
./build_monero_all.sh
|
||||
./build_mwebd.sh
|
||||
```
|
||||
|
||||
NOTE: This step will take quite a while, so be sure you grab a cup of coffee or a good book!
|
||||
|
||||
Then run the configuration script to setup app name, app icon, etc:
|
||||
|
||||
```zsh
|
||||
./app_config.sh
|
||||
```
|
||||
|
||||
### 8. Prepare Flutter
|
||||
|
||||
Change back to the root directory of the Cake Wallet source code and install Flutter package dependencies:
|
||||
|
||||
```zsh
|
||||
cd ../../
|
||||
flutter pub get
|
||||
```
|
||||
|
||||
Generate secrets as placeholders for official API keys etc. along with localization files and mobx models:
|
||||
|
||||
```zsh
|
||||
dart run tool/generate_new_secrets.dart
|
||||
dart run tool/generate_localization.dart
|
||||
./model_generator.sh
|
||||
```
|
||||
|
||||
### 9. Build
|
||||
|
||||
```zsh
|
||||
flutter build ios --release --no-codesign
|
||||
```
|
||||
|
||||
Then you can open `ios/Runner.xcworkspace` with Xcode to archive the application.
|
||||
|
||||
If you want to run on a connected device, simply run:
|
||||
|
||||
```zsh
|
||||
flutter run
|
||||
```
|
96
docs/builds/LINUX.md
Normal file
96
docs/builds/LINUX.md
Normal file
|
@ -0,0 +1,96 @@
|
|||
# Building Cake Wallet for Linux
|
||||
|
||||
## Requirements and Setup
|
||||
|
||||
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.
|
||||
|
||||
You can find the latest instructions for installing Docker on your given OS on the official website:
|
||||
|
||||
- <https://docs.docker.com/engine/install/>
|
||||
|
||||
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.
|
||||
|
||||
## Building Cake Wallet or Monero.com
|
||||
|
||||
### Using the pre-built builder image
|
||||
|
||||
In order to build the latest version of Cake Wallet, simply run the following:
|
||||
|
||||
```bash
|
||||
git clone --branch main https://github.com/cake-tech/cake_wallet.git
|
||||
# NOTE: Replace `main` with the latest release tag available at https://github.com/cake-tech/cake_wallet/releases/latest.
|
||||
cd cake_wallet
|
||||
# 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
|
||||
docker run -v$(pwd):$(pwd) -w $(pwd) -i --rm ghcr.io/cake-tech/cake_wallet:main-linux bash -x << EOF
|
||||
set -x -e
|
||||
pushd scripts
|
||||
./gen_android_manifest.sh
|
||||
popd
|
||||
pushd scripts/linux
|
||||
source ./app_env.sh cakewallet
|
||||
# source ./app_env.sh monero.com # Uncomment this line to build monero.com
|
||||
./app_config.sh
|
||||
./build_monero_all.sh
|
||||
popd
|
||||
flutter clean
|
||||
./model_generator.sh
|
||||
dart run tool/generate_localization.dart
|
||||
dart run tool/generate_new_secrets.dart
|
||||
flutter build linux
|
||||
EOF
|
||||
```
|
||||
|
||||
You should see the command complete with similar output:
|
||||
|
||||
```bash
|
||||
+ dart run tool/generate_localization.dart
|
||||
+ dart run tool/generate_new_secrets.dart
|
||||
+ flutter build linux
|
||||
|
||||
Building Linux application...
|
||||
✓ Built build/linux/x64/release/bundle/cake_wallet
|
||||
```
|
||||
|
||||
Final builds can be found in `build/linux/x64/release/bundle/` as seen above.
|
||||
|
||||
|
||||
## Flatpak (optional)
|
||||
|
||||
To package the built binaries as a flatpak, you need first to install `flatpak` and `flatpak-builder`:
|
||||
|
||||
```bash
|
||||
sudo apt install flatpak flatpak-builder
|
||||
```
|
||||
|
||||
Add the necessary Flathub:
|
||||
|
||||
```bash
|
||||
flatpak remote-add --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo
|
||||
```
|
||||
|
||||
Then need to install freedesktop runtime and sdk:
|
||||
|
||||
```bash
|
||||
flatpak install flathub org.freedesktop.Platform//22.08 org.freedesktop.Sdk//22.08
|
||||
```
|
||||
|
||||
Next, build the flatpak bundle:
|
||||
|
||||
```bash
|
||||
flatpak-builder --force-clean flatpak-build com.cakewallet.CakeWallet.yml
|
||||
```
|
||||
|
||||
And then export bundle:
|
||||
|
||||
```bash
|
||||
flatpak build-export export flatpak-build
|
||||
flatpak build-bundle export cake_wallet.flatpak com.cakewallet.CakeWallet
|
||||
```
|
||||
|
||||
The Flatpak file, `cake_wallet.flatpak`, should be generated in the current directory.
|
||||
|
||||
To install the newly built Flatpak, run:
|
||||
|
||||
```bash
|
||||
flatpak --user install cake_wallet.flatpak
|
||||
```
|
135
docs/builds/MACOS.md
Normal file
135
docs/builds/MACOS.md
Normal file
|
@ -0,0 +1,135 @@
|
|||
# Building Cake Wallet for macOS
|
||||
|
||||
## Requirements and Setup
|
||||
|
||||
The following are the system requirements to build Cake Wallet for your macOS device.
|
||||
|
||||
```txt
|
||||
macOS 15.3.1
|
||||
Xcode 16.2
|
||||
Flutter 3.24.4
|
||||
```
|
||||
|
||||
### 1. Installing dependencies
|
||||
|
||||
For installing dependency tools you can use brew [Install brew](https://brew.sh).
|
||||
|
||||
You may easily install them on your build system with the following command:
|
||||
|
||||
```zsh
|
||||
brew install autoconf automake binutils ccache cmake cocoapods go libtool pigz pkg-config
|
||||
sudo softwareupdate --install-rosetta --agree-to-license
|
||||
```
|
||||
|
||||
### 2. Installing Xcode
|
||||
|
||||
Download and install the latest version of [Xcode](https://developer.apple.com/xcode/) from macOS App Store.
|
||||
|
||||
Run the following to properly initialize Xcode:
|
||||
|
||||
```zsh
|
||||
sudo xcode-select --switch /Applications/Xcode.app/Contents/Developer
|
||||
sudo xcodebuild -runFirstLaunch
|
||||
```
|
||||
|
||||
### 3. Installing Flutter
|
||||
|
||||
Install Flutter, specifically version `3.24.4` by following the [official docs](https://docs.flutter.dev/get-started/install/macos/desktop?tab=download).
|
||||
|
||||
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.
|
||||
|
||||
### 4. Installing Rust
|
||||
|
||||
Install Rust from the [rustup.rs](https://rustup.rs/) website.
|
||||
|
||||
```zsh
|
||||
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
|
||||
```
|
||||
|
||||
### 5. Verify Flutter and Xcode installation
|
||||
|
||||
Verify that Flutter and Xcode have been correctly installed on your system with the following command:
|
||||
|
||||
`flutter doctor`
|
||||
|
||||
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.
|
||||
|
||||
```zsh
|
||||
Doctor summary (to see all details, run flutter doctor -v):
|
||||
[✓] Flutter (Channel stable, 3.24.4, on macOS 15.x.x)
|
||||
...
|
||||
[✓] Xcode - develop for iOS and macOS (Xcode 16.2)
|
||||
...
|
||||
```
|
||||
|
||||
### 6. Acquiring the Cake Wallet source code
|
||||
|
||||
Download the latest release tag of Cake Wallet and enter the source code directory:
|
||||
|
||||
```zsh
|
||||
git clone https://github.com/cake-tech/cake_wallet.git --branch main
|
||||
cd cake_wallet/scripts/macos/
|
||||
```
|
||||
|
||||
NOTE: Replace `main` with the latest release tag available at <https://github.com/cake-tech/cake_wallet/releases/latest>.
|
||||
|
||||
### 7. Setup and build Cake Wallet from source
|
||||
|
||||
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.
|
||||
|
||||
To build Cake Wallet from source, run the following:
|
||||
|
||||
```zsh
|
||||
source ./app_env.sh cakewallet
|
||||
```
|
||||
|
||||
For Monero.com, instead do:
|
||||
|
||||
```zsh
|
||||
source ./app_env.sh monero.com
|
||||
```
|
||||
|
||||
Build the necessary libraries and their dependencies:
|
||||
|
||||
```zsh
|
||||
./build_monero_all.sh
|
||||
```
|
||||
|
||||
NOTE: This step will take quite a while, so be sure you grab a cup of coffee or a good book!
|
||||
|
||||
Then run the configuration script to setup app name, app icon, etc:
|
||||
|
||||
```zsh
|
||||
./app_config.sh
|
||||
```
|
||||
|
||||
### 8. Prepare Flutter
|
||||
|
||||
Change back to the root directory of the Cake Wallet source code and install Flutter package dependencies:
|
||||
|
||||
```zsh
|
||||
cd ../../
|
||||
flutter pub get
|
||||
```
|
||||
|
||||
Generate secrets as placeholders for official API keys etc. along with localization files and mobx models:
|
||||
|
||||
```zsh
|
||||
dart run tool/generate_new_secrets.dart
|
||||
dart run tool/generate_localization.dart
|
||||
./model_generator.sh
|
||||
```
|
||||
|
||||
### 9. Build
|
||||
|
||||
```zsh
|
||||
flutter build macos --release
|
||||
```
|
||||
|
||||
Then you can open `macos/Runner.xcworkspace` with Xcode to archive the application.
|
||||
|
||||
If you want to run on a connected device, simply run:
|
||||
|
||||
```zsh
|
||||
flutter run
|
||||
```
|
92
docs/builds/WINDOWS.md
Normal file
92
docs/builds/WINDOWS.md
Normal file
|
@ -0,0 +1,92 @@
|
|||
# Building Cake Wallet for Windows
|
||||
|
||||
## Requirements and Setup
|
||||
|
||||
The following are the system requirements to build Cake Wallet for your Windows PC.
|
||||
|
||||
```txt
|
||||
Windows 10 or later (64-bit), x86-64 based
|
||||
Flutter 3.24.4
|
||||
```
|
||||
|
||||
### 1. Installing Flutter
|
||||
|
||||
Install Flutter, specifically version `3.24.4` by following the [official docs](https://docs.flutter.dev/get-started/install/windows).
|
||||
|
||||
In order for Flutter to function, you'll also need to enable Developer Mode:
|
||||
|
||||
Start Menu > search for "Run" > type `ms-settings:developers`, and turn on Developer Mode.
|
||||
|
||||
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.
|
||||
|
||||
### 2. Install Development Tools
|
||||
|
||||
Install Git for Windows and Visual Studio 2022:
|
||||
|
||||
1. Follow the [Development Tools](https://docs.flutter.dev/get-started/install/windows/desktop#development-tools) installation instructions
|
||||
1. NOTE: Be sure to install the `Desktop Development with C++` workload in Visual Studio as outlined in the docs.
|
||||
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.
|
||||
|
||||
Lastly, you'll need to install Nuget separately:
|
||||
|
||||
1. Download the exe from <https://dist.nuget.org/win-x86-commandline/latest/nuget.exe>
|
||||
2. Create a new directory, `C:\Program Files\Nuget\`
|
||||
3. Move or copy the `nuget.exe` binary you just downloaded into the newly created directory above.
|
||||
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.
|
||||
|
||||
### 3. Installing WSL (Windows Subsystem for Linux)
|
||||
|
||||
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).
|
||||
|
||||
1. Open a Powershell window by going to the Start Menu and searching for "Powershell"
|
||||
2. Install WSL with the command `wsl --install`
|
||||
3. Install the necessary Ubuntu dependencies
|
||||
|
||||
```powershell
|
||||
wsl --install
|
||||
wsl sudo apt update
|
||||
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
|
||||
```
|
||||
|
||||
### 4. Installing Rust
|
||||
|
||||
Install Rust and other Rust-related dependencies using [rustup.rs](https://rustup.rs/#) by running the following command:
|
||||
|
||||
```bash
|
||||
wsl curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
|
||||
```
|
||||
|
||||
### 5. Acquiring the Cake Wallet source code
|
||||
|
||||
Download the latest release tag of Cake Wallet and enter the source code directory:
|
||||
|
||||
```powershell
|
||||
git clone https://github.com/cake-tech/cake_wallet.git --branch main
|
||||
cd cake_wallet
|
||||
```
|
||||
|
||||
NOTE: Replace `main` with the latest release tag available at <https://github.com/cake-tech/cake_wallet/releases/latest>.
|
||||
|
||||
### 6. Build Monero, monero_c, and dependencies
|
||||
|
||||
To use Monero in Cake Wallet, you must build the Monero_C wrapper which will be used by monero.dart package.
|
||||
|
||||
Run the following in a WSL terminal window (set the Git username and email as desired):
|
||||
|
||||
```powershell
|
||||
wsl
|
||||
git config --global user.email "builds@cakewallet.com"
|
||||
git config --global user.name "builds"
|
||||
./build_all.sh
|
||||
```
|
||||
|
||||
### 7. Configure and build Cake Wallet application
|
||||
|
||||
To configure the application, run the following:
|
||||
|
||||
```powershell
|
||||
exit
|
||||
.\cakewallet.bat
|
||||
```
|
||||
|
||||
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.
|
|
@ -1,149 +0,0 @@
|
|||
# Building Cake Wallet for Android
|
||||
|
||||
## Requirements and Setup
|
||||
|
||||
The following are the system requirements to build Cake Wallet for your Android device.
|
||||
|
||||
```
|
||||
Ubuntu >= 20.04
|
||||
Android SDK 29 or higher (better to have the latest one 33)
|
||||
Android NDK 17c
|
||||
Flutter 3.24.4
|
||||
```
|
||||
|
||||
### 1. Installing Package Dependencies
|
||||
|
||||
CakeWallet cannot be built without the following packages installed on your system.
|
||||
|
||||
- curl
|
||||
|
||||
- unzip
|
||||
|
||||
- automake
|
||||
|
||||
- build-essential
|
||||
|
||||
- file
|
||||
|
||||
- pkg-config
|
||||
|
||||
- git
|
||||
|
||||
- python
|
||||
|
||||
- libtool
|
||||
|
||||
- libtinfo5
|
||||
|
||||
- cmake
|
||||
|
||||
- openjdk-8-jre-headless
|
||||
|
||||
- clang
|
||||
|
||||
You may easily install them on your build system with the following command:
|
||||
|
||||
`$ sudo apt-get install -y curl unzip automake build-essential file pkg-config git python libtool libtinfo5 cmake openjdk-8-jre-headless clang`
|
||||
|
||||
### 2. Installing Android Studio and Android toolchain
|
||||
|
||||
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**
|
||||
|
||||
### 3. Installing Flutter
|
||||
|
||||
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).
|
||||
|
||||
### 4. Installing rustup
|
||||
|
||||
Install rustup from the [rustup.rs](https://rustup.rs/) website.
|
||||
|
||||
### 5. Verify Installations
|
||||
|
||||
Verify that the Android toolchain, Flutter, and Android Studio have been correctly installed on your system with the following command:
|
||||
|
||||
`$ flutter doctor`
|
||||
|
||||
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.
|
||||
```
|
||||
Doctor summary (to see all details, run flutter doctor -v):
|
||||
[✓] Flutter (Channel stable, 3.24.4, on Linux, locale en_US.UTF-8)
|
||||
[✓] Android toolchain - develop for Android devices (Android SDK version 29 or higher)
|
||||
[✓] Android Studio (version 4.0 or higher)
|
||||
```
|
||||
|
||||
### 6. Generate a secure keystore for Android
|
||||
|
||||
`$ keytool -genkey -v -keystore $HOME/key.jks -keyalg RSA -keysize 2048 -validity 10000 -alias key`
|
||||
|
||||
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.
|
||||
|
||||
### 7. Acquiring the Cake Wallet Source Code
|
||||
|
||||
Create the directory that will be use to store the Cake Wallet source...
|
||||
|
||||
```
|
||||
$ sudo mkdir -p /opt/android
|
||||
$ sudo chown $USER /opt/android
|
||||
$ cd /opt/android
|
||||
```
|
||||
|
||||
..and download the source code into that directory.
|
||||
|
||||
`$ git clone https://github.com/cake-tech/cake_wallet.git --branch main`
|
||||
|
||||
Proceed into the source code before proceeding with the next steps:
|
||||
|
||||
`$ cd cake_wallet/scripts/android/`
|
||||
|
||||
### 8. Installing Android NDK
|
||||
|
||||
`$ ./install_ndk.sh`
|
||||
|
||||
### 9. Execute Build & Setup Commands for Cak eWallet
|
||||
|
||||
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.
|
||||
|
||||
Please pick what app you want to build: cakewallet or monero.com.
|
||||
|
||||
`$ source ./app_env.sh <cakewallet OR monero.com>`
|
||||
(it should be like `$ source ./app_env.sh cakewallet` or `$ source ./app_env.sh monero.com`)
|
||||
|
||||
Then run configuration script for setup app name, app icon and etc:
|
||||
|
||||
`$ ./app_config.sh`
|
||||
|
||||
Build the Monero libraries and their dependencies:
|
||||
|
||||
`$ ./build_all.sh`
|
||||
|
||||
It is now time to change back to the base directory of the Cake Wallet source code:
|
||||
|
||||
`$ cd ../../`
|
||||
|
||||
Install Flutter package dependencies with this command:
|
||||
|
||||
`$ flutter pub get`
|
||||
|
||||
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:
|
||||
|
||||
`$ dart run tool/generate_new_secrets.dart`
|
||||
|
||||
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).
|
||||
|
||||
`$ dart run tool/generate_android_key_properties.dart keyAlias=key storeFile=$HOME/key.jks storePassword=<store password> keyPassword=<key password>`
|
||||
|
||||
**REMINDER:** The *above* command will **not** succeed unless you replaced the `storePassword` and `keyPassword` variables with the correct passwords for your keystore.
|
||||
|
||||
Then we need to generate localization files.
|
||||
|
||||
`$ dart run tool/generate_localization.dart`
|
||||
|
||||
Finally build mobx models for the app:
|
||||
|
||||
`$ ./model_generator.sh`
|
||||
|
||||
### 10. Build!
|
||||
|
||||
`$ flutter build apk --release`
|
||||
|
||||
Copyright (c) 2024 Cake Labs LLC
|
|
@ -1,101 +0,0 @@
|
|||
# Building Cake Wallet for iOS
|
||||
|
||||
## Requirements and Setup
|
||||
|
||||
The following are the system requirements to build Cake Wallet for your iOS device.
|
||||
|
||||
```
|
||||
macOS >= 14.0
|
||||
Xcode 15.3
|
||||
Flutter 3.24.4
|
||||
```
|
||||
|
||||
### 1. Installing Package Dependencies
|
||||
|
||||
Cake Wallet cannot be built without the following packages installed on your build system.
|
||||
|
||||
For installing dependency tools you can use brew [Install brew](https://brew.sh).
|
||||
|
||||
You may easily install them on your build system with the following command:
|
||||
|
||||
`$ brew install cmake xz cocoapods`
|
||||
|
||||
### 2. Installing Xcode
|
||||
|
||||
You may download and install the latest version of [Xcode](https://developer.apple.com/xcode/) from macOS App Store.
|
||||
|
||||
### 3. Installing Flutter
|
||||
|
||||
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).
|
||||
|
||||
### 4. Installing rustup
|
||||
|
||||
Install rustup from the [rustup.rs](https://rustup.rs/) website.
|
||||
|
||||
### 5. Verify Installations
|
||||
|
||||
Verify that the Flutter and Xcode have been correctly installed on your system with the following command:
|
||||
|
||||
`$ flutter doctor`
|
||||
|
||||
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.
|
||||
```
|
||||
Doctor summary (to see all details, run flutter doctor -v):
|
||||
[✓] Flutter (Channel stable, 3.24.4, on macOS 14.x.x)
|
||||
[✓] Xcode - develop for iOS and macOS (Xcode 15.3)
|
||||
```
|
||||
|
||||
### 6. Acquiring the CakeWallet source code
|
||||
|
||||
Download the source code.
|
||||
|
||||
`$ git clone https://github.com/cake-tech/cake_wallet.git --branch main`
|
||||
|
||||
Proceed into the source code before proceeding with the next steps:
|
||||
|
||||
`$ cd cake_wallet/scripts/ios/`
|
||||
|
||||
### 7. Execute Build & Setup Commands for Cake Wallet
|
||||
|
||||
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.
|
||||
|
||||
Please pick what app you want to build: cakewallet or monero.com.
|
||||
|
||||
`$ source ./app_env.sh <cakewallet OR monero.com>`
|
||||
(it should be like `$ source ./app_env.sh cakewallet` or `$ source ./app_env.sh monero.com`)
|
||||
|
||||
Then run configuration script for setup app name, app icon and etc:
|
||||
|
||||
`$ ./app_config.sh`
|
||||
|
||||
Build the Monero libraries and their dependencies:
|
||||
|
||||
`$ ./build_monero_all.sh`
|
||||
|
||||
It is now time to change back to the base directory of the Cake Wallet source code:
|
||||
|
||||
`$ cd ../../`
|
||||
|
||||
Install Flutter package dependencies with this command:
|
||||
|
||||
`$ flutter pub get`
|
||||
|
||||
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:
|
||||
|
||||
`$ dart run tool/generate_new_secrets.dart`
|
||||
|
||||
Then we need to generate localization files and mobx models.
|
||||
|
||||
`$ ./configure_cake_wallet.sh ios`
|
||||
|
||||
### 8. Build!
|
||||
|
||||
`$ flutter build ios --release`
|
||||
|
||||
Then you can open `ios/Runner.xcworkspace` with Xcode and you can archive the application.
|
||||
|
||||
Or if you want to run to connected device:
|
||||
|
||||
`$ flutter run --release`
|
||||
|
||||
Copyright (c) 2024 Cake Labs LLC
|
|
@ -1,112 +0,0 @@
|
|||
# Building Cake Wallet for macOS
|
||||
|
||||
## Requirements and Setup
|
||||
|
||||
The following are the system requirements to build Cake Wallet for your macOS device.
|
||||
|
||||
```
|
||||
macOS >= 14.0
|
||||
Xcode 15.3
|
||||
Flutter 3.24.4
|
||||
```
|
||||
|
||||
### 1. Installing Package Dependencies
|
||||
|
||||
Cake Wallet cannot be built without the following packages installed on your build system.
|
||||
|
||||
For installing dependency tools you can use brew [Install brew](https://brew.sh).
|
||||
|
||||
You may easily install them on your build system with the following command:
|
||||
|
||||
`$ brew install cmake xz automake autoconf libtool boost@1.76 zmq cocoapods`
|
||||
|
||||
`$ brew link boost@1.76`
|
||||
|
||||
### 2. Installing Xcode
|
||||
|
||||
You may download and install the latest version of [Xcode](https://developer.apple.com/xcode/) from macOS App Store.
|
||||
|
||||
### 3. Installing Flutter
|
||||
|
||||
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).
|
||||
|
||||
### 4. Installing rustup
|
||||
|
||||
Install rustup from the [rustup.rs](https://rustup.rs/) website.
|
||||
|
||||
### 5. Verify Installations
|
||||
|
||||
Verify that Flutter and Xcode have been correctly installed on your system with the following command:
|
||||
|
||||
`$ flutter doctor`
|
||||
|
||||
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.
|
||||
```
|
||||
Doctor summary (to see all details, run flutter doctor -v):
|
||||
[✓] Flutter (Channel stable, 3.24.4, on macOS 14.x.x)
|
||||
[✓] Xcode - develop for iOS and macOS (Xcode 15.3)
|
||||
```
|
||||
|
||||
### 6. Acquiring the Cake Wallet source code
|
||||
|
||||
Download the source code.
|
||||
|
||||
`$ git clone https://github.com/cake-tech/cake_wallet.git --branch main`
|
||||
|
||||
Proceed into the source code before proceeding with the next steps:
|
||||
|
||||
`$ cd cake_wallet/scripts/macos/`
|
||||
|
||||
### 7. Execute Build & Setup Commands for Cake Wallet
|
||||
|
||||
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.
|
||||
|
||||
Please pick what app you want to build: cakewallet or monero.com.
|
||||
|
||||
`$ source ./app_env.sh <cakewallet OR monero.com>`
|
||||
(it should be like `$ source ./app_env.sh cakewallet` or `$ source ./app_env.sh monero.com`)
|
||||
|
||||
Then run configuration script for setup app name, app icon and etc:
|
||||
|
||||
`$ ./app_config.sh`
|
||||
|
||||
Build the Monero libraries and their dependencies:
|
||||
|
||||
`$ ./build_monero_all.sh`
|
||||
|
||||
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):
|
||||
|
||||
- Need to install Rosetta: `$ softwareupdate --install-rosetta`
|
||||
- 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)
|
||||
- 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`
|
||||
- Run building script with additional argument: `$ ./build_monero_all.sh universal`
|
||||
|
||||
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`.
|
||||
|
||||
It is now time to change back to the base directory of the Cake Wallet source code:
|
||||
|
||||
`$ cd ../../`
|
||||
|
||||
Install Flutter package dependencies with this command:
|
||||
|
||||
`$ flutter pub get`
|
||||
|
||||
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:
|
||||
|
||||
`$ dart run tool/generate_new_secrets.dart`
|
||||
|
||||
Then we need to generate localization files and mobx models.
|
||||
|
||||
`$ ./configure_cake_wallet.sh macos`
|
||||
|
||||
### 8. Build!
|
||||
|
||||
`$ flutter build macos --release`
|
||||
|
||||
Then you can open `macos/Runner.xcworkspace` with Xcode and you can to archive the application.
|
||||
|
||||
Or if you want to run to connected device:
|
||||
|
||||
`$ flutter run --release`
|
||||
|
||||
Copyright (c) 2024 Cake Labs LLC
|
|
@ -1,57 +0,0 @@
|
|||
# Building Cake Wallet for Windows
|
||||
|
||||
## Requirements and Setup
|
||||
|
||||
The following are the system requirements to build CakeWallet for your Windows PC.
|
||||
|
||||
```
|
||||
Windows 10 or later (64-bit), x86-64 based
|
||||
Flutter 3.24.4
|
||||
```
|
||||
|
||||
### 1. Installing Flutter
|
||||
|
||||
Install Flutter with version `3.24.4`. Follow the Flutter [installation guide](https://docs.flutter.dev/get-started/install/windows).
|
||||
|
||||
### 2. Install Development Tools
|
||||
|
||||
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.
|
||||
|
||||
Then install `Desktop development with C++` packages via 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`.
|
||||
|
||||
### 3. Installing rustup
|
||||
|
||||
Install rustup from the [rustup.rs](https://rustup.rs/#) website. Download and run the 64-bit rustup-init.exe
|
||||
|
||||
### 4. Installing WSL (Windows Subsystem for Linux)
|
||||
|
||||
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):
|
||||
`$ sudo apt update `
|
||||
`$ sudo apt build-essential cmake gcc-mingw-w64 g++-mingw-w64 autoconf libtool pkg-config`
|
||||
|
||||
### 5. Pull Cake Wallet source code
|
||||
|
||||
You can download CakeWallet source code from our [GitHub repository](github.com/cake-tech/cake_wallet) via git:
|
||||
`$ git clone https://github.com/cake-tech/cake_wallet.git --branch MrCyjaneK-cyjan-monerodart`
|
||||
OR you can download it as [Zip archive](https://github.com/cake-tech/cake_wallet/archive/refs/heads/MrCyjaneK-cyjan-monerodart.zip)
|
||||
|
||||
### 6. Build Monero, monero_c and their dependencies
|
||||
|
||||
To use Monero in Cake Wallet, you must build the Monero_C wrapper which will be used by monero.dart package.
|
||||
|
||||
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`.
|
||||
|
||||
### 7. Configure and build Cake Wallet application
|
||||
|
||||
To configure the application, open the directory where you have downloaded or unarchived Cake Wallet sources and run `cakewallet.bat`.
|
||||
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.
|
||||
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.
|
||||
|
||||
Copyright (c) 2024 Cake Labs LLC.
|
|
@ -119,9 +119,6 @@ install(FILES "${CMAKE_CURRENT_SOURCE_DIR}/../scripts/monero_c/release/monero/${
|
|||
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"
|
||||
COMPONENT Runtime)
|
||||
|
||||
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"
|
||||
COMPONENT Runtime)
|
||||
|
||||
install(TARGETS ${BINARY_NAME} RUNTIME DESTINATION "${CMAKE_INSTALL_PREFIX}"
|
||||
COMPONENT Runtime)
|
||||
|
||||
|
|
|
@ -6,9 +6,9 @@ TOOLCHAIN_A32_DIR=${TOOLCHAIN_DIR}_aarch
|
|||
TOOLCHAIN_A64_DIR=${TOOLCHAIN_DIR}_aarch64
|
||||
TOOLCHAIN_x86_DIR=${TOOLCHAIN_DIR}_i686
|
||||
TOOLCHAIN_x86_64_DIR=${TOOLCHAIN_DIR}_x86_64
|
||||
ANDROID_NDK_SHA256="3f541adbd0330a9205ba12697f6d04ec90752c53d6b622101a2a8a856e816589"
|
||||
ANDROID_NDK_SHA256="7a1302d9bfbc37d46be90b2285f4737508ffe08a346cf2424c5c6a744de2db22"
|
||||
|
||||
curl https://dl.google.com/android/repository/android-ndk-r17c-linux-x86_64.zip -o ${ANDROID_NDK_ZIP}
|
||||
curl https://dl.google.com/android/repository/android-ndk-r27c-linux.zip -o ${ANDROID_NDK_ZIP}
|
||||
echo $ANDROID_NDK_SHA256 $ANDROID_NDK_ZIP | sha256sum -c || exit 1
|
||||
unzip $ANDROID_NDK_ZIP -d $WORKDIR
|
||||
|
||||
|
|
|
@ -7,7 +7,7 @@ cd "$(dirname "$0")"
|
|||
|
||||
../prepare_moneroc.sh
|
||||
|
||||
for COIN in monero wownero zano;
|
||||
for COIN in monero wownero;
|
||||
do
|
||||
pushd ../monero_c
|
||||
for target in x86_64-linux-gnu # aarch64-linux-gnu
|
||||
|
|
Loading…
Reference in a new issue