Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix appimage build on Linux #742

Merged
merged 1 commit into from
Oct 10, 2023
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
2 changes: 1 addition & 1 deletion .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ jobs:
run: |
case "$RUNNER_OS" in
Linux)
cp dist/*/* "twake-$GITHUB_REF_NAME-linux-amd64.AppImage";;
cp dist/* "twake-$GITHUB_REF_NAME-linux-amd64.AppImage";;
macOS)
cp dist/*/* "twake-$GITHUB_REF_NAME-macos-amd64.dmg"
# Notarize the app
Expand Down
65 changes: 65 additions & 0 deletions appimage/AppImageBuilder.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
# appimage-builder recipe see https://appimage-builder.readthedocs.io for details
script:
- rm -rf AppDir | true
- cp -r ./build/linux/x64/{{BUILD_TYPE}}/bundle AppDir
- mkdir -p AppDir/usr/share/icons/hicolor/64x64/apps/
- cp ./assets/logo.svg AppDir/usr/share/icons/hicolor/64x64/apps/twake.svg
version: 1
AppDir:
path: ./AppDir
app_info:
id: com.linagora.linux.twake
name: Twake
icon: twake
version: latest
exec: fluffychat
hoangdat marked this conversation as resolved.
Show resolved Hide resolved
exec_args: $@
apt:
arch:
- amd64
allow_unauthenticated: true
sources:
- sourceline: deb http://azure.archive.ubuntu.com/ubuntu/ {{VERSION_CODENAME}} main restricted universe multiverse
key_url: "http://keyserver.ubuntu.com/pks/lookup?op=get&search=0x871920D1991BC93C"
- sourceline: deb http://azure.archive.ubuntu.com/ubuntu/ {{VERSION_CODENAME}}-updates main restricted universe multiverse
key_url: "http://keyserver.ubuntu.com/pks/lookup?op=get&search=0x871920D1991BC93C"
- sourceline: deb http://azure.archive.ubuntu.com/ubuntu/ {{VERSION_CODENAME}}-backports main restricted universe multiverse
key_url: "http://keyserver.ubuntu.com/pks/lookup?op=get&search=0x871920D1991BC93C"
- sourceline: deb http://azure.archive.ubuntu.com/ubuntu {{VERSION_CODENAME}}-security main restricted universe multiverse
key_url: "http://keyserver.ubuntu.com/pks/lookup?op=get&search=0x871920D1991BC93C"
include:
- libgtk-3-0
- libwayland-cursor0
- libc6
- libjsoncpp25
- libsecret-1-0
- libmpv1
- libdrm2
- libolm3
files:
include: []
exclude:
- usr/share/man
- usr/share/doc/*/README.*
- usr/share/doc/*/changelog.*
- usr/share/doc/*/NEWS.*
- usr/share/doc/*/TODO.*
test:
fedora-30:
image: appimagecrafters/tests-env:fedora-30
command: ./AppRun
debian-stable:
image: appimagecrafters/tests-env:debian-stable
command: ./AppRun
archlinux-latest:
image: appimagecrafters/tests-env:archlinux-latest
command: ./AppRun
centos-7:
image: appimagecrafters/tests-env:centos-7
command: ./AppRun
ubuntu-bionic:
image: appimagecrafters/tests-env:ubuntu-bionic
command: ./AppRun
AppImage:
arch: x86_64
update-information: guess
8 changes: 4 additions & 4 deletions scripts/build-linux-debug.sh
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
#!/bin/sh -ve
echo "Setup Linux dependencies"
sudo apt-get install -y clang cmake ninja-build pkg-config libgtk-3-dev liblzma-dev libjsoncpp-dev locate libfuse-dev libolm-dev

# Updating database of locate
sudo updatedb
sudo apt-get install -y clang cmake ninja-build \
pkg-config libgtk-3-dev liblzma-dev \
libjsoncpp-dev libfuse-dev \
libolm-dev libmpv-dev libsecret-1-dev

flutter config --enable-linux-desktop
flutter clean
Expand Down
8 changes: 4 additions & 4 deletions scripts/build-linux.sh
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
#!/bin/sh -ve
echo "Setup Linux dependencies"
sudo apt-get install -y clang cmake ninja-build pkg-config libgtk-3-dev liblzma-dev libjsoncpp-dev locate libfuse-dev libolm-dev

# Updating database of locate
sudo updatedb
sudo apt-get install -y clang cmake ninja-build \
pkg-config libgtk-3-dev liblzma-dev \
libjsoncpp-dev libfuse-dev \
libolm-dev libmpv-dev libsecret-1-dev

flutter config --enable-linux-desktop
flutter clean
Expand Down
17 changes: 11 additions & 6 deletions scripts/package-linux-debug.sh
Original file line number Diff line number Diff line change
@@ -1,10 +1,15 @@
#!/bin/bash

# Setup AppImageTool for packaging
echo "Setting up AppImageTool"
curl -o appimagetool -L "https://github.com/AppImage/AppImageKit/releases/download/continuous/appimagetool-x86_64.AppImage"
chmod +x appimagetool
sudo mv appimagetool /usr/local/bin/
# Setup appimage-builder for packaging
echo "Setting up appimage-builder"
wget -O appimage-builder-x86_64.AppImage https://github.com/AppImageCrafters/appimage-builder/releases/download/v1.1.0/appimage-builder-1.1.0-x86_64.AppImage
chmod +x appimage-builder-x86_64.AppImage
sudo mv appimage-builder-x86_64.AppImage /usr/local/bin/appimage-builder

echo "Packaging."
flutter pub global run flutter_distributor:main.dart package --platform linux --targets appimage --skip-clean --flutter-build-args="profile"
export BUILD_TYPE=profile
# This is to set environment variable from a file
# https://stackoverflow.com/a/45971167/8296391
set -a; . /etc/os-release; set +a
appimage-builder --recipe appimage/AppImageBuilder.yml --skip-tests
mkdir dist && cp ./*.AppImage dist/
17 changes: 11 additions & 6 deletions scripts/package-linux.sh
Original file line number Diff line number Diff line change
@@ -1,10 +1,15 @@
#!/bin/bash

# Setup AppImageTool for packaging
echo "Setting up AppImageTool"
curl -o appimagetool -L "https://github.com/AppImage/AppImageKit/releases/download/continuous/appimagetool-x86_64.AppImage"
chmod +x appimagetool
sudo mv appimagetool /usr/local/bin/
# Setup appimage-builder for packaging
echo "Setting up appimage-builder"
wget -O appimage-builder-x86_64.AppImage https://github.com/AppImageCrafters/appimage-builder/releases/download/v1.1.0/appimage-builder-1.1.0-x86_64.AppImage
chmod +x appimage-builder-x86_64.AppImage
sudo mv appimage-builder-x86_64.AppImage /usr/local/bin/appimage-builder

echo "Packaging."
flutter pub global run flutter_distributor:main.dart package --platform linux --targets appimage --skip-clean --flutter-build-args="release"
export BUILD_TYPE=release
# This is to set environment variable from a file
# https://stackoverflow.com/a/45971167/8296391
set -a; . /etc/os-release; set +a
appimage-builder --recipe appimage/AppImageBuilder.yml --skip-tests
mkdir dist && cp ./*.AppImage dist/