[baobab/wip/meson-2] Port to meson
- From: Stefano Facchini <sfacchini src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [baobab/wip/meson-2] Port to meson
- Date: Sun, 3 Sep 2017 08:27:41 +0000 (UTC)
commit 88081d711456fef3a97d0d5bf8f003dbbd24ead5
Author: Stefano Facchini <stefano facchini gmail com>
Date: Sat Sep 2 23:31:40 2017 +0200
Port to meson
.gitignore | 2 +
Makefile.am | 29 --
autogen.sh | 28 --
build-aux/post-install.py | 19 +
configure.ac | 66 ----
data/Makefile.am | 52 ---
{pixmaps => data/icons}/Makefile.am | 0
{pixmaps => data/icons}/baobab.svg | 0
.../icons/hicolor/16x16/apps/baobab.png | Bin 768 -> 768 bytes
.../icons/hicolor/22x22/apps/baobab.png | Bin 1108 -> 1108 bytes
.../icons/hicolor/24x24/apps/baobab.png | Bin 1149 -> 1149 bytes
.../icons/hicolor/256x256/apps/baobab.png | Bin 56172 -> 56172 bytes
.../icons/hicolor/32x32/apps/baobab.png | Bin 1577 -> 1577 bytes
.../icons/hicolor/48x48/apps/baobab.png | Bin 2556 -> 2556 bytes
.../hicolor/symbolic/apps/baobab-symbolic.svg | 0
data/meson.build | 31 ++
...b.desktop.in.in => org.gnome.baobab.desktop.in} | 4 -
data/org.gnome.baobab.gschema.xml.in | 2 +-
git.mk | 350 --------------------
help/Makefile.am | 27 --
help/meson.build | 48 +++
meson.build | 34 ++
po/meson.build | 2 +
src/Makefile.am | 67 ----
src/meson.build | 57 ++++
25 files changed, 194 insertions(+), 624 deletions(-)
---
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..89efb0f
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,2 @@
+build
+*.swp
diff --git a/build-aux/post-install.py b/build-aux/post-install.py
new file mode 100755
index 0000000..c1faf09
--- /dev/null
+++ b/build-aux/post-install.py
@@ -0,0 +1,19 @@
+#!/usr/bin/python3
+
+import os
+import pathlib
+import subprocess
+
+prefix = pathlib.Path(os.environ.get('MESON_INSTALL_PREFIX', '/usr/local'))
+datadir = prefix / 'share'
+destdir = os.environ.get('DESTDIR', '')
+
+if not destdir:
+ print('Compiling gsettings schemas...')
+ subprocess.call(['glib-compile-schemas', str(datadir / 'glib-2.0' / 'schemas')])
+
+ print('Updating icon cache...')
+ subprocess.call(['gtk-update-icon-cache', '-qtf', str(datadir / 'icons' / 'hicolor')])
+
+ print('Updating desktop database...')
+ subprocess.call(['update-desktop-database', '-q', str(datadir / 'applications')])
diff --git a/pixmaps/Makefile.am b/data/icons/Makefile.am
similarity index 100%
rename from pixmaps/Makefile.am
rename to data/icons/Makefile.am
diff --git a/pixmaps/baobab.svg b/data/icons/baobab.svg
similarity index 100%
rename from pixmaps/baobab.svg
rename to data/icons/baobab.svg
diff --git a/pixmaps/hicolor_apps_scalable_baobab-symbolic.svg
b/data/icons/hicolor/symbolic/apps/baobab-symbolic.svg
similarity index 100%
rename from pixmaps/hicolor_apps_scalable_baobab-symbolic.svg
rename to data/icons/hicolor/symbolic/apps/baobab-symbolic.svg
diff --git a/data/meson.build b/data/meson.build
new file mode 100644
index 0000000..c8c53a0
--- /dev/null
+++ b/data/meson.build
@@ -0,0 +1,31 @@
+icondir = join_paths(get_option('datadir'), 'icons/hicolor')
+foreach size: ['16x16', '22x22', '32x32', '48x48', '256x256', 'symbolic']
+ install_subdir('icons/hicolor/' + size, install_dir: icondir)
+endforeach
+
+install_man ('baobab.1')
+
+desktop_file = i18n.merge_file(
+ input: 'org.gnome.baobab.desktop.in',
+ output: 'org.gnome.baobab.desktop',
+ type: 'desktop',
+ po_dir: '../po',
+ install: true,
+ install_dir: join_paths(get_option('datadir'), 'applications'),
+)
+
+appdata_file = i18n.merge_file(
+ input: 'org.gnome.baobab.appdata.xml.in',
+ output: 'org.gnome.baobab.appdata.xml',
+ po_dir: '../po',
+ install: true,
+ install_dir: join_paths(get_option('datadir'), 'appdata'),
+)
+
+gschema_file = i18n.merge_file(
+ input: 'org.gnome.baobab.gschema.xml.in',
+ output: 'org.gnome.baobab.gschema.xml',
+ po_dir: '../po',
+ install: true,
+ install_dir: join_paths(get_option('datadir'), 'glib-2.0', 'schemas')
+)
diff --git a/data/org.gnome.baobab.desktop.in.in b/data/org.gnome.baobab.desktop.in
similarity index 80%
rename from data/org.gnome.baobab.desktop.in.in
rename to data/org.gnome.baobab.desktop.in
index 5623bf9..d5290c3 100644
--- a/data/org.gnome.baobab.desktop.in.in
+++ b/data/org.gnome.baobab.desktop.in
@@ -13,8 +13,4 @@ StartupNotify=true
MimeType=inode/directory;
Categories=GTK;GNOME;System;Filesystem;X-GNOME-Utilities;
NotShowIn=KDE;
-X-GNOME-Bugzilla-Bugzilla=GNOME
-X-GNOME-Bugzilla-Product=gnome-utils
-X-GNOME-Bugzilla-Component=baobab
-X-GNOME-Bugzilla-Version=@VERSION@
DBusActivatable=true
diff --git a/data/org.gnome.baobab.gschema.xml.in b/data/org.gnome.baobab.gschema.xml.in
index b966340..41c100f 100644
--- a/data/org.gnome.baobab.gschema.xml.in
+++ b/data/org.gnome.baobab.gschema.xml.in
@@ -1,4 +1,4 @@
-<schemalist gettext-domain="@GETTEXT_PACKAGE@">
+<schemalist gettext-domain="baobab">
<schema id="org.gnome.baobab" path="/org/gnome/baobab/">
<child name="preferences" schema="org.gnome.baobab.preferences"/>
<child name="ui" schema="org.gnome.baobab.ui"/>
diff --git a/help/meson.build b/help/meson.build
new file mode 100644
index 0000000..cfbdef8
--- /dev/null
+++ b/help/meson.build
@@ -0,0 +1,48 @@
+help_files = [
+ 'index.page',
+ 'introduction.page',
+ 'pref-view-chart.page',
+ 'problem-permissions.page',
+ 'problem-slow-scan.page',
+ 'question-open-folder.page',
+ 'question-trash.page',
+ 'scan-file-system.page',
+ 'scan-folder.page',
+ 'scan-home.page',
+ 'scan-remote.page',
+ 'legal.xml'
+]
+
+help_media = [
+ 'media/hicolor_apps_48x48_baobab.png'
+]
+
+help_linguas = [
+ 'ca',
+ 'cs',
+ 'da',
+ 'de',
+ 'el',
+ 'es',
+ 'fi',
+ 'fr',
+ 'gl',
+ 'hu',
+ 'id',
+ 'it',
+ 'ko',
+ 'pl',
+ 'pt',
+ 'pt_BR',
+ 'ru',
+ 'sl',
+ 'sv',
+ 'zh_CN'
+]
+
+gnome.yelp(
+ meson.project_name(),
+ sources: help_files,
+ media: help_media,
+ languages: help_linguas,
+)
diff --git a/meson.build b/meson.build
new file mode 100644
index 0000000..549c831
--- /dev/null
+++ b/meson.build
@@ -0,0 +1,34 @@
+project(
+ 'baobab', ['vala', 'c'],
+ version: '3.25.90',
+ license: 'GPL2+',
+ meson_version: '>= 0.41.0',
+)
+
+gnome = import('gnome')
+i18n = import('i18n')
+
+glib = dependency('glib-2.0', version: '>=2.44')
+gio = dependency('gio-2.0', version: '>=2.44')
+gio_unix = dependency('gio-unix-2.0', version: '>=2.44')
+gobject = dependency('gobject-2.0', version: '>=2.44')
+gtk = dependency('gtk+-3.0', version: '>=3.20')
+
+cc = meson.get_compiler('c')
+math = cc.find_library('m', required: false)
+
+conf = configuration_data()
+conf.set_quoted('PACKAGE_NAME', meson.project_name())
+conf.set_quoted('PACKAGE_VERSION', meson.project_version())
+conf.set_quoted('VERSION', meson.project_version())
+conf.set_quoted('GETTEXT_PACKAGE', meson.project_name())
+conf.set_quoted('GNOMELOCALEDIR', join_paths(get_option('prefix'), get_option('datadir'), '/locale'))
+configure_file(output: 'config.h', configuration: conf)
+config_h_dir = include_directories('.')
+
+meson.add_install_script(join_paths('build-aux', 'post-install.py'))
+
+subdir('data')
+subdir('help')
+subdir('po')
+subdir('src')
diff --git a/po/meson.build b/po/meson.build
new file mode 100644
index 0000000..fe664e1
--- /dev/null
+++ b/po/meson.build
@@ -0,0 +1,2 @@
+i18n.gettext(meson.project_name(), preset: 'glib')
+
diff --git a/src/meson.build b/src/meson.build
new file mode 100644
index 0000000..bd7977d
--- /dev/null
+++ b/src/meson.build
@@ -0,0 +1,57 @@
+resource_files = files('baobab.gresource.xml')
+resources = gnome.compile_resources('org.gnome.baobab', resource_files, c_name: 'resources')
+
+vapi_sources = [
+ 'config.vapi',
+]
+
+baobab_vala_sources = [
+ 'baobab-application.vala',
+ 'baobab-cellrenderers.vala',
+ 'baobab-chart.vala',
+ 'baobab-location-list.vala',
+ 'baobab-location.vala',
+ 'baobab-ringschart.vala',
+ 'baobab-scanner.vala',
+ 'baobab-treemap.vala',
+ 'baobab-window.vala',
+ 'main.vala'
+]
+
+baobab_sources = [
+ vapi_sources,
+ baobab_vala_sources,
+ resources
+]
+
+baobab_vala_args = [
+ '--target-glib', '2.44',
+ '--vapidir', meson.current_source_dir(),
+ '--gresources', resource_files,
+]
+
+baobab_c_args = [
+ '-include', 'config.h'
+]
+
+baobab_link_args = [
+ '-rdynamic'
+]
+
+baobab_dependencies = [
+ glib,
+ gio,
+ gio_unix,
+ gobject,
+ gtk,
+ math
+]
+
+executable('baobab', baobab_sources,
+ include_directories: config_h_dir,
+ vala_args: baobab_vala_args,
+ c_args: baobab_c_args,
+ dependencies: baobab_dependencies,
+ link_args: baobab_link_args,
+ install: true
+)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]