Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 2 additions & 15 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -73,10 +73,9 @@ jobs:
CHANGE_NOW: ${{ secrets.CHANGE_NOW }}
run: echo "$CHANGE_NOW" | base64 --decode > lib/external_api_keys.dart

- name: Generate app config
run: dart run build_runner build --delete-conflicting-outputs

- name: Build
env:
USE_SYSTEM_SECURE_STORAGE_DEPS: "1"
run: flutter build linux --release

- name: Package
Expand Down Expand Up @@ -145,9 +144,6 @@ jobs:
CHANGE_NOW: ${{ secrets.CHANGE_NOW }}
run: echo "$CHANGE_NOW" | base64 --decode > lib/external_api_keys.dart

- name: Generate app config
run: dart run build_runner build --delete-conflicting-outputs

- name: Set up Android local.properties
run: |
cat > android/local.properties <<EOF
Expand Down Expand Up @@ -248,9 +244,6 @@ jobs:
CHANGE_NOW: ${{ secrets.CHANGE_NOW }}
run: echo "$CHANGE_NOW" | base64 --decode > lib/external_api_keys.dart

- name: Generate app config
run: dart run build_runner build --delete-conflicting-outputs

- name: Build
run: flutter build windows --release

Expand Down Expand Up @@ -321,9 +314,6 @@ jobs:
CHANGE_NOW: ${{ secrets.CHANGE_NOW }}
run: echo "$CHANGE_NOW" | base64 --decode > lib/external_api_keys.dart

- name: Generate app config
run: dart run build_runner build --delete-conflicting-outputs

- name: Build
run: flutter build macos --release

Expand Down Expand Up @@ -399,9 +389,6 @@ jobs:
CHANGE_NOW: ${{ secrets.CHANGE_NOW }}
run: echo "$CHANGE_NOW" | base64 --decode > lib/external_api_keys.dart

- name: Generate app config
run: dart run build_runner build --delete-conflicting-outputs

- name: Build
run: flutter build ios --release --no-codesign

Expand Down
50 changes: 50 additions & 0 deletions .github/workflows/release-mwebd-windows.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
name: Release mwebd Windows binary

on:
workflow_dispatch:
inputs:
mwebd_version:
description: 'mwebd tag to build (must match _mwebdVersion in tool/build_standalone_mwebd_windows.dart)'
required: true
default: 'v0.1.8'

permissions:
contents: write

jobs:
build-and-release:
runs-on: windows-latest
defaults:
run:
shell: bash
steps:
- uses: actions/setup-go@v5
with:
go-version: '1.22'

- name: Clone mwebd
run: git clone https://github.com/ltcmweb/mwebd.git --branch "${{ inputs.mwebd_version }}" mwebd

- name: Build mwebd.exe
working-directory: mwebd
env:
CGO_ENABLED: '1'
run: go build -v -o ../mwebd.exe github.com/ltcmweb/mwebd/cmd/mwebd

- name: Compute sha256
run: sha256sum mwebd.exe | awk '{print $1}' > mwebd.exe.sha256

- name: Publish release
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GH_REPO: ${{ github.repository }}
run: |
TAG="mwebd-${{ inputs.mwebd_version }}"
if gh release view "$TAG" >/dev/null 2>&1; then
gh release upload "$TAG" mwebd.exe mwebd.exe.sha256 --clobber
else
gh release create "$TAG" \
--title "mwebd ${{ inputs.mwebd_version }} (windows-amd64)" \
--notes "Pre-built Windows binary for ltcmweb/mwebd ${{ inputs.mwebd_version }}, built with native Go on windows-latest. Used by the Stack Wallet Windows build via tool/build_standalone_mwebd_windows.dart --fetch." \
mwebd.exe mwebd.exe.sha256
fi
6 changes: 5 additions & 1 deletion scripts/app_config/configure_stack_wallet.sh
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,11 @@ dart "${APP_PROJECT_ROOT_DIR}/tool/gen_interfaces.dart" \

MWEBD_EXE_SHA256=""
if [[ "$1" == "windows" ]]; then
dart "${APP_PROJECT_ROOT_DIR}/tool/build_standalone_mwebd_windows.dart"
if [[ "${MWEBD_FETCH:-0}" == "1" ]]; then
dart "${APP_PROJECT_ROOT_DIR}/tool/build_standalone_mwebd_windows.dart" --fetch
else
dart "${APP_PROJECT_ROOT_DIR}/tool/build_standalone_mwebd_windows.dart"
fi
MWEBD_EXE_SHA256="$(sha256sum "${APP_PROJECT_ROOT_DIR}/assets/windows/mwebd.exe" | awk '{print $1}')"
dart "${APP_PROJECT_ROOT_DIR}/tool/process_pubspec_deps.dart" \
"${PUBSPEC_FILE}" MWEBDEXE
Expand Down
6 changes: 3 additions & 3 deletions scripts/app_config/templates/android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,9 @@ android {
coreLibraryDesugaring("com.android.tools:desugar_jdk_libs:2.0.4")
}

ndk {
abiFilters "x86_64","armeabi-v7a", "arm64-v8a"
}
// No ndk.abiFilters here: AGP rejects it alongside the abi splits set
// up by `flutter build apk --split-per-abi`. Flutter defaults to
// android-arm,android-arm64,android-x64 which is the same set we want.

// externalNativeBuild {
// cmake {
Expand Down
82 changes: 54 additions & 28 deletions scripts/app_config/templates/linux/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -53,24 +53,37 @@ endfunction()
set(FLUTTER_MANAGED_DIR "${CMAKE_CURRENT_SOURCE_DIR}/flutter")
add_subdirectory(${FLUTTER_MANAGED_DIR})

# build libjsoncpp and libsecret for flutter_secure_storage
set(ENV{PKG_CONFIG_PATH} "$ENV{PKG_CONFIG_PATH}:${CMAKE_CURRENT_SOURCE_DIR}/../scripts/linux/build/jsoncpp/build/pkg-config")
set(ENV{PKG_CONFIG_PATH} "$ENV{PKG_CONFIG_PATH}:${CMAKE_CURRENT_SOURCE_DIR}/../scripts/linux/pc")

include_directories(${CMAKE_CURRENT_SOURCE_DIR}/../scripts/linux/build/jsoncpp/include)

include_directories(${CMAKE_CURRENT_SOURCE_DIR}/../scripts/linux/build/libsecret)
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/../scripts/linux/build/libsecret/_build)

add_library(jsoncpp SHARED IMPORTED)
set_target_properties(jsoncpp PROPERTIES IMPORTED_LOCATION "${CMAKE_CURRENT_SOURCE_DIR}/../scripts/linux/build/jsoncpp/build/src/lib_json/libjsoncpp.so")
add_library(secret-1 SHARED IMPORTED)
set_target_properties(secret-1 PROPERTIES IMPORTED_LOCATION "${CMAKE_CURRENT_SOURCE_DIR}/../scripts/linux/build/libsecret/_build/libsecret/libsecret-1.so")

# System-level dependencies.
find_package(PkgConfig REQUIRED)
pkg_check_modules(GTK REQUIRED IMPORTED_TARGET gtk+-3.0)

# jsoncpp and libsecret for flutter_secure_storage. When
# USE_SYSTEM_SECURE_STORAGE_DEPS is set, link and bundle the system-installed
# copies; otherwise use the artifacts built by scripts/linux/build_secure_storage_deps.sh.
option(USE_SYSTEM_SECURE_STORAGE_DEPS "Link against system-installed jsoncpp and libsecret" OFF)
if(DEFINED ENV{USE_SYSTEM_SECURE_STORAGE_DEPS} AND "$ENV{USE_SYSTEM_SECURE_STORAGE_DEPS}" STREQUAL "1")
set(USE_SYSTEM_SECURE_STORAGE_DEPS ON)
endif()

if(USE_SYSTEM_SECURE_STORAGE_DEPS)
pkg_check_modules(JSONCPP REQUIRED IMPORTED_TARGET jsoncpp)
pkg_check_modules(LIBSECRET REQUIRED IMPORTED_TARGET libsecret-1)
pkg_get_variable(JSONCPP_LIBDIR jsoncpp libdir)
pkg_get_variable(LIBSECRET_LIBDIR libsecret-1 libdir)
else()
set(ENV{PKG_CONFIG_PATH} "$ENV{PKG_CONFIG_PATH}:${CMAKE_CURRENT_SOURCE_DIR}/../scripts/linux/build/jsoncpp/build/pkg-config")
set(ENV{PKG_CONFIG_PATH} "$ENV{PKG_CONFIG_PATH}:${CMAKE_CURRENT_SOURCE_DIR}/../scripts/linux/pc")

include_directories(${CMAKE_CURRENT_SOURCE_DIR}/../scripts/linux/build/jsoncpp/include)
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/../scripts/linux/build/libsecret)
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/../scripts/linux/build/libsecret/_build)

add_library(jsoncpp SHARED IMPORTED)
set_target_properties(jsoncpp PROPERTIES IMPORTED_LOCATION "${CMAKE_CURRENT_SOURCE_DIR}/../scripts/linux/build/jsoncpp/build/src/lib_json/libjsoncpp.so")
add_library(secret-1 SHARED IMPORTED)
set_target_properties(secret-1 PROPERTIES IMPORTED_LOCATION "${CMAKE_CURRENT_SOURCE_DIR}/../scripts/linux/build/libsecret/_build/libsecret/libsecret-1.so")
endif()

add_definitions(-DAPPLICATION_ID="${APPLICATION_ID}")

# Define the application target. To change its name, change BINARY_NAME above,
Expand All @@ -91,8 +104,12 @@ apply_standard_settings(${BINARY_NAME})
target_link_libraries(${BINARY_NAME} PRIVATE -static-libgcc -static-libstdc++)
target_link_libraries(${BINARY_NAME} PRIVATE flutter)
target_link_libraries(${BINARY_NAME} PRIVATE PkgConfig::GTK)
target_link_libraries(${BINARY_NAME} PRIVATE jsoncpp)
target_link_libraries(${BINARY_NAME} PRIVATE secret-1)
if(USE_SYSTEM_SECURE_STORAGE_DEPS)
target_link_libraries(${BINARY_NAME} PRIVATE PkgConfig::JSONCPP PkgConfig::LIBSECRET)
else()
target_link_libraries(${BINARY_NAME} PRIVATE jsoncpp)
target_link_libraries(${BINARY_NAME} PRIVATE secret-1)
endif()


# Run the Flutter tool portions of the build. This must not be removed.
Expand Down Expand Up @@ -147,19 +164,28 @@ if(INCLUDE_MWC_SO)
COMPONENT Runtime)
endif()

install(FILES "${CMAKE_CURRENT_SOURCE_DIR}/../scripts/linux/build/jsoncpp/build/src/lib_json/libjsoncpp.so.1.7.4" DESTINATION "${INSTALL_BUNDLE_LIB_DIR}"
COMPONENT Runtime)
install(FILES "${CMAKE_CURRENT_SOURCE_DIR}/../scripts/linux/build/jsoncpp/build/src/lib_json/libjsoncpp.so.1" DESTINATION "${INSTALL_BUNDLE_LIB_DIR}"
COMPONENT Runtime)
install(FILES "${CMAKE_CURRENT_SOURCE_DIR}/../scripts/linux/build/jsoncpp/build/src/lib_json/libjsoncpp.so" DESTINATION "${INSTALL_BUNDLE_LIB_DIR}"
COMPONENT Runtime)
if(USE_SYSTEM_SECURE_STORAGE_DEPS)
file(GLOB JSONCPP_SO_FILES "${JSONCPP_LIBDIR}/libjsoncpp.so*")
install(FILES ${JSONCPP_SO_FILES} DESTINATION "${INSTALL_BUNDLE_LIB_DIR}"
COMPONENT Runtime)
file(GLOB LIBSECRET_SO_FILES "${LIBSECRET_LIBDIR}/libsecret-1.so*")
install(FILES ${LIBSECRET_SO_FILES} DESTINATION "${INSTALL_BUNDLE_LIB_DIR}"
COMPONENT Runtime)
else()
install(FILES "${CMAKE_CURRENT_SOURCE_DIR}/../scripts/linux/build/jsoncpp/build/src/lib_json/libjsoncpp.so.1.7.4" DESTINATION "${INSTALL_BUNDLE_LIB_DIR}"
COMPONENT Runtime)
install(FILES "${CMAKE_CURRENT_SOURCE_DIR}/../scripts/linux/build/jsoncpp/build/src/lib_json/libjsoncpp.so.1" DESTINATION "${INSTALL_BUNDLE_LIB_DIR}"
COMPONENT Runtime)
install(FILES "${CMAKE_CURRENT_SOURCE_DIR}/../scripts/linux/build/jsoncpp/build/src/lib_json/libjsoncpp.so" DESTINATION "${INSTALL_BUNDLE_LIB_DIR}"
COMPONENT Runtime)

install(FILES "${CMAKE_CURRENT_SOURCE_DIR}/../scripts/linux/build/libsecret/_build/libsecret/libsecret-1.so.0.0.0" DESTINATION "${INSTALL_BUNDLE_LIB_DIR}"
COMPONENT Runtime)
install(FILES "${CMAKE_CURRENT_SOURCE_DIR}/../scripts/linux/build/libsecret/_build/libsecret/libsecret-1.so.0" DESTINATION "${INSTALL_BUNDLE_LIB_DIR}"
COMPONENT Runtime)
install(FILES "${CMAKE_CURRENT_SOURCE_DIR}/../scripts/linux/build/libsecret/_build/libsecret/libsecret-1.so" DESTINATION "${INSTALL_BUNDLE_LIB_DIR}"
COMPONENT Runtime)
install(FILES "${CMAKE_CURRENT_SOURCE_DIR}/../scripts/linux/build/libsecret/_build/libsecret/libsecret-1.so.0.0.0" DESTINATION "${INSTALL_BUNDLE_LIB_DIR}"
COMPONENT Runtime)
install(FILES "${CMAKE_CURRENT_SOURCE_DIR}/../scripts/linux/build/libsecret/_build/libsecret/libsecret-1.so.0" DESTINATION "${INSTALL_BUNDLE_LIB_DIR}"
COMPONENT Runtime)
install(FILES "${CMAKE_CURRENT_SOURCE_DIR}/../scripts/linux/build/libsecret/_build/libsecret/libsecret-1.so" DESTINATION "${INSTALL_BUNDLE_LIB_DIR}"
COMPONENT Runtime)
endif()

foreach(bundled_library ${PLUGIN_BUNDLED_LIBRARIES})
install(FILES "${bundled_library}"
Expand Down
Loading
Loading