mirror of
https://github.com/cake-tech/cake_wallet.git
synced 2025-05-03 20:02:13 +00:00
Merge branch 'main' of https://github.com/cake-tech/cake_wallet into CW-994-mweb-enhancements
This commit is contained in:
commit
e515fad8f8
11 changed files with 187 additions and 102 deletions
.github/workflows
.gitignoreDockerfilecom.cakewallet.CakeWallet.ymldocs/builds
lib/view_model/send
linux
scripts/linux
2
.github/workflows/pr_test_build_android.yml
vendored
2
.github/workflows/pr_test_build_android.yml
vendored
|
@ -9,7 +9,7 @@ jobs:
|
||||||
PR_test_build:
|
PR_test_build:
|
||||||
runs-on: linux-amd64
|
runs-on: linux-amd64
|
||||||
container:
|
container:
|
||||||
image: ghcr.io/cake-tech/cake_wallet:3.27.4-linux
|
image: ghcr.io/cake-tech/cake_wallet:debian12-flutter3.27.4-go1.24.1
|
||||||
env:
|
env:
|
||||||
STORE_PASS: test@cake_wallet
|
STORE_PASS: test@cake_wallet
|
||||||
KEY_PASS: test@cake_wallet
|
KEY_PASS: test@cake_wallet
|
||||||
|
|
5
.github/workflows/pr_test_build_linux.yml
vendored
5
.github/workflows/pr_test_build_linux.yml
vendored
|
@ -9,7 +9,7 @@ jobs:
|
||||||
PR_test_build:
|
PR_test_build:
|
||||||
runs-on: linux-amd64
|
runs-on: linux-amd64
|
||||||
container:
|
container:
|
||||||
image: ghcr.io/cake-tech/cake_wallet:3.27.4-linux
|
image: ghcr.io/cake-tech/cake_wallet:debian12-flutter3.27.4-go1.24.1
|
||||||
env:
|
env:
|
||||||
STORE_PASS: test@cake_wallet
|
STORE_PASS: test@cake_wallet
|
||||||
KEY_PASS: test@cake_wallet
|
KEY_PASS: test@cake_wallet
|
||||||
|
@ -22,9 +22,6 @@ jobs:
|
||||||
- /opt/cw_cache_linux/root/.pub-cache/:/root/.pub-cache
|
- /opt/cw_cache_linux/root/.pub-cache/:/root/.pub-cache
|
||||||
- /opt/cw_cache_linux/root/go/pkg:/root/go/pkg
|
- /opt/cw_cache_linux/root/go/pkg:/root/go/pkg
|
||||||
- /opt/cw_cache_linux/opt/generic_cache:/opt/generic_cache
|
- /opt/cw_cache_linux/opt/generic_cache:/opt/generic_cache
|
||||||
strategy:
|
|
||||||
matrix:
|
|
||||||
api-level: [29]
|
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Fix github actions messing up $HOME...
|
- name: Fix github actions messing up $HOME...
|
||||||
|
|
8
.gitignore
vendored
8
.gitignore
vendored
|
@ -186,6 +186,10 @@ ios/WowneroWallet.framework/WowneroWallet
|
||||||
ios/ZanoWallet.framework/ZanoWallet
|
ios/ZanoWallet.framework/ZanoWallet
|
||||||
*_libwallet2_api_c.dylib
|
*_libwallet2_api_c.dylib
|
||||||
|
|
||||||
|
.flatpak-builder
|
||||||
|
cake_wallet.flatpak
|
||||||
|
flatpak-build/
|
||||||
|
|
||||||
# macOS
|
# macOS
|
||||||
**/Flutter/ephemeral/
|
**/Flutter/ephemeral/
|
||||||
**/Pods/
|
**/Pods/
|
||||||
|
@ -204,7 +208,3 @@ ios/ZanoWallet.framework/ZanoWallet
|
||||||
**/linux/flutter/generated_plugin_registrant.cc
|
**/linux/flutter/generated_plugin_registrant.cc
|
||||||
**/linux/flutter/generated_plugin_registrant.h
|
**/linux/flutter/generated_plugin_registrant.h
|
||||||
**/linux/flutter/generated_plugins.cmake
|
**/linux/flutter/generated_plugins.cmake
|
||||||
|
|
||||||
cake_wallet.flatpak
|
|
||||||
flatpak-build/
|
|
||||||
export/
|
|
57
Dockerfile
57
Dockerfile
|
@ -1,5 +1,4 @@
|
||||||
# docker build . -f Dockerfile -t ghcr.io/cake-tech/cake_wallet:3.27.4-linux
|
# docker buildx build --push --pull --platform linux/amd64,linux/arm64 . -f Dockerfile -t ghcr.io/cake-tech/cake_wallet:debian12-flutter3.27.4-go1.24.1
|
||||||
# docker push ghcr.io/cake-tech/cake_wallet:3.27.4-linux
|
|
||||||
|
|
||||||
# Heavily inspired by cirrusci images
|
# 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/tools/Dockerfile
|
||||||
|
@ -7,7 +6,7 @@
|
||||||
# https://github.com/cirruslabs/docker-images-android/blob/master/sdk/34-ndk/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
|
# https://github.com/cirruslabs/docker-images-flutter/blob/master/sdk/Dockerfile
|
||||||
|
|
||||||
FROM --platform=linux/amd64 docker.io/debian:12
|
FROM docker.io/debian:12
|
||||||
|
|
||||||
LABEL org.opencontainers.image.source=https://github.com/cake-tech/cake_wallet
|
LABEL org.opencontainers.image.source=https://github.com/cake-tech/cake_wallet
|
||||||
|
|
||||||
|
@ -60,11 +59,20 @@ RUN set -o xtrace \
|
||||||
ffmpeg network-manager x11-utils xvfb psmisc \
|
ffmpeg network-manager x11-utils xvfb psmisc \
|
||||||
# aarch64-linux-gnu dependencies
|
# aarch64-linux-gnu dependencies
|
||||||
g++-aarch64-linux-gnu gcc-aarch64-linux-gnu \
|
g++-aarch64-linux-gnu gcc-aarch64-linux-gnu \
|
||||||
|
# x86_64-linux-gnu dependencies
|
||||||
|
g++-x86-64-linux-gnu gcc-x86-64-linux-gnu \
|
||||||
|
# flatpak dependencies
|
||||||
|
flatpak flatpak-builder binutils elfutils patch unzip xz-utils zstd \
|
||||||
&& apt clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* \
|
&& apt clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* \
|
||||||
&& sh -c 'echo "en_US.UTF-8 UTF-8" > /etc/locale.gen' \
|
&& sh -c 'echo "en_US.UTF-8 UTF-8" > /etc/locale.gen' \
|
||||||
&& locale-gen \
|
&& locale-gen \
|
||||||
&& update-locale LANG=en_US.UTF-8
|
&& update-locale LANG=en_US.UTF-8
|
||||||
|
|
||||||
|
ENV FLATPAK_RUNTIME_VERSION=24.08
|
||||||
|
RUN flatpak remote-add --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo \
|
||||||
|
&& flatpak install -y flathub org.freedesktop.Platform//${FLATPAK_RUNTIME_VERSION} \
|
||||||
|
&& flatpak install -y flathub org.freedesktop.Sdk//${FLATPAK_RUNTIME_VERSION}
|
||||||
|
|
||||||
# Install nodejs for Github Actions
|
# Install nodejs for Github Actions
|
||||||
RUN curl -fsSL https://deb.nodesource.com/setup_23.x | bash - && \
|
RUN curl -fsSL https://deb.nodesource.com/setup_23.x | bash - && \
|
||||||
apt-get install -y --no-install-recommends nodejs && \
|
apt-get install -y --no-install-recommends nodejs && \
|
||||||
|
@ -74,14 +82,28 @@ RUN curl -fsSL https://deb.nodesource.com/setup_23.x | bash - && \
|
||||||
ENV PATH=${PATH}:/usr/local/go/bin:${HOME}/go/bin
|
ENV PATH=${PATH}:/usr/local/go/bin:${HOME}/go/bin
|
||||||
ENV GOROOT=/usr/local/go
|
ENV GOROOT=/usr/local/go
|
||||||
ENV GOPATH=${HOME}/go
|
ENV GOPATH=${HOME}/go
|
||||||
RUN wget https://go.dev/dl/go${GOLANG_VERSION}.linux-amd64.tar.gz &&\
|
RUN ARCH=$(uname -m) && \
|
||||||
rm -rf /usr/local/go &&\
|
if [ "$ARCH" = "x86_64" ]; then \
|
||||||
tar -C /usr/local -xzf go${GOLANG_VERSION}.linux-amd64.tar.gz && \
|
wget https://go.dev/dl/go${GOLANG_VERSION}.linux-amd64.tar.gz -O go.tar.gz; \
|
||||||
|
elif [ "$ARCH" = "aarch64" ]; then \
|
||||||
|
wget https://go.dev/dl/go${GOLANG_VERSION}.linux-arm64.tar.gz -O go.tar.gz; \
|
||||||
|
else \
|
||||||
|
echo "Unsupported architecture: $ARCH"; exit 1; \
|
||||||
|
fi && \
|
||||||
|
rm -rf /usr/local/go && \
|
||||||
|
tar -C /usr/local -xzf go.tar.gz && \
|
||||||
|
rm go.tar.gz && \
|
||||||
go install golang.org/x/mobile/cmd/gomobile@latest && \
|
go install golang.org/x/mobile/cmd/gomobile@latest && \
|
||||||
gomobile init
|
gomobile init
|
||||||
|
|
||||||
|
RUN git config --global user.email "czarek@cakewallet.com" \
|
||||||
|
&& git config --global user.name "CakeWallet CI"
|
||||||
|
|
||||||
|
|
||||||
# Install Android SDK commandline tools and emulator
|
# 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 \
|
RUN ARCH=$(uname -m) && \
|
||||||
|
if [ "$ARCH" != "x86_64" ]; then exit 0; fi \
|
||||||
|
&& 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/ \
|
&& mkdir -p ${ANDROID_HOME}/cmdline-tools/ \
|
||||||
&& unzip -q android-sdk-tools.zip -d ${ANDROID_HOME}/cmdline-tools/ \
|
&& unzip -q android-sdk-tools.zip -d ${ANDROID_HOME}/cmdline-tools/ \
|
||||||
&& mv ${ANDROID_HOME}/cmdline-tools/cmdline-tools ${ANDROID_HOME}/cmdline-tools/latest \
|
&& mv ${ANDROID_HOME}/cmdline-tools/cmdline-tools ${ANDROID_HOME}/cmdline-tools/latest \
|
||||||
|
@ -94,14 +116,17 @@ RUN wget -q https://dl.google.com/android/repository/commandlinetools-linux-${AN
|
||||||
&& sdkmanager platform-tools \
|
&& sdkmanager platform-tools \
|
||||||
&& mkdir -p ${HOME}/.android \
|
&& mkdir -p ${HOME}/.android \
|
||||||
&& touch ${HOME}/.android/repositories.cfg \
|
&& touch ${HOME}/.android/repositories.cfg \
|
||||||
&& git config --global user.email "czarek@cakewallet.com" \
|
|
||||||
&& git config --global user.name "CakeWallet CI"
|
|
||||||
|
|
||||||
# Handle emulator not being 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
|
RUN ARCH=$(uname -m) && \
|
||||||
|
if [ "$ARCH" != "x86_64" ]; then exit 0; fi \
|
||||||
|
&& sdkmanager emulator
|
||||||
|
|
||||||
# Pre-install extra Android SDK dependencies in order to not have to download them for each build
|
# Pre-install extra Android SDK dependencies in order to not have to download them for each build
|
||||||
RUN yes | sdkmanager \
|
RUN ARCH=$(uname -m) && \
|
||||||
|
if [ "$ARCH" != "x86_64" ]; then exit 0; fi \
|
||||||
|
&& yes | sdkmanager \
|
||||||
"platforms;android-$ANDROID_PLATFORM_VERSION" \
|
"platforms;android-$ANDROID_PLATFORM_VERSION" \
|
||||||
"build-tools;$ANDROID_BUILD_TOOLS_VERSION" \
|
"build-tools;$ANDROID_BUILD_TOOLS_VERSION" \
|
||||||
"platforms;android-33" \
|
"platforms;android-33" \
|
||||||
|
@ -114,12 +139,16 @@ RUN yes | sdkmanager \
|
||||||
|
|
||||||
# Install extra NDK dependency for sp_scanner
|
# Install extra NDK dependency for sp_scanner
|
||||||
ENV ANDROID_NDK_VERSION=27.2.12479018
|
ENV ANDROID_NDK_VERSION=27.2.12479018
|
||||||
RUN yes | sdkmanager "ndk;$ANDROID_NDK_VERSION" \
|
RUN ARCH=$(uname -m) && \
|
||||||
|
if [ "$ARCH" != "x86_64" ]; then exit 0; fi \
|
||||||
|
&& yes | sdkmanager "ndk;$ANDROID_NDK_VERSION" \
|
||||||
"ndk;27.0.12077973"
|
"ndk;27.0.12077973"
|
||||||
|
|
||||||
# Install dependencies for tests
|
# Install dependencies for tests
|
||||||
# Comes from https://github.com/ReactiveCircus/android-emulator-runner
|
# Comes from https://github.com/ReactiveCircus/android-emulator-runner
|
||||||
RUN yes | sdkmanager \
|
RUN ARCH=$(uname -m) && \
|
||||||
|
if [ "$ARCH" != "x86_64" ]; then exit 0; fi \
|
||||||
|
&& yes | sdkmanager \
|
||||||
"system-images;android-29;default;x86_64" \
|
"system-images;android-29;default;x86_64" \
|
||||||
"system-images;android-31;default;x86_64" \
|
"system-images;android-31;default;x86_64" \
|
||||||
"platforms;android-29" \
|
"platforms;android-29" \
|
||||||
|
@ -135,7 +164,7 @@ RUN (addgroup kvm || true) && \
|
||||||
ENV PATH=${HOME}/.cargo/bin:${PATH}
|
ENV PATH=${HOME}/.cargo/bin:${PATH}
|
||||||
RUN curl https://sh.rustup.rs -sSf | bash -s -- -y && \
|
RUN curl https://sh.rustup.rs -sSf | bash -s -- -y && \
|
||||||
cargo install cargo-ndk && \
|
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; \
|
for target in aarch64-linux-android armv7-linux-androideabi i686-linux-android x86_64-linux-android x86_64-unknown-linux-gnu aarch64-unknown-linux-gnu aarch64-unknown-linux-gnu; \
|
||||||
do \
|
do \
|
||||||
rustup target add --toolchain stable $target; \
|
rustup target add --toolchain stable $target; \
|
||||||
done
|
done
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
app-id: com.cakewallet.CakeWallet
|
app-id: com.cakewallet.CakeWallet
|
||||||
runtime: org.freedesktop.Platform
|
runtime: org.freedesktop.Platform
|
||||||
runtime-version: '22.08'
|
runtime-version: '24.08'
|
||||||
sdk: org.freedesktop.Sdk
|
sdk: org.freedesktop.Sdk
|
||||||
command: cake_wallet
|
command: cake_wallet
|
||||||
separate-locales: false
|
separate-locales: false
|
||||||
|
@ -15,8 +15,6 @@ finish-args:
|
||||||
modules:
|
modules:
|
||||||
- name: cake_wallet
|
- name: cake_wallet
|
||||||
buildsystem: simple
|
buildsystem: simple
|
||||||
only-arches:
|
|
||||||
- x86_64
|
|
||||||
build-commands:
|
build-commands:
|
||||||
- "cp -R bundle /app/cake_wallet"
|
- "cp -R bundle /app/cake_wallet"
|
||||||
- "chmod +x /app/cake_wallet/cake_wallet"
|
- "chmod +x /app/cake_wallet/cake_wallet"
|
||||||
|
@ -28,7 +26,7 @@ modules:
|
||||||
- "cp com.cakewallet.CakeWallet.desktop /app/share/applications"
|
- "cp com.cakewallet.CakeWallet.desktop /app/share/applications"
|
||||||
sources:
|
sources:
|
||||||
- type: dir
|
- type: dir
|
||||||
path: build/linux/x64/release
|
path: build/linux/current/release
|
||||||
- type: file
|
- type: file
|
||||||
path: assets/images/cakewallet_icon_180.png
|
path: assets/images/cakewallet_icon_180.png
|
||||||
- type: file
|
- type: file
|
||||||
|
|
|
@ -8,8 +8,6 @@ You can find the latest instructions for installing Docker on your given OS on t
|
||||||
|
|
||||||
- <https://docs.docker.com/engine/install/>
|
- <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
|
## Building Cake Wallet or Monero.com
|
||||||
|
|
||||||
### Using the pre-built builder image
|
### Using the pre-built builder image
|
||||||
|
@ -20,8 +18,8 @@ In order to build the latest version of Cake Wallet, simply run the following:
|
||||||
git clone --branch main https://github.com/cake-tech/cake_wallet.git
|
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.
|
# NOTE: Replace `main` with the latest release tag available at https://github.com/cake-tech/cake_wallet/releases/latest.
|
||||||
cd cake_wallet
|
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 build -t ghcr.io/cake-tech/cake_wallet:debian12-flutter3.27.4-go1.24.1 . # 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
|
docker run -v$(pwd):$(pwd) -w $(pwd) -i --rm ghcr.io/cake-tech/cake_wallet:debian12-flutter3.27.4-go1.24.1 bash -x << EOF
|
||||||
set -x -e
|
set -x -e
|
||||||
pushd scripts/android
|
pushd scripts/android
|
||||||
source ./app_env.sh cakewallet
|
source ./app_env.sh cakewallet
|
||||||
|
|
|
@ -20,8 +20,8 @@ In order to build the latest version of Cake Wallet, simply run the following:
|
||||||
git clone --branch main https://github.com/cake-tech/cake_wallet.git
|
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.
|
# NOTE: Replace `main` with the latest release tag available at https://github.com/cake-tech/cake_wallet/releases/latest.
|
||||||
cd cake_wallet
|
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 build -t ghcr.io/cake-tech/cake_wallet:debian12-flutter3.27.4-go1.24.1 . # 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
|
docker run --privileged -v$(pwd):$(pwd) -w $(pwd) -i --rm ghcr.io/cake-tech/cake_wallet:debian12-flutter3.27.4-go1.24.1 bash -x << EOF
|
||||||
set -x -e
|
set -x -e
|
||||||
pushd scripts
|
pushd scripts
|
||||||
./gen_android_manifest.sh
|
./gen_android_manifest.sh
|
||||||
|
@ -37,6 +37,13 @@ flutter clean
|
||||||
dart run tool/generate_localization.dart
|
dart run tool/generate_localization.dart
|
||||||
dart run tool/generate_new_secrets.dart
|
dart run tool/generate_new_secrets.dart
|
||||||
flutter build linux
|
flutter build linux
|
||||||
|
cp -r build/linux/x64 build/linux/current
|
||||||
|
# use line below if you are building on arm64
|
||||||
|
# cp -r build/linux/arm64 build/linux/current
|
||||||
|
# If you want to build flatpak you need --privileged flag
|
||||||
|
flatpak-builder --force-clean flatpak-build com.cakewallet.CakeWallet.yml
|
||||||
|
flatpak build-export export flatpak-build
|
||||||
|
flatpak build-bundle export build/linux/current/cake_wallet.flatpak com.cakewallet.CakeWallet
|
||||||
EOF
|
EOF
|
||||||
```
|
```
|
||||||
|
|
||||||
|
@ -51,46 +58,11 @@ Building Linux application...
|
||||||
✓ Built build/linux/x64/release/bundle/cake_wallet
|
✓ Built build/linux/x64/release/bundle/cake_wallet
|
||||||
```
|
```
|
||||||
|
|
||||||
Final builds can be found in `build/linux/x64/release/bundle/` as seen above.
|
Final builds can be found in `build/linux/current/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:
|
To install the newly built Flatpak, run:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
flatpak --user install cake_wallet.flatpak
|
flatpak --user install build/linux/current/cake_wallet.flatpak
|
||||||
```
|
```
|
||||||
|
|
|
@ -294,37 +294,26 @@ abstract class OutputBase with Store {
|
||||||
|
|
||||||
switch (_wallet.type) {
|
switch (_wallet.type) {
|
||||||
case WalletType.monero:
|
case WalletType.monero:
|
||||||
|
case WalletType.ethereum:
|
||||||
|
case WalletType.polygon:
|
||||||
|
case WalletType.solana:
|
||||||
|
case WalletType.tron:
|
||||||
|
case WalletType.haven:
|
||||||
|
case WalletType.zano:
|
||||||
|
case WalletType.nano:
|
||||||
|
case WalletType.decred:
|
||||||
maximumFractionDigits = 12;
|
maximumFractionDigits = 12;
|
||||||
break;
|
break;
|
||||||
case WalletType.bitcoin:
|
case WalletType.bitcoin:
|
||||||
maximumFractionDigits = 8;
|
|
||||||
break;
|
|
||||||
case WalletType.litecoin:
|
case WalletType.litecoin:
|
||||||
maximumFractionDigits = 8;
|
|
||||||
break;
|
|
||||||
case WalletType.bitcoinCash:
|
case WalletType.bitcoinCash:
|
||||||
maximumFractionDigits = 8;
|
maximumFractionDigits = 8;
|
||||||
break;
|
break;
|
||||||
case WalletType.haven:
|
|
||||||
maximumFractionDigits = 12;
|
|
||||||
break;
|
|
||||||
case WalletType.ethereum:
|
|
||||||
case WalletType.polygon:
|
|
||||||
maximumFractionDigits = 12;
|
|
||||||
break;
|
|
||||||
case WalletType.solana:
|
|
||||||
maximumFractionDigits = 12;
|
|
||||||
break;
|
|
||||||
case WalletType.tron:
|
|
||||||
maximumFractionDigits = 12;
|
|
||||||
break;
|
|
||||||
case WalletType.wownero:
|
case WalletType.wownero:
|
||||||
maximumFractionDigits = 11;
|
maximumFractionDigits = 11;
|
||||||
break;
|
break;
|
||||||
case WalletType.zano:
|
case WalletType.none:
|
||||||
maximumFractionDigits = 12;
|
case WalletType.banano:
|
||||||
break;
|
|
||||||
default:
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -107,7 +107,7 @@ install(CODE "
|
||||||
set(INSTALL_BUNDLE_DATA_DIR "${CMAKE_INSTALL_PREFIX}/data")
|
set(INSTALL_BUNDLE_DATA_DIR "${CMAKE_INSTALL_PREFIX}/data")
|
||||||
set(INSTALL_BUNDLE_LIB_DIR "${CMAKE_INSTALL_PREFIX}/lib")
|
set(INSTALL_BUNDLE_LIB_DIR "${CMAKE_INSTALL_PREFIX}/lib")
|
||||||
|
|
||||||
if(CMAKE_SYSTEM_PROCESSOR STREQUAL "aarch64")
|
if(CMAKE_SYSTEM_PROCESSOR STREQUAL "aarch64" OR CMAKE_SYSTEM_PROCESSOR STREQUAL "arm64")
|
||||||
set(LIB_TRIPLET "aarch64-linux-gnu")
|
set(LIB_TRIPLET "aarch64-linux-gnu")
|
||||||
else()
|
else()
|
||||||
set(LIB_TRIPLET "x86_64-linux-gnu")
|
set(LIB_TRIPLET "x86_64-linux-gnu")
|
||||||
|
|
98
scripts/linux/build_cake_release.sh
Executable file
98
scripts/linux/build_cake_release.sh
Executable file
|
@ -0,0 +1,98 @@
|
||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
# build_cake_release.sh - Script to build Cake Wallet for Linux
|
||||||
|
# Usage: ./build_cake_release.sh --amd64 [--arm64] [--app=cakewallet|monero.com]
|
||||||
|
|
||||||
|
set -e
|
||||||
|
|
||||||
|
|
||||||
|
SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
|
||||||
|
cd "$SCRIPT_DIR"
|
||||||
|
|
||||||
|
|
||||||
|
# Default values
|
||||||
|
BUILD_AMD64=false
|
||||||
|
BUILD_ARM64=false
|
||||||
|
APP_TYPE="cakewallet"
|
||||||
|
DOCKER_IMAGE="ghcr.io/cake-tech/cake_wallet:debian12-flutter3.27.4-go1.24.1"
|
||||||
|
|
||||||
|
# Parse arguments
|
||||||
|
for arg in "$@"
|
||||||
|
do
|
||||||
|
case $arg in
|
||||||
|
--amd64)
|
||||||
|
BUILD_AMD64=true
|
||||||
|
shift
|
||||||
|
;;
|
||||||
|
--arm64)
|
||||||
|
BUILD_ARM64=true
|
||||||
|
shift
|
||||||
|
;;
|
||||||
|
--app=*)
|
||||||
|
APP_TYPE="${arg#*=}"
|
||||||
|
shift
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
echo "Unknown argument: $arg"
|
||||||
|
echo "Usage: ./build_cake_release.sh --amd64 [--arm64] [--app=cakewallet|monero.com]"
|
||||||
|
exit 1
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
done
|
||||||
|
|
||||||
|
cd ../..
|
||||||
|
|
||||||
|
# Validate arguments
|
||||||
|
if [[ "$BUILD_AMD64" == "false" && "$BUILD_ARM64" == "false" ]]; then
|
||||||
|
echo "Error: At least one architecture (--amd64 or --arm64) must be specified."
|
||||||
|
echo "Usage: ./build_cake_release.sh --amd64 [--arm64] [--app=cakewallet|monero.com]"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [[ "$APP_TYPE" != "cakewallet" && "$APP_TYPE" != "monero.com" ]]; then
|
||||||
|
echo "Error: App type must be either 'cakewallet' or 'monero.com'"
|
||||||
|
echo "Usage: ./build_cake_release.sh --amd64 [--arm64] [--app=cakewallet|monero.com]"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Function to build for a specific architecture
|
||||||
|
build_for_arch() {
|
||||||
|
local arch=$1
|
||||||
|
local flutter_arch=$2
|
||||||
|
echo "Building $APP_TYPE for Linux ($arch)"
|
||||||
|
|
||||||
|
docker run --privileged -v$(pwd):$(pwd) -w $(pwd) -i --rm --platform linux/$arch $DOCKER_IMAGE bash -x << EOF
|
||||||
|
set -x -e
|
||||||
|
pushd scripts
|
||||||
|
./gen_android_manifest.sh
|
||||||
|
popd
|
||||||
|
pushd scripts/linux
|
||||||
|
source ./app_env.sh $APP_TYPE
|
||||||
|
./app_config.sh
|
||||||
|
./build_monero_all.sh
|
||||||
|
popd
|
||||||
|
flutter clean
|
||||||
|
./model_generator.sh
|
||||||
|
dart run tool/generate_localization.dart
|
||||||
|
flutter build linux
|
||||||
|
rm -rf build/linux/current
|
||||||
|
cp -r build/linux/$flutter_arch build/linux/current
|
||||||
|
rm -rf .flatpak-builder
|
||||||
|
flatpak-builder --force-clean flatpak-build com.cakewallet.CakeWallet.yml
|
||||||
|
flatpak build-export export flatpak-build
|
||||||
|
flatpak build-bundle export build/linux/current/cake_wallet.flatpak com.cakewallet.CakeWallet
|
||||||
|
cp build/linux/current/cake_wallet.flatpak build/linux/$flutter_arch/
|
||||||
|
EOF
|
||||||
|
}
|
||||||
|
|
||||||
|
# Build for specified architectures
|
||||||
|
echo "Building $APP_TYPE for Linux"
|
||||||
|
if [[ "$BUILD_AMD64" == "true" ]]; then
|
||||||
|
build_for_arch "amd64" "x64"
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [[ "$BUILD_ARM64" == "true" ]]; then
|
||||||
|
build_for_arch "arm64" "arm64"
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo "Build process completed."
|
|
@ -10,15 +10,19 @@ cd "$(dirname "$0")"
|
||||||
for COIN in monero wownero;
|
for COIN in monero wownero;
|
||||||
do
|
do
|
||||||
pushd ../monero_c
|
pushd ../monero_c
|
||||||
for target in x86_64-linux-gnu # aarch64-linux-gnu
|
# Determine target architecture based on system architecture
|
||||||
do
|
if [[ $(uname -m) == "arm64" || $(uname -m) == "aarch64" ]]; then
|
||||||
if [[ -f "release/${COIN}/${target}_libwallet2_api_c.so" ]];
|
target="aarch64-linux-gnu"
|
||||||
then
|
else
|
||||||
echo "file exist, not building monero_c for ${COIN}/$target.";
|
target="x86_64-linux-gnu"
|
||||||
else
|
fi
|
||||||
./build_single.sh ${COIN} $target -j$MAKE_JOB_COUNT
|
|
||||||
unxz -f ../monero_c/release/${COIN}/${target}_libwallet2_api_c.so.xz
|
if [[ -f "release/${COIN}/${target}_libwallet2_api_c.so" ]];
|
||||||
fi
|
then
|
||||||
done
|
echo "file exist, not building monero_c for ${COIN}/$target.";
|
||||||
|
else
|
||||||
|
./build_single.sh ${COIN} $target -j$MAKE_JOB_COUNT
|
||||||
|
unxz -f ../monero_c/release/${COIN}/${target}_libwallet2_api_c.so.xz
|
||||||
|
fi
|
||||||
popd
|
popd
|
||||||
done
|
done
|
Loading…
Reference in a new issue