diff --git a/.github/workflows/main_deploy.yaml b/.github/workflows/main_deploy.yaml index 9932a63fc..20b090c3c 100644 --- a/.github/workflows/main_deploy.yaml +++ b/.github/workflows/main_deploy.yaml @@ -22,9 +22,10 @@ jobs: flutter-version: ${{ env.FLUTTER_VERSION }} - uses: moonrepo/setup-rust@v1 - run: rustup component add rust-src --toolchain nightly-x86_64-unknown-linux-gnu - - run: flutter pub get - name: Prepare web run: ./scripts/prepare-web.sh + - run: rm ./assets/vodozemac/.gitignore + - run: flutter pub get - name: Build Release Web run: ./scripts/build-web.sh diff --git a/.github/workflows/versions.env b/.github/workflows/versions.env index 1d646f732..b99b89cdf 100644 --- a/.github/workflows/versions.env +++ b/.github/workflows/versions.env @@ -1,2 +1,2 @@ -FLUTTER_VERSION=3.32.1 +FLUTTER_VERSION=3.32.2 JAVA_VERSION=17 diff --git a/assets/js/package/.gitkeep b/assets/js/package/.gitkeep deleted file mode 100644 index e69de29bb..000000000 diff --git a/assets/vodozemac/.gitignore b/assets/vodozemac/.gitignore new file mode 100644 index 000000000..d9bc44261 --- /dev/null +++ b/assets/vodozemac/.gitignore @@ -0,0 +1 @@ +vodozemac_bindings_dart* \ No newline at end of file diff --git a/lib/main.dart b/lib/main.dart index 002631513..a3facf5aa 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -51,8 +51,9 @@ void main() async { WidgetsFlutterBinding.ensureInitialized(); // #Pangea - // await vod.init(); + // await vod.init(wasmPath: './assets/assets/vodozemac/'); // Pangea# + Logs().nativeColors = !PlatformInfos.isIOS; final store = await SharedPreferences.getInstance(); final clients = await ClientManager.getClients(store: store); diff --git a/lib/pages/chat_list/chat_list.dart b/lib/pages/chat_list/chat_list.dart index 091c6e8b0..519ff9218 100644 --- a/lib/pages/chat_list/chat_list.dart +++ b/lib/pages/chat_list/chat_list.dart @@ -46,7 +46,6 @@ import '../../widgets/matrix.dart'; import 'package:fluffychat/utils/tor_stub.dart' if (dart.library.html) 'package:tor_detector_web/tor_detector_web.dart'; - enum PopupMenuAction { settings, invite, diff --git a/lib/utils/client_manager.dart b/lib/utils/client_manager.dart index ff1684748..4787e4459 100644 --- a/lib/utils/client_manager.dart +++ b/lib/utils/client_manager.dart @@ -104,7 +104,7 @@ abstract class ClientManager { ? const NativeImplementationsDummy() : NativeImplementationsIsolate( compute, - vodozemacInit: vod.init, + vodozemacInit: () => vod.init(wasmPath: './assets/assets/vodozemac/'), ); static Future createClient( diff --git a/pubspec.lock b/pubspec.lock index 940131be5..3d8c649b8 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -975,10 +975,10 @@ packages: dependency: "direct main" description: name: flutter_vodozemac - sha256: e9a6257ccdefacd2bf0128fcf41086d809f05fb34e9a4ebe0f50e7e3ff4c0970 + sha256: "2405ca121b84d1cd83200a14021022e1691b123a23bcefc36adc7740cefbc1f9" url: "https://pub.dev" source: hosted - version: "0.2.0" + version: "0.2.2" flutter_web_auth_2: dependency: "direct main" description: diff --git a/pubspec.yaml b/pubspec.yaml index 99ce7a511..6037e87bd 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -52,7 +52,7 @@ dependencies: git: url: https://github.com/famedly/flutter_typeahead.git ref: main - flutter_vodozemac: ^0.2.0 + flutter_vodozemac: ^0.2.2 flutter_web_auth_2: ^3.1.1 # Version 4 blocked by https://github.com/MixinNetwork/flutter-plugins/issues/379 flutter_webrtc: ^0.12.9 geolocator: ^13.0.1 @@ -174,8 +174,7 @@ flutter: - assets/pangea/bot_faces/ # Pangea# - assets/sounds/ - - assets/js/ - - assets/js/package/ + - assets/vodozemac/ # #Pangea fonts: diff --git a/scripts/build-macos.sh b/scripts/build-macos.sh index 11d3e4a09..f25711e13 100644 --- a/scripts/build-macos.sh +++ b/scripts/build-macos.sh @@ -30,6 +30,4 @@ FLUFFYCHAT_ORIG_TEAM="4NXF6Z997G" ### Make release build ### flutter build macos --release -cp /usr/local/Cellar/libolm/**/lib/libolm.3.dylib build/macos/Build/Products/Release/FluffyChat.app/Contents/Frameworks/libolm.3.dylib - echo "Build build/macos/Build/Products/Release/FluffyChat.app" diff --git a/scripts/build-olm-windows.sh b/scripts/build-olm-windows.sh deleted file mode 100644 index 003b98eeb..000000000 --- a/scripts/build-olm-windows.sh +++ /dev/null @@ -1,7 +0,0 @@ -#!/usr/bin/env bash - -git clone https://gitlab.matrix.org/matrix-org/olm.git -b 3.2.12 -cd olm -cmake . -Bbuild -DCMAKE_TOOLCHAIN_FILE=Windows64.cmake -cmake --build build -cd .. diff --git a/scripts/prepare-macos.sh b/scripts/prepare-macos.sh deleted file mode 100644 index 95f2a9cff..000000000 --- a/scripts/prepare-macos.sh +++ /dev/null @@ -1,8 +0,0 @@ -#!/usr/bin/env bash - -if ! type "flutter" > /dev/null; then - brew install flutter -fi - -brew install libolm - diff --git a/scripts/prepare-web.sh b/scripts/prepare-web.sh index 2b1c35552..875ae0a46 100755 --- a/scripts/prepare-web.sh +++ b/scripts/prepare-web.sh @@ -5,5 +5,6 @@ cd .vodozemac cargo install flutter_rust_bridge_codegen flutter_rust_bridge_codegen build-web --dart-root dart --rust-root $(readlink -f rust) --release cd .. -mv .vodozemac/dart/web/pkg ./web/ +rm -f ./assets/vodozemac/vodozemac_bindings_dart* +mv .vodozemac/dart/web/pkg/vodozemac_bindings_dart* ./assets/vodozemac/ rm -rf .vodozemac diff --git a/snap/snapcraft.yaml b/snap/snapcraft.yaml index 0e5a32f37..1bd301866 100644 --- a/snap/snapcraft.yaml +++ b/snap/snapcraft.yaml @@ -1,7 +1,7 @@ name: fluffychat title: FluffyChat base: core24 -version: git +version: 1.27.0 license: AGPL-3.0 summary: The cutest messenger in the Matrix network description: | @@ -51,29 +51,48 @@ platforms: build-on: arm64 parts: - olm: - plugin: cmake - cmake-parameters: - - -DCMAKE_INSTALL_PREFIX=/usr - source: https://gitlab.matrix.org/matrix-org/olm.git - source-type: git - source-tag: '3.2.14' + flutter-git: + source: https://github.com/flutter/flutter.git + source-tag: 3.32.2 + source-depth: 1 + plugin: nil + override-build: | + mkdir -p $CRAFT_PART_INSTALL/usr/bin + mkdir -p $CRAFT_PART_INSTALL/usr/libexec + cp -r $CRAFT_PART_SRC $CRAFT_PART_INSTALL/usr/libexec/flutter + ln -s $CRAFT_PART_INSTALL/usr/libexec/flutter/bin/flutter $CRAFT_PART_INSTALL/usr/bin/flutter + ln -s $SNAPCRAFT_PART_INSTALL/usr/libexec/flutter/bin/dart $SNAPCRAFT_PART_INSTALL/usr/bin/dart + $CRAFT_PART_INSTALL/usr/bin/flutter doctor build-packages: - - g++ + - clang + - cmake + - curl + - libgtk-3-dev + - ninja-build + - unzip + - xz-utils + - zip + override-prime: '' fluffychat: - plugin: flutter + after: [flutter-git] + plugin: nil source: . override-build: | # Workaround for Flutter build error: rm -rf build - craftctl default + + flutter build linux --release -v + mkdir -p $CRAFT_PART_INSTALL/bin/ + cp -r build/linux/*/release/bundle/* $CRAFT_PART_INSTALL/bin/ build-packages: - libsecret-1-dev - libjsoncpp-dev - libssl-dev - curl - libpciaccess-dev + build-snaps: + - rustup stage-packages: - libsecret-1-0 - libjsoncpp25 @@ -87,7 +106,7 @@ slots: apps: fluffychat: - command: fluffychat + command: bin/fluffychat extensions: [ gnome ] plugs: - audio-playback