From 2eb7825e693f70e274e0a457fa72365de047ff12 Mon Sep 17 00:00:00 2001 From: WerWolv Date: Wed, 25 Aug 2021 14:52:07 +0200 Subject: [PATCH] build: Add support for flatpaks Based on the original work of @Calinou --- .github/workflows/build.yml | 17 +++++++++ dist/net.werwolv.ImHex.yaml | 71 +++++++++++++++++++++++++++++++++++++ 2 files changed, 88 insertions(+) create mode 100644 dist/net.werwolv.ImHex.yaml diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index bc5c76a49..72ec074f8 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -12,6 +12,9 @@ jobs: linux: runs-on: ubuntu-20.04 name: 🐧 Ubuntu 20.04 + container: + image: bilelmoussaoui/flatpak-github-actions:gnome-40 + options: --privileged steps: - name: 🧰 Checkout @@ -39,6 +42,13 @@ jobs: .. make -j 4 install + - name: ✋ Bundle Flatpak + uses: bilelmoussaoui/flatpak-github-actions/flatpak-builder@v4 + with: + bundle: imhex.flatpak + manifest-path: dist/net.werwolv.ImHex.yaml + cache-key: flatpak-builder-${{ github.sha }} + - name: 📦 Upload ELF uses: actions/upload-artifact@v2 with: @@ -46,6 +56,13 @@ jobs: path: | build/install/* + - name: 📦 Upload Flatpak + uses: actions/upload-artifact@v2 + with: + name: Linux Flatpak + path: | + build/*.flatpak + win: runs-on: windows-latest name: 🟦 Windows MINGW64 diff --git a/dist/net.werwolv.ImHex.yaml b/dist/net.werwolv.ImHex.yaml new file mode 100644 index 000000000..76e336ec3 --- /dev/null +++ b/dist/net.werwolv.ImHex.yaml @@ -0,0 +1,71 @@ +app-id: net.werwolv.ImHex +runtime: org.freedesktop.Platform +runtime-version: '20.08' +default-branch: stable +sdk: org.freedesktop.Sdk +command: imhex + +finish-args: + - --share=ipc + - --socket=x11 + - --filesystem=host + - --device=all + +modules: + - name: capstone + buildsystem: cmake-ninja + builddir: true + config-opts: + - -DCMAKE_BUILD_TYPE=RelWithDebInfo + sources: + - type: archive + url: https://github.com/aquynh/capstone/archive/4.0.2.tar.gz + sha256: 7c81d798022f81e7507f1a60d6817f63aa76e489aa4e7055255f21a22f5e526a + + - name: libiconv + sources: + - type: archive + url: https://ftp.gnu.org/pub/gnu/libiconv/libiconv-1.16.tar.gz + sha256: e6a1b1b589654277ee790cce3734f07876ac4ccfaecbee8afa0b649cf529cc04 + + - name: glfw + buildsystem: cmake-ninja + builddir: true + config-opts: + - -DCMAKE_BUILD_TYPE=RelWithDebInfo + - -DBUILD_SHARED_LIBS:BOOL=ON + sources: + - type: archive + url: https://github.com/glfw/glfw/releases/download/3.3.2/glfw-3.3.2.zip + sha256: 08a33a512f29d7dbf78eab39bd7858576adcc95228c9efe8e4bc5f0f3261efc7 + cleanup: + - /include + - /lib/pkgconfig + + - name: mbedtls + buildsystem: cmake-ninja + config-opts: + - -DCMAKE_C_FLAGS=-fPIC + sources: + - type: archive + url: https://github.com/ARMmbed/mbedtls/archive/refs/tags/v2.27.0.tar.gz + sha256: 2a07856e541f0e5f6eaee4f78018c52f25bd244ed76f9020dea54a8b02cac6ea + + - name: nlohmann-json + buildsystem: cmake-ninja + builddir: true + config-opts: + - -DCMAKE_BUILD_TYPE=RelWithDebInfo + - -DBUILD_TESTING=OFF + + sources: + - type: archive + url: https://github.com/nlohmann/json/archive/v3.9.1.tar.gz + sha256: 4cf0df69731494668bdd6460ed8cb269b68de9c19ad8c27abc24cd72605b2d5b + + - name: imhex + buildsystem: cmake-ninja + + sources: + - type: git + url: https://github.com/WerWolv/ImHex.git \ No newline at end of file