[gnome-usage] Ported to meson. Updated .desktop file. Updated .doap file.
- From: Petr Štětka <pstetka src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-usage] Ported to meson. Updated .desktop file. Updated .doap file.
- Date: Mon, 13 Mar 2017 14:35:19 +0000 (UTC)
commit 6e972c4929bc55361b797ce2a13ddd86364c8a07
Author: Petr Štětka <pstetka redhat com>
Date: Mon Mar 13 15:20:20 2017 +0100
Ported to meson.
Updated .desktop file.
Updated .doap file.
README.md | 13 +-
data/meson.build | 9 ++
data/org.gnome.Usage.desktop | 2 +-
...gresource.xml => org.gnome.Usage.gresource.xml} | 0
external/egg/Makefile.am | 151 --------------------
external/egg/egg.cmake | 68 ---------
external/egg/meson.build | 66 +++++++++
external/meson.build | 2 +
external/rg/Makefile.am | 43 ------
external/rg/meson.build | 27 ++++
external/rg/rg.cmake | 28 ----
gnome-usage.avprj | 135 -----------------
gnome-usage.doap | 2 +-
meson.build | 16 ++
po/meson.build | 4 +
src/application.vala | 2 +-
src/gnome-usage.vala | 6 +-
src/meson.build | 69 +++++++++
src/vapis/config.vapi | 7 +
src/vapis/{glibtop.vapi => libgtop-2.0.vapi} | 0
20 files changed, 212 insertions(+), 438 deletions(-)
---
diff --git a/README.md b/README.md
index 7aedc32..6d502b7 100644
--- a/README.md
+++ b/README.md
@@ -20,19 +20,18 @@ New GNOME Usage!
In terminal run ```gnome-usage``` command or run GNOME Usage application from app launcher.
##Version
-Actual version is 0.3.8
+Actual version is 0.4.0
##Dependencies
-- libnetinfo >= 0.3.1
+- [libnetinfo >= 0.3.1](https://github.com/kaegi/netinfo-ffi)
- libgtop >= 2.34.2
##Compilation from sources:
```
-autovala update
-mkdir build && cd build
-cmake ..
-make
-sudo make install
+cd gnome-usage
+meson build && cd build
+ninja-build #or ninja
+sudo ninja-build install #sudo ninja install
sudo setcap cap_net_raw,cap_net_admin=eip /usr/local/bin/gnome-usage
```
diff --git a/data/meson.build b/data/meson.build
new file mode 100644
index 0000000..f21cffc
--- /dev/null
+++ b/data/meson.build
@@ -0,0 +1,9 @@
+gnome_module = import('gnome')
+
+resources = gnome_module.compile_resources('org.gnome.Usage',
+ 'org.gnome.Usage.gresource.xml',
+ source_dir: '.',
+ c_name: 'resources')
+
+install_data('org.gnome.Usage.gschema.xml', install_dir : get_option('datadir') + '/glib-2.0/schemas/')
+install_data('org.gnome.Usage.desktop', install_dir : get_option('datadir') + '/applications')
diff --git a/data/org.gnome.Usage.desktop b/data/org.gnome.Usage.desktop
index 4745dff..8646851 100644
--- a/data/org.gnome.Usage.desktop
+++ b/data/org.gnome.Usage.desktop
@@ -1,6 +1,6 @@
[Desktop Entry]
Name=Usage
-Comment=View current application and monitor system state
+Comment=A nice way to view information about use of system resources, like memory and disk space
Categories=GNOME;GTK;
Exec=gnome-usage
# Translators: Do NOT translate or transliterate this text (this is an icon file name)!
diff --git a/data/usage.gresource.xml b/data/org.gnome.Usage.gresource.xml
similarity index 100%
rename from data/usage.gresource.xml
rename to data/org.gnome.Usage.gresource.xml
diff --git a/external/egg/meson.build b/external/egg/meson.build
new file mode 100644
index 0000000..33fda54
--- /dev/null
+++ b/external/egg/meson.build
@@ -0,0 +1,66 @@
+sources = [
+ 'egg-animation.h',
+ 'egg-binding-group.h',
+ 'egg-box.h',
+ 'egg-centering-bin.h',
+ 'egg-column-layout.h',
+ 'egg-counter.h',
+ 'egg-date-time.h',
+ 'egg-empty-state.h',
+ 'egg-entry-box.h',
+ 'egg-file-chooser-entry.h',
+ 'egg-frame-source.h',
+ 'egg-heap.h',
+ 'egg-list-box.h',
+ 'egg-menu-manager.h',
+ 'egg-pill-box.h',
+ 'egg-priority-box.h',
+ 'egg-private.h',
+ 'egg-radio-box.h',
+ 'egg-scrolled-window.h',
+ 'egg-search-bar.h',
+ 'egg-settings-flag-action.h',
+ 'egg-settings-sandwich.h',
+ 'egg-signal-group.h',
+ 'egg-simple-label.h',
+ 'egg-simple-popover.h',
+ 'egg-slider.h',
+ 'egg-state-machine-buildable.h',
+ 'egg-state-machine.h',
+ 'egg-task-cache.h',
+ 'egg-three-grid.h',
+ 'egg-widget-action-group.h',
+ 'egg-animation.c',
+ 'egg-binding-group.c',
+ 'egg-box.c',
+ 'egg-centering-bin.c',
+ 'egg-column-layout.c',
+ 'egg-counter.c',
+ 'egg-date-time.c',
+ 'egg-empty-state.c',
+ 'egg-entry-box.c',
+ 'egg-file-chooser-entry.c',
+ 'egg-frame-source.c',
+ 'egg-heap.c',
+ 'egg-list-box.c',
+ 'egg-menu-manager.c',
+ 'egg-pill-box.c',
+ 'egg-priority-box.c',
+ 'egg-radio-box.c',
+ 'egg-scrolled-window.c',
+ 'egg-search-bar.c',
+ 'egg-settings-flag-action.c',
+ 'egg-settings-sandwich.c',
+ 'egg-signal-group.c',
+ 'egg-simple-label.c',
+ 'egg-simple-popover.c',
+ 'egg-slider.c',
+ 'egg-state-machine-buildable.c',
+ 'egg-state-machine.c',
+ 'egg-task-cache.c',
+ 'egg-three-grid.c',
+ 'egg-widget-action-group.c']
+
+egg_lib = static_library( 'egg', sources, dependencies : [glib, gobject, gio, gtk], install : false)
+
+egg = declare_dependency(link_with : egg_lib, include_directories : include_directories('.'))
diff --git a/external/meson.build b/external/meson.build
new file mode 100644
index 0000000..393d634
--- /dev/null
+++ b/external/meson.build
@@ -0,0 +1,2 @@
+subdir('egg')
+subdir('rg')
diff --git a/external/rg/meson.build b/external/rg/meson.build
new file mode 100644
index 0000000..738e302
--- /dev/null
+++ b/external/rg/meson.build
@@ -0,0 +1,27 @@
+sources = [
+ 'realtime-graphs.h',
+ 'rg-column.c',
+ 'rg-column.h',
+ 'rg-column-private.h',
+ 'rg-cpu-graph.c',
+ 'rg-cpu-graph.h',
+ 'rg-cpu-table.c',
+ 'rg-cpu-table.h',
+ 'rg-graph.c',
+ 'rg-graph.h',
+ 'rg-line-renderer.c',
+ 'rg-line-renderer.h',
+ 'rg-stacked-renderer.c',
+ 'rg-stacked-renderer.h',
+ 'rg-renderer.c',
+ 'rg-renderer.h',
+ 'rg-ring.c',
+ 'rg-ring.h',
+ 'rg-table.c',
+ 'rg-table.h']
+
+rg_lib = static_library( 'rg', sources, dependencies : [glib, gobject, gio, gtk],
+ include_directories : include_directories('../egg'), install : false)
+
+rg = declare_dependency(link_with : rg_lib,
+ include_directories : include_directories('.'))
diff --git a/gnome-usage.doap b/gnome-usage.doap
index abbbfe5..f8d3171 100644
--- a/gnome-usage.doap
+++ b/gnome-usage.doap
@@ -12,8 +12,8 @@
<homepage rdf:resource="https://wiki.gnome.org/Apps/Usage" />
<!--
<download-page rdf:resource="https://download.gnome.org/sources/epiphany/" />
- <bug-database rdf:resource="https://bugzilla.gnome.org/browse.cgi?product=epiphany" />
-->
+ <bug-database rdf:resource="https://bugzilla.gnome.org/browse.cgi?product=gnome-usage" />
<maintainer>
<foaf:Person>
<foaf:name>Petr Štětka</foaf:name>
diff --git a/meson.build b/meson.build
new file mode 100644
index 0000000..542f699
--- /dev/null
+++ b/meson.build
@@ -0,0 +1,16 @@
+project('gnome-usage', ['vala', 'c'], version : '0.4.0')
+
+cc = meson.get_compiler('c')
+
+glib = dependency('glib-2.0')
+gobject = dependency('gobject-2.0')
+gio = dependency('gio-2.0')
+gtk = dependency('gtk+-3.0')
+gtop = dependency('libgtop-2.0', version : '>=2.34.2')
+netinfo = cc.find_library('netinfo')
+math = cc.find_library('m')
+
+subdir('data')
+subdir('po')
+subdir('external')
+subdir('src')
diff --git a/po/meson.build b/po/meson.build
new file mode 100644
index 0000000..fc48afb
--- /dev/null
+++ b/po/meson.build
@@ -0,0 +1,4 @@
+langs = [ 'de', 'es', 'fi', 'fur', 'pl', 'pt_BR', 'sk', 'sr', 'sv' ]
+
+i18n = import('i18n')
+i18n.gettext('gnome-usage', languages : langs)
diff --git a/src/application.vala b/src/application.vala
index 97d8583..2639a60 100644
--- a/src/application.vala
+++ b/src/application.vala
@@ -78,7 +78,7 @@ namespace Usage
authors: authors,
website: "https://wiki.gnome.org/Apps/Usage",
website_label: _("Websites"),
- version: Constants.VERSION,
+ version: Config.VERSION,
license_type: License.GPL_3_0);
}
diff --git a/src/gnome-usage.vala b/src/gnome-usage.vala
index b42a582..81381ff 100644
--- a/src/gnome-usage.vala
+++ b/src/gnome-usage.vala
@@ -1,9 +1,9 @@
public static int main (string[] args)
{
- Intl.bindtextdomain(Constants.GETTEXT_PACKAGE, Path.build_filename(Constants.DATADIR,"locale"));
+ Intl.bindtextdomain(Config.GETTEXT_PACKAGE, Config.GNOMELOCALEDIR);
Intl.setlocale(LocaleCategory.ALL, "");
- Intl.textdomain(Constants.GETTEXT_PACKAGE);
- Intl.bind_textdomain_codeset(Constants.GETTEXT_PACKAGE, "utf-8");
+ Intl.textdomain(Config.GETTEXT_PACKAGE);
+ Intl.bind_textdomain_codeset(Config.GETTEXT_PACKAGE, "utf-8");
var application = new Usage.Application();
return application.run(args);
diff --git a/src/meson.build b/src/meson.build
new file mode 100644
index 0000000..b1639bf
--- /dev/null
+++ b/src/meson.build
@@ -0,0 +1,69 @@
+vala_sources = [
+ 'application.vala',
+ 'color-rectangle.vala',
+ 'cpu-graph-table.vala',
+ 'cpu-graph.vala',
+ 'cpu-monitor.vala',
+ 'cpu-sub-view.vala',
+ 'data-view.vala',
+ 'disk-graph.vala',
+ 'disk-sub-view.vala',
+ 'gnome-usage.vala',
+ 'graph-block-row.vala',
+ 'graph-block.vala',
+ 'graph-box.vala',
+ 'graph-stack-switcher.vala',
+ 'graph-switcher-button.vala',
+ 'header-bar.vala',
+ 'memory-graph-table.vala',
+ 'memory-graph.vala',
+ 'memory-monitor.vala',
+ 'memory-sub-view.vala',
+ 'network-graph-table.vala',
+ 'network-graph.vala',
+ 'network-monitor.vala',
+ 'network-sub-view.vala',
+ 'performance-view.vala',
+ 'pie-chart.vala',
+ 'power-view.vala',
+ 'process-dialog.vala',
+ 'process-list-box.vala',
+ 'process-row.vala',
+ 'process.vala',
+ 'settings.vala',
+ 'storage-analyzer.vala',
+ 'storage-graph.vala',
+ 'storage-item.vala',
+ 'storage-list-box.vala',
+ 'storage-row.vala',
+ 'storage-view.vala',
+ 'storage-worker.vala',
+ 'sub-process-list-box.vala',
+ 'sub-process-sub-row.vala',
+ 'system-monitor.vala',
+ 'utils.vala',
+ 'view.vala',
+ 'window.vala',
+ 'better-box.c']
+
+vala_args = [
+ '--target-glib=2.38',
+ '--gresources=../data/org.gnome.Usage.gresource.xml',
+ '--pkg=rg',
+ '--pkg=egg',
+ '--pkg=better',
+ '--pkg=netinfo',
+ '--pkg=libgtop-2.0',
+ '--pkg=config',
+ '--pkg=posix',
+ '--vapidir=' + meson.current_source_dir() + '/vapis']
+
+usage = executable('gnome-usage',
+ vala_sources,
+ resources,
+ c_args : [ '-DVERSION="' + meson.project_version() + '"',
'-DGETTEXT_PACKAGE="gnome-usage"', '-DGNOMELOCALEDIR="' + get_option('prefix') + '/' +
get_option('localedir') + '"' ],
+ include_directories : include_directories('/usr/include/libgtop-2.0'),
+ vala_args: vala_args,
+ install: true,
+ dependencies : [glib, gobject, gio, gtk, rg, egg, math, gtop, netinfo])
+
diff --git a/src/vapis/config.vapi b/src/vapis/config.vapi
new file mode 100644
index 0000000..0e4fffe
--- /dev/null
+++ b/src/vapis/config.vapi
@@ -0,0 +1,7 @@
+[CCode (cprefix = "", lower_case_cprefix = "")]
+namespace Config {
+ public const string VERSION;
+ public const string GETTEXT_PACKAGE;
+ public const string GNOMELOCALEDIR;
+}
+
diff --git a/src/vapis/glibtop.vapi b/src/vapis/libgtop-2.0.vapi
similarity index 100%
rename from src/vapis/glibtop.vapi
rename to src/vapis/libgtop-2.0.vapi
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]