]> jfr.im git - irc/hexchat/hexchat.git/commitdiff
actions: Add flatpak action
authorPatrick Griffis <redacted>
Fri, 28 May 2021 00:16:42 +0000 (19:16 -0500)
committerPatrick Griffis <redacted>
Mon, 21 Jun 2021 17:48:38 +0000 (12:48 -0500)
.github/workflows/flatpak-build.yml [new file with mode: 0644]
.gitmodules [new file with mode: 0644]
flatpak/Load-plugins-from-Flatpak-extensions.patch [new file with mode: 0644]
flatpak/io.github.Hexchat.json [new file with mode: 0644]
flatpak/python3-cffi.json [new file with mode: 0644]
flatpak/shared-modules [new submodule]

diff --git a/.github/workflows/flatpak-build.yml b/.github/workflows/flatpak-build.yml
new file mode 100644 (file)
index 0000000..5a0371b
--- /dev/null
@@ -0,0 +1,17 @@
+name: Flatpak Build
+on: [push, pull_request]
+jobs:
+  build:
+    runs-on: ubuntu-latest
+    container:
+      image: bilelmoussaoui/flatpak-github-actions:gnome-40
+      options: --privileged
+    steps:
+    - uses: actions/checkout@v2
+      with:
+        submodules: true
+
+    - uses: bilelmoussaoui/flatpak-github-actions/flatpak-builder@v3
+      with:
+        bundle: hexchat.flatpak
+        manifest-path: flatpak/io.github.Hexchat.json
diff --git a/.gitmodules b/.gitmodules
new file mode 100644 (file)
index 0000000..ff13813
--- /dev/null
@@ -0,0 +1,3 @@
+[submodule "flatpak/shared-modules"]
+       path = flatpak/shared-modules
+       url = https://github.com/flathub/shared-modules.git
diff --git a/flatpak/Load-plugins-from-Flatpak-extensions.patch b/flatpak/Load-plugins-from-Flatpak-extensions.patch
new file mode 100644 (file)
index 0000000..e93e864
--- /dev/null
@@ -0,0 +1,25 @@
+From 918503d57c6740d20be68a6717158673a2a8b25f Mon Sep 17 00:00:00 2001
+From: Patrick Griffis <tingping@tingping.se>
+Date: Sat, 17 Mar 2018 05:57:49 -0400
+Subject: [PATCH] Support loading Flatpak extensions
+
+---
+ src/common/plugin.c | 2 ++
+ 1 file changed, 2 insertions(+)
+
+diff --git a/src/common/plugin.c b/src/common/plugin.c
+index 3ad3c558..6addf962 100644
+--- a/src/common/plugin.c
++++ b/src/common/plugin.c
+@@ -450,6 +450,8 @@ plugin_auto_load (session *sess)
+       lib_dir = plugin_get_libdir ();
+       sub_dir = g_build_filename (get_xdir (), "addons", NULL);
++      for_files ("/app/extensions/lib/hexchat/plugins", "*.so", plugin_auto_load_cb);
++
+ #ifdef WIN32
+       /* a long list of bundled plugins that should be loaded automatically,
+        * user plugins should go to <config>, leave Program Files alone! */
+-- 
+2.14.3
+
diff --git a/flatpak/io.github.Hexchat.json b/flatpak/io.github.Hexchat.json
new file mode 100644 (file)
index 0000000..74811d2
--- /dev/null
@@ -0,0 +1,79 @@
+{
+  "app-id": "io.github.Hexchat",
+  "branch": "stable",
+  "runtime": "org.gnome.Platform",
+  "runtime-version": "40",
+  "sdk": "org.gnome.Sdk",
+  "command": "hexchat",
+  "rename-icon": "hexchat",
+  "finish-args": [
+    "--share=ipc",
+    "--socket=x11",
+    "--share=network",
+    "--socket=pulseaudio",
+    "--filesystem=xdg-download",
+
+    "--talk-name=org.freedesktop.Notifications",
+
+    "--talk-name=org.mpris.MediaPlayer2.*"
+  ],
+  "add-extensions": {
+    "io.github.Hexchat.Plugin": {
+      "version": "20.08",
+      "directory": "extensions",
+      "add-ld-path": "lib",
+      "merge-dirs": "lib/hexchat/plugins",
+      "subdirectories": true,
+      "no-autodownload": true,
+      "autodelete": true
+    }
+  },
+  "modules": [
+    "shared-modules/gtk2/gtk2.json",
+    "shared-modules/gtk2/gtk2-common-themes.json",
+    "shared-modules/dbus-glib/dbus-glib-0.110.json",
+    "shared-modules/lua5.3/lua-5.3.5.json",
+    "shared-modules/libcanberra/libcanberra.json",
+    "python3-cffi.json",
+    {
+      "name": "lgi",
+      "buildsystem": "meson",
+      "sources": [
+        {
+          "type": "git",
+          "url": "https://github.com/pavouk/lgi.git",
+          "commit": "95418635aa8151a516d43166227ea2b9d4c4403f"
+        }
+      ]
+    },
+    {
+      "name": "hexchat",
+      "buildsystem": "meson",
+      "config-opts": [
+        "--buildtype=release",
+        "-Ddbus-service-use-appid=true",
+        "-Dwith-perl=false",
+        "-Dwith-lua=lua"
+      ],
+      "build-options": {
+        "cflags": "-Wno-error=missing-include-dirs"
+      },
+      "cleanup": [
+        "/share/man"
+      ],
+      "post-install": [
+        "install -d /app/extensions"
+      ],
+      "sources": [
+        {
+          "type": "dir",
+          "path": ".."
+        },
+        {
+          "type": "patch",
+          "path": "Load-plugins-from-Flatpak-extensions.patch"
+        }
+      ]
+    }
+  ]
+}
diff --git a/flatpak/python3-cffi.json b/flatpak/python3-cffi.json
new file mode 100644 (file)
index 0000000..171a384
--- /dev/null
@@ -0,0 +1,19 @@
+{
+    "name": "python3-cffi",
+    "buildsystem": "simple",
+    "build-commands": [
+        "pip3 install --verbose --exists-action=i --no-index --find-links=\"file://${PWD}\" --prefix=${FLATPAK_DEST} \"cffi\" --no-build-isolation"
+    ],
+    "sources": [
+        {
+            "type": "file",
+            "url": "https://files.pythonhosted.org/packages/0f/86/e19659527668d70be91d0369aeaa055b4eb396b0f387a4f92293a20035bd/pycparser-2.20.tar.gz",
+            "sha256": "2d475327684562c3a96cc71adf7dc8c4f0565175cf86b6d7a404ff4c771f15f0"
+        },
+        {
+            "type": "file",
+            "url": "https://files.pythonhosted.org/packages/a8/20/025f59f929bbcaa579704f443a438135918484fffaacfaddba776b374563/cffi-1.14.5.tar.gz",
+            "sha256": "fd78e5fee591709f32ef6edb9a015b4aa1a5022598e36227500c8f4e02328d9c"
+        }
+    ]
+}
\ No newline at end of file
diff --git a/flatpak/shared-modules b/flatpak/shared-modules
new file mode 160000 (submodule)
index 0000000..45cc381
--- /dev/null
@@ -0,0 +1 @@
+Subproject commit 45cc381cdb43da1f22bc61baba4e390792eb5f8b