[recipes/wip/help: 3/4] Build yelp



commit 48cc84f425992a3f93a9d1d6b265faaf80835e0d
Author: Matthias Clasen <mclasen redhat com>
Date:   Thu Mar 16 13:41:51 2017 -0400

    Build yelp
    
    Eventually, yelp will be in the runtime. For now, build
    it here, and patch it to take an acceptable name on the
    session bus when running inside our sandbox: org.gnome.Recipes.Help.

 flatpak/0001-Try-to-fit-in-a-sandbox.patch |   46 ++++++++++++++++++++++++++++
 flatpak/org.gnome.Recipes.json             |   15 +++++++++
 2 files changed, 61 insertions(+), 0 deletions(-)
---
diff --git a/flatpak/0001-Try-to-fit-in-a-sandbox.patch b/flatpak/0001-Try-to-fit-in-a-sandbox.patch
new file mode 100644
index 0000000..1907cb5
--- /dev/null
+++ b/flatpak/0001-Try-to-fit-in-a-sandbox.patch
@@ -0,0 +1,46 @@
+From 1a9ddf907792de0778f13248b6f0bd7e8d211562 Mon Sep 17 00:00:00 2001
+From: Matthias Clasen <mclasen redhat com>
+Date: Thu, 16 Mar 2017 15:44:48 -0400
+Subject: [PATCH] Try to fit in a sandbox
+
+When running in another apps sandbox, use an app name that works.
+---
+ src/yelp-application.c | 17 ++++++++++++++++-
+ 1 file changed, 16 insertions(+), 1 deletion(-)
+
+diff --git a/src/yelp-application.c b/src/yelp-application.c
+index 47a69991..c7fd646c 100644
+--- a/src/yelp-application.c
++++ b/src/yelp-application.c
+@@ -370,12 +370,27 @@ YelpApplication *
+ yelp_application_new (void)
+ {
+     YelpApplication *app;
++    char *app_id = NULL;
++    char *yelp = NULL;
++
++    if (g_file_test ("/.flatpak-info", G_FILE_TEST_EXISTS)) {
++        GKeyFile *kf = g_key_file_new ();
++        g_key_file_load_from_file (kf, "/.flatpak-info", G_KEY_FILE_NONE, NULL);
++        app_id = g_key_file_get_string (kf, "Application", "name", NULL);
++        yelp = g_strconcat (app_id, ".Help", NULL);
++        g_key_file_unref (kf);
++    }
++    else {
++        yelp = g_strdup ("org.gnome.Yelp");
++    }
+ 
+     app = g_object_new (YELP_TYPE_APPLICATION,
+-                        "application-id", "org.gnome.Yelp",
++                        "application-id", yelp,
+                         "flags", G_APPLICATION_HANDLES_COMMAND_LINE,
+                         "inactivity-timeout", 5000,
+                         NULL);
++    g_free (app_id);
++    g_free (yelp);
+ 
+     return app;
+ }
+-- 
+2.12.0
+
diff --git a/flatpak/org.gnome.Recipes.json b/flatpak/org.gnome.Recipes.json
index 0074a66..afecd26 100644
--- a/flatpak/org.gnome.Recipes.json
+++ b/flatpak/org.gnome.Recipes.json
@@ -75,6 +75,21 @@
             ]
         },
         {
+            "name": "yelp",
+            "sources": [
+                {
+                    "type": "git",
+                    "url": "git://git.gnome.org/yelp"
+                },
+                {
+                    "type": "patch",
+                    "path": "flatpak/0001-Try-to-fit-in-a-sandbox.patch",
+                    "strip-components": 1
+
+                }
+            ]
+        },
+        {
             "name": "recipes",
             "buildsystem": "meson",
             "builddir": true,


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