Skip to content

Commit 1e33ea7

Browse files
bilelmoussaouikaiw
authored andcommitted
buildsystem: switch to using meson
1 parent b73a7be commit 1e33ea7

10 files changed

Lines changed: 201 additions & 18 deletions

data/icons/meson.build

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# Install hicolor icons
2+
3+
4+
5+
# Install HighContrast icons
6+
install_data(
7+
[
8+
'HighContrast/scalable/apps/org.gnome.meld.svg'
9+
],
10+
install_dir: join_paths(get_option('datadir'), 'icons', 'HighContrast', 'scalable', 'apps')
11+
)

data/meson.build

Lines changed: 91 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,91 @@
1+
# Install desktop file
2+
desktop_file = i18n.merge_file(
3+
input: '@0@.desktop.in'.format(application_id),
4+
output: '@0@.desktop'.format(application_id),
5+
po_dir: join_paths(meson.source_root(), 'po'),
6+
type: 'desktop',
7+
install: true,
8+
install_dir: join_paths(get_option('datadir'), 'applications')
9+
)
10+
# Validate Desktop file
11+
desktop_file_validate = find_program('desktop-file-validate', required: false)
12+
if desktop_file_validate.found()
13+
test (
14+
'Validate desktop file',
15+
desktop_file_validate,
16+
args: desktop_file.full_path()
17+
)
18+
endif
19+
# Install AppData file
20+
appdata_file = i18n.merge_file(
21+
input: '@0@.appdata.xml.in'.format(application_id),
22+
output: '@0@.appdata.xml'.format(application_id),
23+
po_dir: join_paths(meson.source_root(), 'po'),
24+
install: true,
25+
install_dir: join_paths(get_option('datadir'), 'appdata')
26+
)
27+
# Validate AppData file
28+
appstreamcli = find_program('appstream-util', required: false)
29+
if appstreamcli.found()
30+
test (
31+
'Validate appdata file',
32+
appstreamcli,
33+
args: [
34+
'validate-relax',
35+
appdata_file.full_path()
36+
]
37+
)
38+
endif
39+
# Install Schehma file
40+
install_data(
41+
'@0@.gschema.xml'.format(application_id),
42+
install_dir : join_paths(get_option('datadir'), 'glib-2.0', 'schemas')
43+
)
44+
# Install CSS file
45+
install_data(
46+
[
47+
files('meld.css')
48+
],
49+
install_dir: join_paths(get_option('datadir'), meson.project_name())
50+
)
51+
# Install the UI files
52+
install_data(
53+
[
54+
'ui/application.ui',
55+
'ui/appmenu-fallback.xml',
56+
'ui/dirdiff-ui.xml',
57+
'ui/dirdiff.ui',
58+
'ui/EditableList.ui',
59+
'ui/encoding-selector.ui',
60+
'ui/filediff-ui.xml',
61+
'ui/filediff.ui',
62+
'ui/findbar.ui',
63+
'ui/language-selector.ui',
64+
'ui/meldapp-ui.xml',
65+
'ui/meldapp.ui',
66+
'ui/patch-dialog.ui',
67+
'ui/preferences.ui',
68+
'ui/shortcuts.ui',
69+
'ui/tab-placeholder.ui',
70+
'ui/vcview-ui.xml',
71+
'ui/vcview.ui'
72+
],
73+
install_dir: join_paths(get_option('datadir'), meson.project_name(), 'ui')
74+
)
75+
# Install the styles files
76+
install_data(
77+
[
78+
'styles/meld-base.xml',
79+
'styles/meld-dark.xml'
80+
],
81+
install_dir: join_paths(get_option('datadir'), meson.project_name(), 'styles')
82+
)
83+
# Install the mimetypes
84+
appdata_file = i18n.merge_file(
85+
input: join_paths('mime', '@0@.xml.in'.format(application_id)),
86+
output: '@0@.xml'.format(application_id),
87+
po_dir: join_paths(meson.source_root(), 'po'),
88+
install: true,
89+
install_dir: join_paths(get_option('datadir'), 'mime', 'packages')
90+
)
91+
subdir('icons')

data/mime/org.gnome.meld.xml.in

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<mime-info xmlns="http://www.freedesktop.org/standards/shared-mime-info">
33
<mime-type type="application/x-meld-comparison">
4-
<_comment>Meld comparison description</_comment>
4+
<comment>Meld comparison description</comment>
55
<glob pattern="*.meldcmp"/>
66
<icon name="org.gnome.meld"/>
77
</mime-type>

data/org.gnome.meld.appdata.xml.in

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2,22 +2,22 @@
22
<!-- Copyright 2013-2014 Kai Willadsen <kai.willadsen@gmail.com> -->
33
<component type="desktop">
44
<id>org.gnome.meld.desktop</id>
5-
<metadata_license>CC0-1.0</metadata_license>
6-
<project_license>GPL-2.0+ and CC-BY-SA-3.0</project_license>
7-
<_name>Meld</_name>
8-
<_summary>Compare and merge your files</_summary>
5+
<metadatalicense>CC0-1.0</metadatalicense>
6+
<projectlicense>GPL-2.0+ and CC-BY-SA-3.0</projectlicense>
7+
<name>Meld</name>
8+
<summary>Compare and merge your files</summary>
99
<description>
10-
<_p>
10+
<p>
1111
Meld is a visual diff and merge tool targeted at developers.
1212
Meld helps you compare files, directories, and version controlled projects.
1313
It provides two- and three-way comparison of both files and directories,
1414
and supports many version control systems including Git, Mercurial,
1515
Bazaar and Subversion.
16-
</_p>
17-
<_p>
16+
</p>
17+
<p>
1818
Meld helps you review code changes, understand patches, and makes enormous
1919
merge conflicts slightly less painful.
20-
</_p>
20+
</p>
2121
</description>
2222
<kudos>
2323
<kudo>AppMenu</kudo>
@@ -42,11 +42,11 @@
4242
<url type="bugtracker">https://gitlab.gnome.org/GNOME/meld/issues</url>
4343
<url type="donation">http://www.gnome.org/friends/</url>
4444
<url type="translate">https://wiki.gnome.org/TranslationProject</url>
45-
<update_contact>kai.willadsen@gmail.com</update_contact>
46-
<project_group>GNOME</project_group>
47-
<_developer_name>The GNOME Project</_developer_name>
45+
<updatecontact>kai.willadsen@gmail.com</updatecontact>
46+
<projectgroup>GNOME</projectgroup>
47+
<developername>The GNOME Project</developername>
4848
<translation type="gettext">meld</translation>
49-
<content_rating type="oars-1.1" />
49+
<contentrating type="oars-1.1" />
5050
<releases>
5151
<release date="2019-01-06" version="3.20.0">
5252
<description>

data/org.gnome.meld.desktop.in

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
[Desktop Entry]
2-
_Name=Meld
3-
_GenericName=Diff Viewer
4-
_X-GNOME-FullName=Meld Diff Viewer
5-
_Comment=Compare and merge your files
2+
Name=Meld
3+
GenericName=Diff Viewer
4+
X-GNOME-FullName=Meld Diff Viewer
5+
Comment=Compare and merge your files
66
# TRANSLATORS: Search terms to find this application. Do NOT translate or localize the semicolons! The list MUST also end with a semicolon!
7-
_Keywords=diff;merge;
7+
Keywords=diff;merge;
88
Exec=meld %F
99
Terminal=false
1010
Type=Application

help/LINGUAS

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
cs
2+
de
3+
el
4+
es
5+
pl
6+
sv

help/meson.build

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
help_files = [
2+
'C/command-line.page',
3+
'C/file-changes.page',
4+
'C/file-filters.page',
5+
'C/file-mode.page',
6+
'C/flattened-view.page',
7+
'C/folder-mode.page',
8+
'C/index.page',
9+
'C/introduction.page',
10+
'C/keyboard-shortcuts.page',
11+
'C/legal.xml',
12+
'C/missing-functionality.page',
13+
'C/preferences.page',
14+
'C/resolving-conflicts.page',
15+
'C/text-filters.page',
16+
'C/vc-mode.page',
17+
'C/vc-supported.page'
18+
]
19+
20+
21+
gnome.yelp(meson.project_name(),
22+
sources: help_files
23+
)

meson.build

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
project('meld', version: '3.19.1',
2+
meson_version: '>=0.46.0')
3+
4+
application_id = 'org.gnome.meld'
5+
6+
python = import('python')
7+
i18n = import('i18n')
8+
gnome = import('gnome')
9+
10+
python3 = python.find_installation('python3')
11+
if not python3.found()
12+
error('Python 3 is required to build and use Meld')
13+
endif
14+
15+
dependency('gtk+-3.0', version: '>= 3.20')
16+
dependency('glib-2.0', version: '>= 2.48')
17+
dependency('gtksourceview-3.0', version: '>= 3.20.0')
18+
19+
20+
21+
subdir('data')
22+
subdir('help')
23+
subdir('po')
24+
25+
26+
install_data(
27+
[
28+
'bin/meld'
29+
],
30+
install_dir: get_option('bindir')
31+
)
32+
install_subdir(
33+
meson.project_name(),
34+
install_dir: python3.get_path('purelib')
35+
)
36+
37+
meson.add_install_script('meson_post_install.py')

meson_post_install.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
#!/usr/bin/env python3
2+
3+
from os import environ, path
4+
from subprocess import call
5+
6+
if not environ.get('DESTDIR', ''):
7+
PREFIX = environ.get('MESON_INSTALL_PREFIX', '/usr/local')
8+
DATA_DIR = path.join(PREFIX, 'share')
9+
print('Updating icon cache...')
10+
call(['gtk-update-icon-cache', '-qtf', path.join(DATA_DIR, 'icons', 'hicolor')])
11+
print("Compiling new schemas")
12+
call(["glib-compile-schemas", path.join(DATA_DIR, 'glib-2.0', 'schemas')])
13+
print("Updating desktop database")
14+
call(["update-desktop-database", path.join(DATA_DIR, 'applications')])

po/meson.build

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
i18n.gettext(meson.project_name(), preset: 'glib')

0 commit comments

Comments
 (0)