[dia: 1/4] Flatpak: add a manifest



commit a1e4b53edc31ee705f32836cb60e89f34c316367
Author: Bilal Elmoussaoui <bil elmoussaoui gmail com>
Date:   Mon May 20 22:37:35 2019 +0200

    Flatpak: add a manifest

 build-aux/flatpak/gtk2-use-adwaita-theme.patch |  81 ++++++++++++++
 build-aux/flatpak/org.gnome.Dia.json           | 146 +++++++++++++++++++++++++
 2 files changed, 227 insertions(+)
---
diff --git a/build-aux/flatpak/gtk2-use-adwaita-theme.patch b/build-aux/flatpak/gtk2-use-adwaita-theme.patch
new file mode 100644
index 00000000..5ee57789
--- /dev/null
+++ b/build-aux/flatpak/gtk2-use-adwaita-theme.patch
@@ -0,0 +1,81 @@
+diff --git a/gdk/x11/gdkevents-x11.c b/gdk/x11/gdkevents-x11.c
+index 186a8f5cb2..f5c39b5afe 100644
+--- a/gdk/x11/gdkevents-x11.c
++++ b/gdk/x11/gdkevents-x11.c
+@@ -3000,6 +3000,50 @@ check_transform (const gchar *xsettings_name,
+     return TRUE;
+ }
+
++static gchar *
++gtk_rc_get_theme_dir (void)
++{
++  const gchar *var;
++  gchar *path;
++
++  var = g_getenv ("GTK_DATA_PREFIX");
++
++  if (var)
++    path = g_build_filename (var, "share", "themes", NULL);
++  else
++    path = g_build_filename ("/usr", "share", "themes", NULL);
++
++  return path;
++}
++
++static gboolean
++theme_name_valid (XSettingsSetting *setting)
++{
++  gboolean res = FALSE;
++
++  if (setting->type == XSETTINGS_TYPE_STRING)
++    {
++      char *theme_name = setting->data.v_string;
++      gchar *theme_dir = gtk_rc_get_theme_dir ();
++      gchar *path = g_build_filename (theme_dir, theme_name, "gtk-2.0", "gtkrc", NULL);
++
++      if (g_file_test (path, G_FILE_TEST_EXISTS))
++        res = TRUE;
++      else if (g_str_has_suffix (theme_name, "-Dark") ||
++               g_str_has_suffix (theme_name, "-dark"))
++        {
++          setting->data.v_string = g_strdup ("Adwaita-dark");
++          g_free (theme_name);
++          res = TRUE;
++        }
++
++      g_free (theme_dir);
++      g_free (path);
++    }
++
++  return res;
++}
++
+ /**
+  * gdk_screen_get_setting:
+  * @screen: the #GdkScreen where the setting is located
+@@ -3050,6 +3094,11 @@ gdk_screen_get_setting (GdkScreen   *screen,
+   if (result != XSETTINGS_SUCCESS)
+     goto out;
+
++  if (strcmp (name, "gtk-theme-name") == 0 &&
++      (setting->type != XSETTINGS_TYPE_STRING ||
++       !theme_name_valid (setting)))
++    goto out;
++
+   switch (setting->type)
+     {
+     case XSETTINGS_TYPE_INT:
+diff --git a/gtk/gtksettings.c b/gtk/gtksettings.c
+index 3fbbf00548..5c0a4b33d2 100644
+--- a/gtk/gtksettings.c
++++ b/gtk/gtksettings.c
+@@ -312,7 +312,7 @@ gtk_settings_class_init (GtkSettingsClass *class)
+ #ifdef G_OS_WIN32
+                                                                 "MS-Windows",
+ #else
+-                                                                "Raleigh",
++                                                                "Adwaita",
+ #endif
+                                                                 GTK_PARAM_READWRITE),
+                                              NULL);
+
diff --git a/build-aux/flatpak/org.gnome.Dia.json b/build-aux/flatpak/org.gnome.Dia.json
new file mode 100644
index 00000000..21cb81d9
--- /dev/null
+++ b/build-aux/flatpak/org.gnome.Dia.json
@@ -0,0 +1,146 @@
+{
+    "app-id": "org.gnome.Dia",
+    "runtime": "org.gnome.Platform",
+    "runtime-version": "master",
+    "sdk": "org.gnome.Sdk",
+    "command": "dia",
+    "rename-icon": "dia",
+    "copy-icon": true,
+    "rename-desktop-file": "dia.desktop",
+    "appstream-compose": false,
+    "finish-args": [
+        "--filesystem=home",
+        "--device=dri",
+        "--share=ipc",
+        "--socket=x11",
+        "--socket=wayland",
+        "--filesystem=xdg-run/dconf",
+        "--filesystem=~/.config/dconf:ro",
+        "--talk-name=ca.desrt.dconf",
+        "--env=DCONF_USER_CONFIG_DIR=.config/dconf"
+    ],
+    "cleanup": [
+        "/include",
+        "/lib/pkgconfig",
+        "/man",
+        "/share/doc",
+        "/share/gtk-doc",
+        "/share/man",
+        "/share/pkgconfig",
+        "/share/vala",
+        "*.la",
+        "*.a"
+    ],
+    "modules": [{
+            "name": "gnome-themes-extra",
+            "rm-configure": true,
+            "config-opts": [
+                "--disable-dependency-tracking",
+                "--disable-gtk3-engine"
+            ],
+            "cleanup": [
+                "/share/themes/Adwaita/gtk-3.0",
+                "/share/themes/Adwaita-dark/gtk-3.0",
+                "/share/themes/HighContrast/gtk-3.0",
+                "*.la"
+            ],
+            "sources": [{
+                    "type": "archive",
+                    "url": 
"https://download.gnome.org/sources/gnome-themes-extra/3.28/gnome-themes-extra-3.28.tar.xz";,
+                    "sha256": "7c4ba0bff001f06d8983cfc105adaac42df1d1267a2591798a780bac557a5819"
+                },
+                {
+                    "type": "shell",
+                    "//": "We want to avoid generating icons as its 99% of the build time and gnome runtime 
has it",
+                    "commands": [
+                        "sed -i 's/icons//' themes/HighContrast/Makefile.am"
+                    ]
+                },
+                {
+                    "type": "script",
+                    "commands": [
+                        "autoreconf -fsi"
+                    ]
+                }
+            ],
+            "modules": [{
+                    "name": "gtk2",
+                    "cleanup": [
+                        "/bin",
+                        "/share/gtk-2.0",
+                        "/share/aclocal",
+                        "/share/gtk-doc",
+                        "/lib/pkgconfig",
+                        "/lib/gtk-2.0/include",
+                        "/include",
+                        "*.la"
+                    ],
+                    "x-cpe": {
+                        "product": "gtk+"
+                    },
+                    "config-opts": [
+                        "--disable-dependency-tracking",
+                        "--disable-gtk-doc-html",
+                        "--disable-introspection",
+                        "--with-xinput=xfree"
+                    ],
+                    "sources": [{
+                            "type": "archive",
+                            "url": "https://download.gnome.org/sources/gtk+/2.24/gtk+-2.24.32.tar.xz";,
+                            "sha256": "b6c8a93ddda5eabe3bfee1eb39636c9a03d2a56c7b62828b359bf197943c582e"
+                        },
+                        {
+                            "type": "patch",
+                            "path": "gtk2-use-adwaita-theme.patch"
+                        }
+                    ]
+                },
+                {
+                    "name": "ibus-gtk2",
+                    "no-make-install": true,
+                    "config-opts": [
+                        "--disable-xim",
+                        "--disable-dconf",
+                        "--disable-gconf",
+                        "--disable-memconf",
+                        "--disable-schemas-compile",
+                        "--disable-schemas-install",
+                        "--disable-gtk3",
+                        "--disable-setup",
+                        "--disable-ui",
+                        "--disable-engine",
+                        "--disable-python-library",
+                        "--disable-libnotify",
+                        "--disable-emoji-dict",
+                        "--disable-appindicator",
+                        "--disable-glibtest",
+                        "--disable-tests",
+                        "--disable-unicode-dict",
+                        "--disable-introspection",
+                        "--disable-python2"
+                    ],
+                    "ensure-writable": [
+                        "/lib/gtk-2.0/2.10.0/immodules.cache"
+                    ],
+                    "post-install": [
+                        "install -m644 --target-directory=/app/lib/gtk-2.0/2.10.0/immodules 
client/gtk2/.libs/im-ibus.so",
+                        "gtk-query-immodules-2.0 > /app/lib/gtk-2.0/2.10.0/immodules.cache"
+                    ],
+                    "sources": [{
+                        "type": "archive",
+                        "url": "https://github.com/ibus/ibus/releases/download/1.5.20/ibus-1.5.20.tar.gz";,
+                        "sha256": "4cf1e5ca4b067a3bed3cdfa658d49ac597d817b2de627a1095214565f862d034"
+                    }]
+                }
+            ]
+        },
+        {
+            "name": "dia",
+            "buildsystem": "meson",
+            "sources": [{
+                "type": "git",
+                "url": "https://gitlab.gnome.org/GNOME/dia.git";
+            }]
+        }
+    ]
+}


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]