From 7ee36e2b7d7c1e28e618125347c5e3d5d4f8bfa0 Mon Sep 17 00:00:00 2001 From: The one with the braid Date: Tue, 6 Feb 2024 09:26:02 +0100 Subject: [PATCH] testing/fwallet: new aport - include APKBUILD for business.braid.f_wallet Signed-off-by: The one with the braid --- testing/fwallet/APKBUILD | 97 ++++++++++++++++++++++++++++ testing/fwallet/no-werror.patch | 11 ++++ testing/fwallet/system-flutter.patch | 15 +++++ 3 files changed, 123 insertions(+) create mode 100644 testing/fwallet/APKBUILD create mode 100644 testing/fwallet/no-werror.patch create mode 100644 testing/fwallet/system-flutter.patch diff --git a/testing/fwallet/APKBUILD b/testing/fwallet/APKBUILD new file mode 100644 index 00000000000..392a136c366 --- /dev/null +++ b/testing/fwallet/APKBUILD @@ -0,0 +1,97 @@ +# Contributor: The one with the braid +# Maintainer: The one with the braid +pkgname=fwallet +pkgver=1.1.4 +pkgrel=0 +pkgdesc="A beautiful cross-platform wallet application" +url="https://gitlab.com/TheOneWithTheBraid/f_wallet" +arch="aarch64 x86_64" # flutter +license="EUPL-1.2" +# xdg-user-dirs: pub/path_provider +depends=" + xdg-user-dirs + " +makedepends=" + flutter-desktop + libsecret-dev + patchelf + " +source=" + https://gitlab.com/TheOneWithTheBraid/f_wallet/-/archive/${_rev:-"v$pkgver"}/f_wallet-${_rev:-v"$pkgver"}.tar.gz + + system-flutter.patch + no-werror.patch + " +builddir="$srcdir/f_wallet-${_rev:-"v$pkgver"}" +# net: pub dependencies +# !check: no tests +options="net !check" + +export _pkgorg="business.braid.f_wallet" +export _pkgexec="f_wallet" + +case "$CARCH" in + aarch64) _flutter_arch="arm64" ;; + x86_64) _flutter_arch="x64" ;; +esac + +export PUB_CACHE="$srcdir/pub_cache" + +export CFLAGS="${CFLAGS/-g/} -O2 -Wno-error -Wno-unknown-warning-option -Wno-unused-command-line-argument" +export CXXFLAGS="${CXXFLAGS/-g/} -O2 -Wno-error -Wno-unknown-warning-option -Wno-unused-command-line-argument" + +export CC=clang +export CXX=clang++ +export AR=llvm-ar +export NM=llvm-nm +export LD=clang++ + +prepare() { + default_prepare + + flutter pub get --enforce-lockfile + flutter gen-l10n + + # if there is a binary in the pub_cache, we sure did not build it. + for elf in $(scanelf -RA -F "%F" "$PUB_CACHE"); do + rm -f "$elf" + done +} + +build() { + flutter build linux -v --release \ + --dart-define=FWALLET_IS_STABLE=true \ + --dart-define=FWALLET_VERSION=$pkgver + + patchelf --set-rpath '$ORIGIN/lib' build/linux/"$_flutter_arch"/release/bundle/$_pkgexec + for _elf in build/linux/"$_flutter_arch"/release/bundle/lib/lib*.so; do + # running patchelf on libapp (the AOT snapshot of the whole Dart codebase) + # breaks it with "[FATAL:flutter/runtime/dart_vm_initializer.cc(89)] + # Error while initializing the Dart VM: Invalid vm isolate snapshot seen". + # + # it has no rpath and only links to libc soname anyway. 🤷‍♀️ + [ "$(basename "$_elf")" != "libapp.so" ] || continue + + patchelf --set-rpath '$ORIGIN' "$_elf" + done +} + +package() { + local bundle="$builddir"/build/linux/$_flutter_arch/release/bundle + + install -Dm755 "$bundle"/$_pkgexec "$pkgdir"/usr/lib/$pkgname/$_pkgexec + cp -rv "$bundle"/lib "$pkgdir"/usr/lib/$pkgname/lib + cp -rv "$bundle"/data "$pkgdir"/usr/lib/$pkgname/data + + mkdir -p "$pkgdir"/usr/bin + ln -sv /usr/lib/$pkgname/$_pkgexec "$pkgdir"/usr/bin/$_pkgexec + + install -Dm644 linux/$_pkgorg.desktop "$pkgdir"/usr/share/applications/$_pkgorg.desktop + install -Dm644 assets/logo/logo-circle.svg "$pkgdir"/usr/share/icons/hicolor/scalable/apps/$_pkgorg.svg +} + +sha512sums=" +5ea49d2a766ff9f6ff7c7f6921cb91c5f71d67adfaeba41931ff175cd5332c5aed82a7feb5bd42c3376d1ab6b4e6bd58123bddb21ada352f0891021d03b665a2 f_wallet-v1.1.4.tar.gz +1d2b7d28a09e26ed48d89aa5f5dffb738ba367fa2760b12980225239705e16fa1ec89901d7aecf26c8527de721a5f50f50cc77ea009cd5f25f219d1af8730ed8 no-werror.patch +91014708ab7bb81518ce93db0612209d6479dfa503064d9e9d3186cd5e861165a3f63e286d271d5aac8a1d676868fc3acf51648ac01c16a215062a317ccb6623 system-flutter.patch +" diff --git a/testing/fwallet/no-werror.patch b/testing/fwallet/no-werror.patch new file mode 100644 index 00000000000..ec8df348612 --- /dev/null +++ b/testing/fwallet/no-werror.patch @@ -0,0 +1,11 @@ +--- ./linux/CMakeLists.txt.orig ++++ ./linux/CMakeLists.txt +@@ -41,7 +41,7 @@ + # 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 -Wall) + target_compile_options(${TARGET} PRIVATE "$<$>:-O3>") + target_compile_definitions(${TARGET} PRIVATE "$<$>:NDEBUG>") + endfunction() diff --git a/testing/fwallet/system-flutter.patch b/testing/fwallet/system-flutter.patch new file mode 100644 index 00000000000..e8f7270ec9a --- /dev/null +++ b/testing/fwallet/system-flutter.patch @@ -0,0 +1,15 @@ +--- a/linux/CMakeLists.txt ++++ b/linux/CMakeLists.txt +@@ -110,12 +110,6 @@ + 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}"