[gnome-documents] build: Change file centric approach



commit 6149912c58141b3728ce31a0afd964389227466f
Author: Iñigo Martínez <inigomartinez gmail com>
Date:   Thu Mar 15 08:20:05 2018 +0100

    build: Change file centric approach
    
    meson uses a file centric approach, which means that for every
    file available it loops all the available applications.
    
    However, every file related to applications are duplicated so
    actually the application approach is the right one. Following this
    approach all the files are handled by every available application.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=787013

 data/meson.build |   42 ++++++++++--------------------
 meson.build      |    5 +++
 src/meson.build  |   73 +++++++++++++++++++++--------------------------------
 3 files changed, 48 insertions(+), 72 deletions(-)
---
diff --git a/data/meson.build b/data/meson.build
index d6bcce5..246a15a 100644
--- a/data/meson.build
+++ b/data/meson.build
@@ -37,12 +37,13 @@ resource_data = files(
   'ui/view-menu.ui'
 )
 
-resources = [
-  'org.gnome.Books.data',
-  'org.gnome.Documents.data'
-]
+desktop_file_validate = find_program('desktop-file-validate')
+
+schemas = []
+
+foreach app: documents_apps
+  resource = app + '.data'
 
-foreach resource: resources
   sources += gnome.compile_resources(
     resource,
     resource + '.gresource.xml',
@@ -52,14 +53,9 @@ foreach resource: resources
     install: true,
     install_dir: documents_pkgdatadir
   )
-endforeach
 
-appdatas = [
-  'org.gnome.Books.appdata.xml',
-  'org.gnome.Documents.appdata.xml'
-]
+  appdata = app + '.appdata.xml'
 
-foreach appdata: appdatas
   i18n.merge_file(
     appdata,
     input: appdata + '.in',
@@ -68,16 +64,9 @@ foreach appdata: appdatas
     install: true,
     install_dir: join_paths(documents_datadir, 'metainfo')
   )
-endforeach
 
-desktop_file_validate = find_program('desktop-file-validate')
-
-desktops = [
-  'org.gnome.Books.desktop',
-  'org.gnome.Documents.desktop'
-]
+  desktop = app + '.desktop'
 
-foreach desktop: desktops
   desktop_file = i18n.merge_file(
     desktop,
     type: 'desktop',
@@ -87,19 +76,16 @@ foreach desktop: desktops
     install: true,
     install_dir: documents_desktopdir
   )
+
+  schemas += app.to_lower() + '.gschema.xml'
 endforeach
 
 install_data(
-  'org.gnome.Documents.search-provider.ini',
-  install_dir: join_paths(documents_datadir, 'gnome-shell', 'search-providers')
-)
-
-schemas = files(
-  'org.gnome.books.gschema.xml',
-  'org.gnome.documents.gschema.xml'
+  schemas,
+  install_dir: documents_schemadir
 )
 
 install_data(
-  schemas,
-  install_dir: documents_schemadir
+  'org.gnome.Documents.search-provider.ini',
+  install_dir: join_paths(documents_datadir, 'gnome-shell', 'search-providers')
 )
diff --git a/meson.build b/meson.build
index 553236d..e93ac30 100644
--- a/meson.build
+++ b/meson.build
@@ -11,6 +11,11 @@ documents_version = meson.project_version()
 documents_api_version = '1.0'
 documents_gir_version = '1.0'
 
+documents_apps = [
+  'org.gnome.Books',
+  'org.gnome.Documents'
+]
+
 documents_prefix = get_option('prefix')
 documents_bindir = join_paths(documents_prefix, get_option('bindir'))
 documents_datadir = join_paths(documents_prefix, get_option('datadir'))
diff --git a/src/meson.build b/src/meson.build
index 27380c7..de37eef 100644
--- a/src/meson.build
+++ b/src/meson.build
@@ -14,45 +14,6 @@ configure_file(
 )
 '''
 
-service_conf = configuration_data()
-service_conf.set('bindir', documents_bindir)
-
-services = [
-  'org.gnome.Books.service',
-  'org.gnome.Documents.service'
-]
-
-foreach service: services
-  configure_file(
-    input: service + '.in',
-    output: service,
-    install: true,
-    install_dir: join_paths(documents_datadir, 'dbus-1', 'services'),
-    configuration: service_conf
-  )
-endforeach
-
-app_conf = configuration_data()
-app_conf.set('prefix', documents_prefix)
-app_conf.set('libdir', documents_libdir)
-app_conf.set('PACKAGE_VERSION', documents_version)
-app_conf.set('GJS', gjs_console)
-
-apps = [
-  'org.gnome.Books',
-  'org.gnome.Documents'
-]
-
-foreach app: apps
-  configure_file(
-    input: app + '.in',
-    output: app,
-    install: true,
-    install_dir: documents_pkgdatadir,
-    configuration: app_conf
-  )
-endforeach
-
 headers = files(
   'lib/gd-bookmark.h',
   'lib/gd-bookmarks.h',
@@ -115,12 +76,36 @@ resource_data = files(
   'windowMode.js'
 )
 
-resources = [
-  'org.gnome.Books.src',
-  'org.gnome.Documents.src'
-]
+service_conf = configuration_data()
+service_conf.set('bindir', documents_bindir)
+
+app_conf = configuration_data()
+app_conf.set('prefix', documents_prefix)
+app_conf.set('libdir', documents_libdir)
+app_conf.set('PACKAGE_VERSION', documents_version)
+app_conf.set('GJS', gjs_console)
+
+foreach app: documents_apps
+  service = app + '.service'
+
+  configure_file(
+    input: service + '.in',
+    output: service,
+    install: true,
+    install_dir: join_paths(documents_datadir, 'dbus-1', 'services'),
+    configuration: service_conf
+  )
+
+  configure_file(
+    input: app + '.in',
+    output: app,
+    install: true,
+    install_dir: documents_pkgdatadir,
+    configuration: app_conf
+  )
+
+  resource = app + '.src'
 
-foreach resource: resources
   sources += gnome.compile_resources(
     resource,
     resource + '.gresource.xml',


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