[gnome-sudoku] unify-app id and set up flatpak nightlies



commit b983ec5e081e2b3ed29c61426523d77df38a8a3a
Author: Bilal Elmoussaoui <bil elmoussaoui gmail com>
Date:   Sun Jan 13 22:54:26 2019 +0000

    unify-app id and set up flatpak nightlies

 .gitignore                                         |   1 +
 .gitlab-ci.yml                                     |  23 +++++++++
 build-aux/org.gnome.Sudoku.json                    |  43 ++++++++++++++++
 post_install.py => build-aux/post_install.py       |   0
 .../{gnome-sudoku.png => org.gnome.Sudoku.png}     | Bin
 .../{gnome-sudoku.png => org.gnome.Sudoku.png}     | Bin
 .../{gnome-sudoku.png => org.gnome.Sudoku.png}     | Bin
 .../{gnome-sudoku.png => org.gnome.Sudoku.png}     | Bin
 .../{gnome-sudoku.png => org.gnome.Sudoku.png}     | Bin
 .../{gnome-sudoku.svg => org.gnome.Sudoku.svg}     |   0
 ...-symbolic.svg => org.gnome.Sudoku-symbolic.svg} |   0
 data/meson.build                                   |  18 +++----
 ...data.xml.in => org.gnome.Sudoku.appdata.xml.in} |  11 ++--
 ...doku.desktop.in => org.gnome.Sudoku.desktop.in} |   2 +-
 ...ku.gschema.xml => org.gnome.Sudoku.gschema.xml} |   6 +--
 meson.build                                        |   6 +--
 org.gnome.sudoku.json                              |  57 ---------------------
 po/meson.build                                     |   2 +-
 src/gnome-sudoku.vala                              |   8 +--
 src/meson.build                                    |   2 +-
 20 files changed, 96 insertions(+), 83 deletions(-)
---
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..c6a151b
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1 @@
+_build/
\ No newline at end of file
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
new file mode 100644
index 0000000..fc43048
--- /dev/null
+++ b/.gitlab-ci.yml
@@ -0,0 +1,23 @@
+include: 'https://gitlab.gnome.org/GNOME/citemplates/raw/master/flatpak/flatpak_ci_initiative.yml'
+
+variables:
+    BUNDLE: "sudoku-dev.flatpak"
+
+flatpak:
+    image: 'registry.gitlab.gnome.org/gnome/gnome-runtime-images/gnome:master'
+    variables:
+        MANIFEST_PATH: " build-aux/org.gnome.Sudoku.json"
+        FLATPAK_MODULE: "gnome-sudoku"
+        RUNTIME_REPO: "https://sdk.gnome.org/gnome-nightly.flatpakrepo";
+        APP_ID: " org.gnome.Sudoku"
+    extends: .flatpak
+
+review:
+    stage: deploy
+    dependencies:
+        - 'flatpak'
+    extends: '.review'
+
+stop_review:
+    stage: deploy
+    extends: '.stop_review'
diff --git a/build-aux/org.gnome.Sudoku.json b/build-aux/org.gnome.Sudoku.json
new file mode 100644
index 0000000..27e2a1c
--- /dev/null
+++ b/build-aux/org.gnome.Sudoku.json
@@ -0,0 +1,43 @@
+{
+    "app-id": "org.gnome.Sudoku",
+    "runtime": "org.gnome.Platform",
+    "runtime-version": "master",
+    "sdk": "org.gnome.Sdk",
+    "command": "gnome-sudoku",
+    "tags": ["nightly"],
+    "desktop-file-name-prefix": "(Nightly) ",
+    "finish-args": [
+        /* X11 + XShm access */
+        "--share=ipc", "--socket=x11",
+        /* Wayland access */
+        "--socket=wayland",
+        /* dconf */
+        "--filesystem=xdg-run/dconf", "--filesystem=~/.config/dconf:ro",
+        "--talk-name=ca.desrt.dconf", "--env=DCONF_USER_CONFIG_DIR=.config/dconf"
+    ],
+    "modules": [{
+            "name": "libgee",
+            "config-opts": ["--enable-introspection=no"],
+            "sources": [{
+                "type": "git",
+                "url": "https://gitlab.gnome.org/GNOME/libgee.git";
+            }]
+        },
+        {
+            "name": "qqwing",
+            "sources": [{
+                "type": "archive",
+                "url": "https://ostermiller.org/qqwing/qqwing-1.3.4.tar.gz";,
+                "sha256": "1753736c31feea0085f5cfac33143743204f8a7e66b81ccd17e249ecafba802f"
+            }]
+        },
+        {
+            "name": "gnome-sudoku",
+            "buildsystem": "meson",
+            "sources": [{
+                "type": "git",
+                "url": "https://gitlab.gnome.org/GNOME/gnome-sudoku.git";
+            }]
+        }
+    ]
+}
\ No newline at end of file
diff --git a/post_install.py b/build-aux/post_install.py
similarity index 100%
rename from post_install.py
rename to build-aux/post_install.py
diff --git a/data/icons/hicolor/16x16/gnome-sudoku.png b/data/icons/hicolor/16x16/org.gnome.Sudoku.png
similarity index 100%
rename from data/icons/hicolor/16x16/gnome-sudoku.png
rename to data/icons/hicolor/16x16/org.gnome.Sudoku.png
diff --git a/data/icons/hicolor/22x22/gnome-sudoku.png b/data/icons/hicolor/22x22/org.gnome.Sudoku.png
similarity index 100%
rename from data/icons/hicolor/22x22/gnome-sudoku.png
rename to data/icons/hicolor/22x22/org.gnome.Sudoku.png
diff --git a/data/icons/hicolor/24x24/gnome-sudoku.png b/data/icons/hicolor/24x24/org.gnome.Sudoku.png
similarity index 100%
rename from data/icons/hicolor/24x24/gnome-sudoku.png
rename to data/icons/hicolor/24x24/org.gnome.Sudoku.png
diff --git a/data/icons/hicolor/32x32/gnome-sudoku.png b/data/icons/hicolor/32x32/org.gnome.Sudoku.png
similarity index 100%
rename from data/icons/hicolor/32x32/gnome-sudoku.png
rename to data/icons/hicolor/32x32/org.gnome.Sudoku.png
diff --git a/data/icons/hicolor/48x48/gnome-sudoku.png b/data/icons/hicolor/48x48/org.gnome.Sudoku.png
similarity index 100%
rename from data/icons/hicolor/48x48/gnome-sudoku.png
rename to data/icons/hicolor/48x48/org.gnome.Sudoku.png
diff --git a/data/icons/hicolor/scalable/gnome-sudoku.svg b/data/icons/hicolor/scalable/org.gnome.Sudoku.svg
similarity index 100%
rename from data/icons/hicolor/scalable/gnome-sudoku.svg
rename to data/icons/hicolor/scalable/org.gnome.Sudoku.svg
diff --git a/data/icons/hicolor/symbolic/gnome-sudoku-symbolic.svg 
b/data/icons/hicolor/symbolic/org.gnome.Sudoku-symbolic.svg
similarity index 100%
rename from data/icons/hicolor/symbolic/gnome-sudoku-symbolic.svg
rename to data/icons/hicolor/symbolic/org.gnome.Sudoku-symbolic.svg
diff --git a/data/meson.build b/data/meson.build
index 1a753bb..b40704e 100644
--- a/data/meson.build
+++ b/data/meson.build
@@ -3,8 +3,8 @@ resource_files = files('gnome-sudoku.gresource.xml')
 resources = gnome.compile_resources('gnome-sudoku', resource_files)
 
 desktop = i18n.merge_file('desktop',
-  input: 'gnome-sudoku.desktop.in',
-  output: 'gnome-sudoku.desktop',
+  input: '@0  desktop in'.format(application_id),
+  output: '@0@.desktop'.format(application_id),
   install: true,
   install_dir: join_paths(datadir, 'applications'),
   po_dir: '../po',
@@ -12,31 +12,31 @@ desktop = i18n.merge_file('desktop',
 )
 
 appdata = i18n.merge_file('appdata',
-  input: 'gnome-sudoku.appdata.xml.in',
-  output: 'gnome-sudoku.appdata.xml',
+  input: '@0  appdata xml in'.format(application_id),
+  output: '@0  appdata xml'.format(application_id),
   install: true,
   install_dir: join_paths(datadir, 'metainfo'),
   po_dir: '../po'
 )
 
-install_data('org.gnome.sudoku.gschema.xml',
+install_data('@0  gschema xml'.format(application_id),
   install_dir: join_paths(datadir, 'glib-2.0', 'schemas')
 )
 
-install_man('gnome-sudoku.6')
+install_man('@0@.6'.format(meson.project_name()))
 
 icondir = join_paths(datadir, 'icons', 'hicolor')
 
 foreach icon_size: ['16x16', '22x22', '24x24', '32x32', '48x48']
-  install_data('icons/hicolor/@0@/gnome-sudoku.png'.format(icon_size),
+  install_data('icons/hicolor/@0@/@1@.png'.format(icon_size, application_id),
     install_dir: join_paths(icondir, icon_size, 'apps')
   )
 endforeach
 
-install_data('icons/hicolor/scalable/gnome-sudoku.svg',
+install_data('icons/hicolor/scalable/@0@.svg'.format(application_id),
   install_dir: join_paths(icondir, 'scalable', 'apps')
 )
 
-install_data('icons/hicolor/symbolic/gnome-sudoku-symbolic.svg',
+install_data('icons/hicolor/symbolic/@0 -symbolic svg'.format(application_id),
   install_dir: join_paths(icondir, 'symbolic', 'apps')
 )
diff --git a/data/gnome-sudoku.appdata.xml.in b/data/org.gnome.Sudoku.appdata.xml.in
similarity index 92%
rename from data/gnome-sudoku.appdata.xml.in
rename to data/org.gnome.Sudoku.appdata.xml.in
index bc0229c..a2717d9 100644
--- a/data/gnome-sudoku.appdata.xml.in
+++ b/data/org.gnome.Sudoku.appdata.xml.in
@@ -1,7 +1,7 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <!-- Copyright 2013 Michael Catanzaro and contributors -->
-<component type="desktop">
-  <id>gnome-sudoku.desktop</id>
+<component type="desktop-application">
+  <id>org.gnome.Sudoku</id>
   <metadata_license>CC0-1.0</metadata_license>
   <project_license>GPL-3.0+</project_license>
   <name>GNOME Sudoku</name>
@@ -30,15 +30,18 @@
       <caption>A GNOME sudoku game preview</caption>
     </screenshot>
   </screenshots>
+  <launchable type="desktop-id">org.gnome.Sudoku.desktop</launchable>
   <url type="homepage">https://wiki.gnome.org/Apps/Sudoku</url>
-  <url type="bugtracker">https://bugzilla.gnome.org/enter_bug.cgi?product=gnome-sudoku</url>
+  <url type="bugtracker">https://gitlab.gnome.org/GNOME/gnome-sudoku</url>
   <url type="donation">http://www.gnome.org/friends/</url>
   <url type="help">https://help.gnome.org/users/gnome-sudoku/stable/</url>
   <url type="translate">https://wiki.gnome.org/TranslationProject</url>
   <update_contact>mcatanzaro_at_gnome.org</update_contact>
   <project_group>GNOME</project_group>
+  <provides>
+    <id>gnome-sudoku.desktop</id>
+  </provides>
   <kudos>
-    <kudo>AppMenu</kudo>
     <kudo>HiDpiIcon</kudo>
     <kudo>ModernToolkit</kudo>
     <kudo>UserDocs</kudo>
diff --git a/data/gnome-sudoku.desktop.in b/data/org.gnome.Sudoku.desktop.in
similarity index 95%
rename from data/gnome-sudoku.desktop.in
rename to data/org.gnome.Sudoku.desktop.in
index 6cbb5bd..cfaa1a4 100644
--- a/data/gnome-sudoku.desktop.in
+++ b/data/org.gnome.Sudoku.desktop.in
@@ -5,7 +5,7 @@ Comment=Test your logic skills in this number grid puzzle
 Keywords=magic;square;
 Exec=gnome-sudoku
 # Translators: Do NOT translate or transliterate this text (this is an icon file name)!
-Icon=gnome-sudoku
+Icon=org.gnome.Sudoku
 Terminal=false
 Type=Application
 Categories=GNOME;GTK;Game;LogicGame;
diff --git a/data/org.gnome.sudoku.gschema.xml b/data/org.gnome.Sudoku.gschema.xml
similarity index 90%
rename from data/org.gnome.sudoku.gschema.xml
rename to data/org.gnome.Sudoku.gschema.xml
index 5560be9..5867c7f 100644
--- a/data/org.gnome.sudoku.gschema.xml
+++ b/data/org.gnome.Sudoku.gschema.xml
@@ -1,12 +1,12 @@
 <schemalist>
-  <enum id="org.gnome.sudoku.print-multiple-sudoku-difficulty">
+  <enum id="org.gnome.Sudoku.print-multiple-sudoku-difficulty">
     <value nick="easy" value="1" />
     <value nick="medium" value="2" />
     <value nick="hard" value="3"  />
     <value nick="very_hard" value="4"  />
   </enum>
-  <schema id="org.gnome.sudoku" path="/org/gnome/sudoku/" gettext-domain="gnome-sudoku">
-    <key name="print-multiple-sudoku-difficulty" enum="org.gnome.sudoku.print-multiple-sudoku-difficulty">
+  <schema id="org.gnome.Sudoku" path="/org/gnome/Sudoku/" gettext-domain="gnome-sudoku">
+    <key name="print-multiple-sudoku-difficulty" enum="org.gnome.Sudoku.print-multiple-sudoku-difficulty">
       <default>"easy"</default>
       <summary>Difficulty level of sudokus to be printed</summary>
       <description>Set the difficulty level of the sudokus you want to print. Possible values are: "easy", 
"medium", "hard", "very_hard"</description>
diff --git a/meson.build b/meson.build
index f45bc5d..4e696c8 100644
--- a/meson.build
+++ b/meson.build
@@ -6,7 +6,7 @@ project('gnome-sudoku', ['c', 'cpp', 'vala'],
   meson_version: '>= 0.44.1',
   version: '3.31.1'
 )
-
+application_id = 'org.gnome.Sudoku'
 add_project_arguments([
     '-include', 'config.h'
   ],
@@ -40,7 +40,7 @@ config_include_dir = include_directories('.')
 
 conf = configuration_data()
 
-conf.set_quoted('GETTEXT_PACKAGE', 'gnome-sudoku')
+conf.set_quoted('GETTEXT_PACKAGE', meson.project_name())
 conf.set_quoted('LOCALEDIR', join_paths(prefix, localedir))
 conf.set_quoted('VERSION', meson.project_version())
 
@@ -54,4 +54,4 @@ subdir('lib')
 subdir('po')
 subdir('src')
 
-meson.add_install_script('post_install.py')
+meson.add_install_script('build-aux/post_install.py')
diff --git a/po/meson.build b/po/meson.build
index 6074e2a..e9b77d7 100644
--- a/po/meson.build
+++ b/po/meson.build
@@ -1 +1 @@
-i18n.gettext('gnome-sudoku', preset: 'glib')
+i18n.gettext(meson.project_name(), preset: 'glib')
diff --git a/src/gnome-sudoku.vala b/src/gnome-sudoku.vala
index 463d358..7fb2579 100644
--- a/src/gnome-sudoku.vala
+++ b/src/gnome-sudoku.vala
@@ -123,7 +123,7 @@ public class Sudoku : Gtk.Application
 
         add_action_entries (action_entries, this);
 
-        settings = new GLib.Settings ("org.gnome.sudoku");
+        settings = new GLib.Settings ("org.gnome.Sudoku");
         var action = settings.create_action ("show-warnings");
         action.notify["state"].connect (() => {
             if (view != null && current_game_mode == GameMode.PLAY)
@@ -146,9 +146,9 @@ public class Sudoku : Gtk.Application
         set_accels_for_action ("app.redo", {"<Primary><Shift>z"});
         set_accels_for_action ("app.help", {"F1"});
 
-        Window.set_default_icon_name ("gnome-sudoku");
+        Window.set_default_icon_name ("org.gnome.Sudoku");
 
-        var builder = new Builder.from_resource ("/org/gnome/sudoku/ui/gnome-sudoku.ui");
+        var builder = new Builder.from_resource ("/org/gnome/Sudoku/ui/gnome-sudoku.ui");
 
         window = (ApplicationWindow) builder.get_object ("sudoku_app");
         window.size_allocate.connect (size_allocate_cb);
@@ -603,7 +603,7 @@ public class Sudoku : Gtk.Application
 
         show_about_dialog (window,
                                "program-name", _("Sudoku"),
-                               "logo-icon-name", "gnome-sudoku",
+                               "logo-icon-name", "org.gnome.Sudoku",
                                "version", VERSION,
                                "comments", localized_comments_format.printf (SudokuGenerator.qqwing_version 
()),
                                "copyright", "Copyright © 2005–2008 Thomas M. Hinkle\nCopyright © 2010–2011 
Robert Ancell\nCopyright © 2014 Parin Porecha",
diff --git a/src/meson.build b/src/meson.build
index cff61bc..34e6568 100644
--- a/src/meson.build
+++ b/src/meson.build
@@ -15,7 +15,7 @@ gnome_sudoku_sources = [
 
 gnome_sudoku_dependencies = [gtk, libsudoku_dep]
 
-gnome_sudoku = executable('gnome-sudoku', gnome_sudoku_sources,
+gnome_sudoku = executable(meson.project_name(), gnome_sudoku_sources,
   vala_args: gnome_sudoku_vala_args,
   dependencies: gnome_sudoku_dependencies,
   link_with: libsudoku,


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