mirror of
https://github.com/Such-Software/hash-wallet.git
synced 2026-10-17 05:41:29 +02:00
The big one. Touches 760+ files. Locks in the user's decision to break import-line compatibility with upstream cake-tech/cake_wallet in exchange for a binary named hash_wallet on every platform. Changes: - pubspec_description.yaml: project name cake_wallet -> hash_wallet - 762 Dart files: every 'package:cake_wallet/...' import rewritten to 'package:hash_wallet/...' (lib/, cw_*/lib/, tool/, test/, integration_test/) - linux/CMakeLists.txt: BINARY_NAME cake_wallet -> hash_wallet - windows/CMakeLists.txt: project + BINARY_NAME (CakeWallet -> HashWallet) - windows/runner/Runner.rc: company / file / product strings to Hash Wallet + Such Software LLC copyright - macos/Runner.xcodeproj/project_base.pbxproj: cake_wallet_new.app refs -> hash_wallet.app (macOS output bundle name) - com.suchsoftware.HashWallet.yml (Flatpak): all binary path refs cake_wallet -> hash_wallet (e.g. /app/hash_wallet/hash_wallet) - linux/com.suchsoftware.HashWallet.desktop: Exec=hash_wallet - scripts/android/copy_monero_deps.sh: CW_DIR target path - configure_hash_wallet.sh: error message typo (old filename) INTENTIONALLY UNCHANGED: - cw_* subpackage names (cw_core, cw_bitcoin, cw_wownero, etc.) — they remain as the historical 'cake wallet' naming; renaming them would cascade through every sub-package's internal structure - Method channel name 'com.cake_wallet/native_utils' in iOS/macOS/Android AppDelegates and MainActivity — it's a string identifier that has to match the Dart side exactly. Renaming requires both-sides change; it's internal-only and not user-visible. - ghcr.io/cake-tech/cake_wallet:debian13-... docker image references in build scripts — that's Cake Labs' published image we use as the build environment, not ours. User data directory now follows the new binary name: ~/.local/share/hash_wallet/ (was ~/.local/share/cake_wallet/) ~/.config/hash_wallet/ (was ~/.config/cake_wallet/) Existing users on the old name will need migration if any exist.
170 lines
5.9 KiB
CMake
170 lines
5.9 KiB
CMake
# Project-level configuration.
|
|
cmake_minimum_required(VERSION 3.10)
|
|
project(runner LANGUAGES CXX)
|
|
|
|
# The name of the executable created for the application. Change this to change
|
|
# the on-disk name of your application.
|
|
set(BINARY_NAME "hash_wallet")
|
|
# The unique GTK application identifier for this application. See:
|
|
# https://wiki.gnome.org/HowDoI/ChooseApplicationID
|
|
set(APPLICATION_ID "com.suchsoftware.hashwallet")
|
|
|
|
# Explicitly opt in to modern CMake behaviors to avoid warnings with recent
|
|
# versions of CMake.
|
|
cmake_policy(SET CMP0063 NEW)
|
|
|
|
# Load bundled libraries from the lib/ directory relative to the binary.
|
|
set(CMAKE_INSTALL_RPATH "$ORIGIN/lib")
|
|
|
|
# Root filesystem for cross-building.
|
|
if(FLUTTER_TARGET_PLATFORM_SYSROOT)
|
|
set(CMAKE_SYSROOT ${FLUTTER_TARGET_PLATFORM_SYSROOT})
|
|
set(CMAKE_FIND_ROOT_PATH ${CMAKE_SYSROOT})
|
|
set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
|
|
set(CMAKE_FIND_ROOT_PATH_MODE_PACKAGE ONLY)
|
|
set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
|
|
set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
|
|
endif()
|
|
|
|
# Define build configuration options.
|
|
if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES)
|
|
set(CMAKE_BUILD_TYPE "Debug" CACHE
|
|
STRING "Flutter build mode" FORCE)
|
|
set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS
|
|
"Debug" "Profile" "Release")
|
|
endif()
|
|
|
|
# Compilation settings that should be applied to most targets.
|
|
#
|
|
# Be cautious about adding new options here, as plugins use this function by
|
|
# default. In most cases, you should add new options to specific targets instead
|
|
# of modifying this function.
|
|
function(APPLY_STANDARD_SETTINGS TARGET)
|
|
target_compile_features(${TARGET} PUBLIC cxx_std_14)
|
|
target_compile_options(${TARGET} PRIVATE -Wall -Werror)
|
|
target_compile_options(${TARGET} PRIVATE "$<$<NOT:$<CONFIG:Debug>>:-O3>")
|
|
target_compile_definitions(${TARGET} PRIVATE "$<$<NOT:$<CONFIG:Debug>>:NDEBUG>")
|
|
endfunction()
|
|
|
|
# Flutter library and tool build rules.
|
|
set(FLUTTER_MANAGED_DIR "${CMAKE_CURRENT_SOURCE_DIR}/flutter")
|
|
add_subdirectory(${FLUTTER_MANAGED_DIR})
|
|
|
|
# System-level dependencies.
|
|
find_package(PkgConfig REQUIRED)
|
|
pkg_check_modules(GTK REQUIRED IMPORTED_TARGET gtk+-3.0)
|
|
|
|
add_definitions(-DAPPLICATION_ID="${APPLICATION_ID}")
|
|
|
|
# Define the application target. To change its name, change BINARY_NAME above,
|
|
# not the value here, or `flutter run` will no longer work.
|
|
#
|
|
# Any new source files that you add to the application should be added here.
|
|
add_executable(${BINARY_NAME}
|
|
"main.cc"
|
|
"my_application.cc"
|
|
"${FLUTTER_MANAGED_DIR}/generated_plugin_registrant.cc"
|
|
)
|
|
|
|
# Apply the standard set of build settings. This can be removed for applications
|
|
# that need different build settings.
|
|
apply_standard_settings(${BINARY_NAME})
|
|
|
|
# Add dependency libraries. Add any application-specific dependencies here.
|
|
target_link_libraries(${BINARY_NAME} PRIVATE flutter)
|
|
target_link_libraries(${BINARY_NAME} PRIVATE PkgConfig::GTK)
|
|
|
|
# Run the Flutter tool portions of the build. This must not be removed.
|
|
add_dependencies(${BINARY_NAME} flutter_assemble)
|
|
|
|
# Only the install-generated bundle's copy of the executable will launch
|
|
# correctly, since the resources must in the right relative locations. To avoid
|
|
# people trying to run the unbundled copy, put it in a subdirectory instead of
|
|
# the default top-level location.
|
|
set_target_properties(${BINARY_NAME}
|
|
PROPERTIES
|
|
RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/intermediates_do_not_run"
|
|
)
|
|
|
|
# Generated plugin build rules, which manage building the plugins and adding
|
|
# them to the application.
|
|
include(flutter/generated_plugins.cmake)
|
|
|
|
|
|
# === Installation ===
|
|
# By default, "installing" just makes a relocatable bundle in the build
|
|
# directory.
|
|
set(BUILD_BUNDLE_DIR "${PROJECT_BINARY_DIR}/bundle")
|
|
if(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
|
|
set(CMAKE_INSTALL_PREFIX "${BUILD_BUNDLE_DIR}" CACHE PATH "..." FORCE)
|
|
endif()
|
|
|
|
# Start with a clean build bundle directory every time.
|
|
install(CODE "
|
|
file(REMOVE_RECURSE \"${BUILD_BUNDLE_DIR}/\")
|
|
" COMPONENT Runtime)
|
|
|
|
set(INSTALL_BUNDLE_DATA_DIR "${CMAKE_INSTALL_PREFIX}/data")
|
|
set(INSTALL_BUNDLE_LIB_DIR "${CMAKE_INSTALL_PREFIX}/lib")
|
|
|
|
if(CMAKE_SYSTEM_PROCESSOR STREQUAL "aarch64" OR CMAKE_SYSTEM_PROCESSOR STREQUAL "arm64")
|
|
set(LIB_TRIPLET "aarch64-linux-gnu")
|
|
else()
|
|
set(LIB_TRIPLET "x86_64-linux-gnu")
|
|
endif()
|
|
|
|
execute_process(
|
|
COMMAND git describe --tags
|
|
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/../scripts/monero_c
|
|
OUTPUT_VARIABLE MONERO_C_TAG
|
|
OUTPUT_STRIP_TRAILING_WHITESPACE
|
|
)
|
|
|
|
set(MONERO_C_RELEASE_DIR
|
|
"${CMAKE_CURRENT_SOURCE_DIR}/../scripts/monero_c/release/${MONERO_C_TAG}/${LIB_TRIPLET}"
|
|
)
|
|
|
|
install(
|
|
FILES "${MONERO_C_RELEASE_DIR}/libmonero_wallet2_api_c.so"
|
|
DESTINATION "${INSTALL_BUNDLE_LIB_DIR}"
|
|
RENAME "libmonero_wallet2_api_c.so"
|
|
COMPONENT Runtime
|
|
)
|
|
|
|
install(
|
|
FILES "${MONERO_C_RELEASE_DIR}/libwownero_wallet2_api_c.so"
|
|
DESTINATION "${INSTALL_BUNDLE_LIB_DIR}"
|
|
RENAME "libwownero_wallet2_api_c.so"
|
|
COMPONENT Runtime
|
|
)
|
|
|
|
install(TARGETS ${BINARY_NAME} RUNTIME DESTINATION "${CMAKE_INSTALL_PREFIX}"
|
|
COMPONENT Runtime)
|
|
|
|
install(FILES "${FLUTTER_ICU_DATA_FILE}" DESTINATION "${INSTALL_BUNDLE_DATA_DIR}"
|
|
COMPONENT Runtime)
|
|
|
|
install(FILES "${FLUTTER_LIBRARY}" DESTINATION "${INSTALL_BUNDLE_LIB_DIR}"
|
|
COMPONENT Runtime)
|
|
|
|
foreach(bundled_library ${PLUGIN_BUNDLED_LIBRARIES})
|
|
install(FILES "${bundled_library}"
|
|
DESTINATION "${INSTALL_BUNDLE_LIB_DIR}"
|
|
COMPONENT Runtime)
|
|
endforeach(bundled_library)
|
|
|
|
# Fully re-copy the assets directory on each build to avoid having stale files
|
|
# from a previous install.
|
|
set(FLUTTER_ASSET_DIR_NAME "flutter_assets")
|
|
install(CODE "
|
|
file(REMOVE_RECURSE \"${INSTALL_BUNDLE_DATA_DIR}/${FLUTTER_ASSET_DIR_NAME}\")
|
|
" COMPONENT Runtime)
|
|
install(DIRECTORY "${PROJECT_BUILD_DIR}/${FLUTTER_ASSET_DIR_NAME}"
|
|
DESTINATION "${INSTALL_BUNDLE_DATA_DIR}" COMPONENT Runtime)
|
|
|
|
# Install the AOT library on non-Debug builds only.
|
|
if(NOT CMAKE_BUILD_TYPE MATCHES "Debug")
|
|
install(FILES "${AOT_LIBRARY}" DESTINATION "${INSTALL_BUNDLE_LIB_DIR}"
|
|
COMPONENT Runtime)
|
|
endif()
|