From cd12f773fe9786556589a9078a3303c516f81634 Mon Sep 17 00:00:00 2001 From: krille-chan Date: Wed, 19 Feb 2025 13:09:14 +0100 Subject: [PATCH] build: Install flutter via git in snapcraft --- snap/snapcraft.yaml | 33 ++++++++++++++++++++++++++++----- 1 file changed, 28 insertions(+), 5 deletions(-) diff --git a/snap/snapcraft.yaml b/snap/snapcraft.yaml index 87efdcd88..baf96d923 100644 --- a/snap/snapcraft.yaml +++ b/snap/snapcraft.yaml @@ -61,18 +61,41 @@ parts: build-packages: - g++ + flutter-git: + source: https://github.com/flutter/flutter.git + source-tag: 3.27.4 + plugin: nil + override-build: | + set -eux + 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 -sf $CRAFT_PART_INSTALL/usr/libexec/flutter/bin/flutter $CRAFT_PART_INSTALL/usr/bin/flutter + export PATH="$CRAFT_PART_INSTALL/usr/bin:$PATH" + flutter doctor + build-packages: + - clang + - cmake + - curl + - ninja-build + - unzip + override-prime: '' + fluffychat: - plugin: flutter + after: [ flutter-git ] + plugin: nil source: . override-build: | - # Workaround for Flutter build error: - rm -rf build - craftctl default + flutter pub get || true + 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 + - jq stage-packages: - libsecret-1-0 - libjsoncpp25 @@ -85,7 +108,7 @@ slots: apps: fluffychat: - command: fluffychat + command: bin/fluffychat extensions: [ gnome ] plugs: - audio-playback