[gnome-books/wip/hadess/more-dead-code-cleanup] build: Remove "apps" array, we only have one app now



commit f5b4a3e7ee285754ffe2f60e4901f8b5b85e95d5
Author: Bastien Nocera <hadess hadess net>
Date:   Thu Jan 31 11:54:06 2019 +0100

    build: Remove "apps" array, we only have one app now

 data/meson.build      | 95 ++++++++++++++++++++++++---------------------------
 meson.build           |  4 ---
 meson_post_install.py | 10 ++----
 src/meson.build       | 60 ++++++++++++++++----------------
 4 files changed, 77 insertions(+), 92 deletions(-)
---
diff --git a/data/meson.build b/data/meson.build
index 8d749e10..4cad56c9 100644
--- a/data/meson.build
+++ b/data/meson.build
@@ -38,66 +38,61 @@ resource_data = files(
 
 desktop_file_validate = find_program('desktop-file-validate', required: false)
 appstream_util = find_program('appstream-util', required: false)
-schemas = []
 
-foreach app: books_apps
-  resource = app + '.data'
+resource = 'org.gnome.Books.data'
 
-  sources += gnome.compile_resources(
-    resource,
-    resource + '.gresource.xml',
-    source_dir: '.',
-    dependencies: resource_data,
-    gresource_bundle: true,
-    install: true,
-    install_dir: books_pkgdatadir
-  )
+sources += gnome.compile_resources(
+  resource,
+  resource + '.gresource.xml',
+  source_dir: '.',
+  dependencies: resource_data,
+  gresource_bundle: true,
+  install: true,
+  install_dir: books_pkgdatadir
+)
 
-  appdata = app + '.appdata.xml'
+appdata = 'org.gnome.Books.appdata.xml'
 
-  appdata_file = i18n.merge_file(
-    appdata,
-    input: appdata + '.in',
-    output: appdata,
-    po_dir: po_dir,
-    install: true,
-    install_dir: join_paths(books_datadir, 'metainfo')
+appdata_file = i18n.merge_file(
+  appdata,
+  input: appdata + '.in',
+  output: appdata,
+  po_dir: po_dir,
+  install: true,
+  install_dir: join_paths(books_datadir, 'metainfo')
+)
+if appstream_util.found()
+  test(
+      'validate-appdata', appstream_util,
+      args: [
+          'validate-relax', '--nonet', appdata_file.full_path()
+      ]
   )
-  if appstream_util.found()
-    test(
-        'validate-appdata', appstream_util,
-        args: [
-            'validate-relax', '--nonet', appdata_file.full_path()
-        ]
-    )
-    endif
+  endif
 
 
-  desktop = app + '.desktop'
+desktop = 'org.gnome.Books.desktop'
 
-  desktop_file = i18n.merge_file(
-    desktop,
-    type: 'desktop',
-    input: desktop + '.in',
-    output: desktop,
-    po_dir: po_dir,
-    install: true,
-    install_dir: join_paths(books_datadir, 'applications')
+desktop_file = i18n.merge_file(
+  desktop,
+  type: 'desktop',
+  input: desktop + '.in',
+  output: desktop,
+  po_dir: po_dir,
+  install: true,
+  install_dir: join_paths(books_datadir, 'applications')
+)
+if desktop_file_validate.found()
+  test(
+      'validate-desktop',
+      desktop_file_validate,
+      args: [
+          desktop_file.full_path()
+      ]
   )
-  if desktop_file_validate.found()
-    test(
-        'validate-desktop',
-        desktop_file_validate,
-        args: [
-            desktop_file.full_path()
-        ]
-    )
-  endif
-
-  schemas += app.to_lower() + '.gschema.xml'
-endforeach
+endif
 
 install_data(
-  schemas,
+  'org.gnome.books.gschema.xml',
   install_dir: books_schemadir
 )
diff --git a/meson.build b/meson.build
index 20370b1e..21697c00 100644
--- a/meson.build
+++ b/meson.build
@@ -14,10 +14,6 @@ books_private_ns = books_ns + 'Private'
 books_api_version = '1.0'
 books_gir_version = '1.0'
 
-books_apps = [
-  'org.gnome.Books',
-]
-
 books_prefix = get_option('prefix')
 books_bindir = join_paths(books_prefix, get_option('bindir'))
 books_datadir = join_paths(books_prefix, get_option('datadir'))
diff --git a/meson_post_install.py b/meson_post_install.py
index 4ce21182..484dacf0 100644
--- a/meson_post_install.py
+++ b/meson_post_install.py
@@ -13,17 +13,13 @@ bindir = os.path.normpath(destdir + os.sep + sys.argv[2])
 
 # FIXME: meson will not track the creation of these files
 #        https://github.com/mesonbuild/meson/blob/master/mesonbuild/scripts/uninstall.py#L39
-apps = [
-  ['org.gnome.Books', 'gnome-books'],
-]
 
 if not os.path.exists(bindir):
   os.makedirs(bindir)
 
-for app in apps:
-  src = os.path.join(datadir, 'gnome-books', app[0])
-  dest = os.path.join(bindir, app[1])
-  subprocess.call(['ln', '-s', '-f', src, dest])
+src = os.path.join(datadir, 'gnome-books', 'org.gnome.Books')
+dest = os.path.join(bindir, 'gnome-books')
+subprocess.call(['ln', '-s', '-f', src, dest])
 
 if not os.environ.get('DESTDIR'):
   icondir = os.path.join(datadir, 'icons', 'hicolor')
diff --git a/src/meson.build b/src/meson.build
index 4fbe3ab7..b4099718 100644
--- a/src/meson.build
+++ b/src/meson.build
@@ -77,37 +77,35 @@ app_conf.set('libdir', books_libdir)
 app_conf.set('PACKAGE_VERSION', books_version)
 app_conf.set('GJS', gjs_console)
 
-foreach app: books_apps
-  service = app + '.service'
-
-  configure_file(
-    input: service + '.in',
-    output: service,
-    install: true,
-    install_dir: join_paths(books_datadir, 'dbus-1', 'services'),
-    configuration: service_conf
-  )
-
-  configure_file(
-    input: app + '.in',
-    output: app,
-    install: true,
-    install_dir: books_pkgdatadir,
-    configuration: app_conf
-  )
-
-  resource = app + '.src'
-
-  sources += gnome.compile_resources(
-    resource,
-    resource + '.gresource.xml',
-    source_dir: '.',
-    dependencies: resource_data,
-    gresource_bundle: true,
-    install: true,
-    install_dir: books_pkgdatadir
-  )
-endforeach
+service = 'org.gnome.Books.service'
+
+configure_file(
+  input: service + '.in',
+  output: service,
+  install: true,
+  install_dir: join_paths(books_datadir, 'dbus-1', 'services'),
+  configuration: service_conf
+)
+
+configure_file(
+  input: 'org.gnome.Books.in',
+  output: 'org.gnome.Books',
+  install: true,
+  install_dir: books_pkgdatadir,
+  configuration: app_conf
+)
+
+resource = 'org.gnome.Books.src'
+
+sources += gnome.compile_resources(
+  resource,
+  resource + '.gresource.xml',
+  source_dir: '.',
+  dependencies: resource_data,
+  gresource_bundle: true,
+  install: true,
+  install_dir: books_pkgdatadir
+)
 
 incs = [
   top_inc,


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