[meld] buildsystem: switch to using meson



commit 1e33ea7ee98ac3eadde2b79e49df6ed93d9af14e
Author: Bilal Elmoussaoui <bil elmoussaoui gmail com>
Date:   Sat Dec 22 17:35:30 2018 +0100

    buildsystem: switch to using meson

 data/icons/meson.build             | 11 +++++
 data/meson.build                   | 91 ++++++++++++++++++++++++++++++++++++++
 data/mime/org.gnome.meld.xml.in    |  2 +-
 data/org.gnome.meld.appdata.xml.in | 24 +++++-----
 data/org.gnome.meld.desktop.in     | 10 ++---
 help/LINGUAS                       |  6 +++
 help/meson.build                   | 23 ++++++++++
 meson.build                        | 37 ++++++++++++++++
 meson_post_install.py              | 14 ++++++
 po/meson.build                     |  1 +
 10 files changed, 201 insertions(+), 18 deletions(-)
---
diff --git a/data/icons/meson.build b/data/icons/meson.build
new file mode 100644
index 00000000..adfe7a85
--- /dev/null
+++ b/data/icons/meson.build
@@ -0,0 +1,11 @@
+# Install hicolor icons
+
+
+
+# Install HighContrast icons
+install_data(
+    [
+        'HighContrast/scalable/apps/org.gnome.meld.svg'
+    ],
+    install_dir: join_paths(get_option('datadir'), 'icons', 'HighContrast', 'scalable', 'apps')
+)
\ No newline at end of file
diff --git a/data/meson.build b/data/meson.build
new file mode 100644
index 00000000..4f91b9cc
--- /dev/null
+++ b/data/meson.build
@@ -0,0 +1,91 @@
+# Install desktop file
+desktop_file = i18n.merge_file(
+  input: '@0  desktop in'.format(application_id),
+  output: '@0@.desktop'.format(application_id),
+  po_dir: join_paths(meson.source_root(), 'po'),
+  type: 'desktop',
+  install: true,
+  install_dir: join_paths(get_option('datadir'), 'applications')
+)
+# Validate Desktop file
+desktop_file_validate = find_program('desktop-file-validate', required: false)
+if desktop_file_validate.found()
+  test (
+    'Validate desktop file',
+    desktop_file_validate,
+    args: desktop_file.full_path()
+  )
+endif
+# Install AppData file
+appdata_file = i18n.merge_file(
+  input: '@0  appdata xml in'.format(application_id),
+  output: '@0  appdata xml'.format(application_id),
+  po_dir: join_paths(meson.source_root(), 'po'),
+  install: true,
+  install_dir: join_paths(get_option('datadir'), 'appdata')
+)
+# Validate AppData file
+appstreamcli = find_program('appstream-util', required: false)
+if appstreamcli.found()
+  test (
+    'Validate appdata file',
+    appstreamcli,
+    args: [
+        'validate-relax',
+        appdata_file.full_path()
+     ]
+  )
+endif
+# Install Schehma file
+install_data(
+  '@0  gschema xml'.format(application_id),
+  install_dir : join_paths(get_option('datadir'), 'glib-2.0', 'schemas')
+)
+# Install CSS file
+install_data(
+    [
+        files('meld.css')
+    ],
+    install_dir: join_paths(get_option('datadir'), meson.project_name())
+)
+# Install the UI files
+install_data(
+    [
+        'ui/application.ui',
+        'ui/appmenu-fallback.xml',
+        'ui/dirdiff-ui.xml',
+        'ui/dirdiff.ui',
+        'ui/EditableList.ui',
+        'ui/encoding-selector.ui',
+        'ui/filediff-ui.xml',
+        'ui/filediff.ui',
+        'ui/findbar.ui',
+        'ui/language-selector.ui',
+        'ui/meldapp-ui.xml',
+        'ui/meldapp.ui',
+        'ui/patch-dialog.ui',
+        'ui/preferences.ui',
+        'ui/shortcuts.ui',
+        'ui/tab-placeholder.ui',
+        'ui/vcview-ui.xml',
+        'ui/vcview.ui'
+    ],
+    install_dir: join_paths(get_option('datadir'), meson.project_name(), 'ui')
+)
+# Install the styles files
+install_data(
+    [
+        'styles/meld-base.xml',
+        'styles/meld-dark.xml'
+    ],
+    install_dir: join_paths(get_option('datadir'), meson.project_name(), 'styles')
+)
+# Install the mimetypes
+appdata_file = i18n.merge_file(
+  input: join_paths('mime', '@0  xml in'.format(application_id)),
+  output: '@0@.xml'.format(application_id),
+  po_dir: join_paths(meson.source_root(), 'po'),
+  install: true,
+  install_dir: join_paths(get_option('datadir'), 'mime', 'packages')
+)
+subdir('icons')
\ No newline at end of file
diff --git a/data/mime/org.gnome.meld.xml.in b/data/mime/org.gnome.meld.xml.in
index 365b9b80..e0d714c7 100644
--- a/data/mime/org.gnome.meld.xml.in
+++ b/data/mime/org.gnome.meld.xml.in
@@ -1,7 +1,7 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <mime-info xmlns="http://www.freedesktop.org/standards/shared-mime-info";>
    <mime-type type="application/x-meld-comparison">
-     <_comment>Meld comparison description</_comment>
+     <comment>Meld comparison description</comment>
      <glob pattern="*.meldcmp"/>
      <icon name="org.gnome.meld"/>
    </mime-type>
diff --git a/data/org.gnome.meld.appdata.xml.in b/data/org.gnome.meld.appdata.xml.in
index e268ebb6..4429ca4c 100644
--- a/data/org.gnome.meld.appdata.xml.in
+++ b/data/org.gnome.meld.appdata.xml.in
@@ -2,22 +2,22 @@
 <!-- Copyright 2013-2014 Kai Willadsen <kai willadsen gmail com> -->
 <component type="desktop">
   <id>org.gnome.meld.desktop</id>
-  <metadata_license>CC0-1.0</metadata_license>
-  <project_license>GPL-2.0+ and CC-BY-SA-3.0</project_license>
-  <_name>Meld</_name>
-  <_summary>Compare and merge your files</_summary>
+  <metadatalicense>CC0-1.0</metadatalicense>
+  <projectlicense>GPL-2.0+ and CC-BY-SA-3.0</projectlicense>
+  <name>Meld</name>
+  <summary>Compare and merge your files</summary>
   <description>
-    <_p>
+    <p>
       Meld is a visual diff and merge tool targeted at developers.
       Meld helps you compare files, directories, and version controlled projects.
       It provides two- and three-way comparison of both files and directories,
       and supports many version control systems including Git, Mercurial,
       Bazaar and Subversion.
-    </_p>
-    <_p>
+    </p>
+    <p>
       Meld helps you review code changes, understand patches, and makes enormous
       merge conflicts slightly less painful.
-    </_p>
+    </p>
   </description>
   <kudos>
     <kudo>AppMenu</kudo>
@@ -42,11 +42,11 @@
   <url type="bugtracker">https://gitlab.gnome.org/GNOME/meld/issues</url>
   <url type="donation">http://www.gnome.org/friends/</url>
   <url type="translate">https://wiki.gnome.org/TranslationProject</url>
-  <update_contact>kai willadsen gmail com</update_contact>
-  <project_group>GNOME</project_group>
-  <_developer_name>The GNOME Project</_developer_name>
+  <updatecontact>kai willadsen gmail com</updatecontact>
+  <projectgroup>GNOME</projectgroup>
+  <developername>The GNOME Project</developername>
   <translation type="gettext">meld</translation>
-  <content_rating type="oars-1.1" />
+  <contentrating type="oars-1.1" />
   <releases>
     <release date="2019-01-06" version="3.20.0">
       <description>
diff --git a/data/org.gnome.meld.desktop.in b/data/org.gnome.meld.desktop.in
index 64466de3..8268e819 100644
--- a/data/org.gnome.meld.desktop.in
+++ b/data/org.gnome.meld.desktop.in
@@ -1,10 +1,10 @@
 [Desktop Entry]
-_Name=Meld
-_GenericName=Diff Viewer
-_X-GNOME-FullName=Meld Diff Viewer
-_Comment=Compare and merge your files
+Name=Meld
+GenericName=Diff Viewer
+X-GNOME-FullName=Meld Diff Viewer
+Comment=Compare and merge your files
 # TRANSLATORS: Search terms to find this application. Do NOT translate or localize the semicolons! The list 
MUST also end with a semicolon!
-_Keywords=diff;merge;
+Keywords=diff;merge;
 Exec=meld %F
 Terminal=false
 Type=Application
diff --git a/help/LINGUAS b/help/LINGUAS
new file mode 100644
index 00000000..57b30b6e
--- /dev/null
+++ b/help/LINGUAS
@@ -0,0 +1,6 @@
+cs
+de
+el
+es
+pl
+sv
\ No newline at end of file
diff --git a/help/meson.build b/help/meson.build
new file mode 100644
index 00000000..13d6d6ba
--- /dev/null
+++ b/help/meson.build
@@ -0,0 +1,23 @@
+help_files = [
+    'C/command-line.page',
+    'C/file-changes.page',
+    'C/file-filters.page',
+    'C/file-mode.page',
+    'C/flattened-view.page',
+    'C/folder-mode.page',
+    'C/index.page',
+    'C/introduction.page',
+    'C/keyboard-shortcuts.page',
+    'C/legal.xml',
+    'C/missing-functionality.page',
+    'C/preferences.page',
+    'C/resolving-conflicts.page',
+    'C/text-filters.page',
+    'C/vc-mode.page',
+    'C/vc-supported.page'
+]
+
+
+gnome.yelp(meson.project_name(),
+    sources: help_files
+)
diff --git a/meson.build b/meson.build
new file mode 100644
index 00000000..48abafe0
--- /dev/null
+++ b/meson.build
@@ -0,0 +1,37 @@
+project('meld', version: '3.19.1',
+    meson_version: '>=0.46.0')
+
+application_id = 'org.gnome.meld'
+
+python = import('python')
+i18n = import('i18n')
+gnome = import('gnome')
+
+python3 = python.find_installation('python3')
+if not python3.found()
+    error('Python 3 is required to build and use Meld')
+endif
+
+dependency('gtk+-3.0', version: '>= 3.20')
+dependency('glib-2.0', version: '>= 2.48')
+dependency('gtksourceview-3.0', version: '>= 3.20.0')
+
+
+
+subdir('data')
+subdir('help')
+subdir('po')
+
+
+install_data(
+    [
+        'bin/meld'
+    ],
+    install_dir: get_option('bindir')
+)
+install_subdir(
+    meson.project_name(),
+    install_dir: python3.get_path('purelib')
+)
+
+meson.add_install_script('meson_post_install.py')
\ No newline at end of file
diff --git a/meson_post_install.py b/meson_post_install.py
new file mode 100644
index 00000000..83e737e8
--- /dev/null
+++ b/meson_post_install.py
@@ -0,0 +1,14 @@
+#!/usr/bin/env python3
+
+from os import environ, path
+from subprocess import call
+
+if not environ.get('DESTDIR', ''):
+    PREFIX = environ.get('MESON_INSTALL_PREFIX', '/usr/local')
+    DATA_DIR = path.join(PREFIX, 'share')
+    print('Updating icon cache...')
+    call(['gtk-update-icon-cache', '-qtf', path.join(DATA_DIR, 'icons', 'hicolor')])
+    print("Compiling new schemas")
+    call(["glib-compile-schemas", path.join(DATA_DIR, 'glib-2.0', 'schemas')])
+    print("Updating desktop database")
+    call(["update-desktop-database", path.join(DATA_DIR, 'applications')])
\ No newline at end of file
diff --git a/po/meson.build b/po/meson.build
new file mode 100644
index 00000000..5eab52ee
--- /dev/null
+++ b/po/meson.build
@@ -0,0 +1 @@
+i18n.gettext(meson.project_name(), preset: 'glib')
\ No newline at end of file


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