diff options
author | Logan Rathbone <poprocks@gmail.com> | 2021-02-13 23:19:03 -0500 |
---|---|---|
committer | Logan Rathbone <poprocks@gmail.com> | 2021-02-13 23:19:03 -0500 |
commit | 71744aa4b388754b20bbcdbf7dabf482202fee79 (patch) | |
tree | fed6f5227c30da84b18b184f219efd1d6bfaad0f | |
parent | 6b6ef217972a2776b46406ad421f4ade432c1574 (diff) | |
download | zenity-71744aa4b388754b20bbcdbf7dabf482202fee79.tar.gz |
Start migrating to meson.
-rw-r--r-- | meson.build | 80 | ||||
-rw-r--r-- | meson_options.txt | 6 | ||||
-rw-r--r-- | src/meson.build | 43 | ||||
-rw-r--r-- | src/option.c | 2 | ||||
-rw-r--r-- | src/option.h | 6 | ||||
-rw-r--r-- | src/zenity.h | 8 |
6 files changed, 139 insertions, 6 deletions
diff --git a/meson.build b/meson.build new file mode 100644 index 0000000..9798bc4 --- /dev/null +++ b/meson.build @@ -0,0 +1,80 @@ +project('zenity', 'c', + version: '4.alpha.1', + meson_version: '>=0.50.0', + license: 'LGPL-2.0-or-later' +) + +version_arr = meson.project_version().split('.') +zenity_version_major = version_arr[0].to_int() +zenity_version_minor = version_arr[1] +zenity_version_micro = version_arr[2].to_int() + +zenity_prefix = get_option('prefix') +zenity_libdir = join_paths(zenity_prefix, get_option('libdir')) +zenity_includedir = join_paths(zenity_prefix, get_option('includedir')) +zenity_datadir = join_paths(zenity_prefix, get_option('datadir')) +zenity_localedir = join_paths(zenity_prefix, get_option('localedir')) +zenity_appdatadir = join_paths(zenity_datadir, 'metainfo') +zenity_iconsdir = join_paths(zenity_datadir, 'icons') + +zenity_root_dir = include_directories('.') +zenity_po_dir = join_paths(meson.source_root(), 'po') + +gnome = import('gnome') +i18n = import('i18n') + +cc = meson.get_compiler('c') + +zenity_conf = configuration_data() +zenity_conf.set_quoted('PACKAGE_NAME', meson.project_name()) +zenity_conf.set_quoted('PACKAGE_VERSION', meson.project_version()) +zenity_conf.set_quoted('PACKAGE_STRING', + '@0@ @1@'.format(meson.project_name(), meson.project_version())) +zenity_conf.set_quoted('PACKAGE_DATADIR', zenity_datadir) +zenity_conf.set_quoted('PACKAGE_LIBDIR', zenity_libdir) +zenity_conf.set_quoted('PACKAGE_LOCALE_DIR', zenity_localedir) + +zenity_conf.set('VERSION', 'PACKAGE_VERSION') +zenity_conf.set('GETTEXT_PACKAGE', 'PACKAGE_NAME') +zenity_conf.set('LOCALEDIR', 'PACKAGE_LOCALE_DIR') + +zenity_conf.set('DEBUG', get_option('debug')) + +check_headers = [ + 'sys/types.h', + 'unistd.h', + 'langinfo.h', + 'locale.h' +] + +foreach h : check_headers + cc.has_header(h, required: true) +endforeach + +gtk_dep = dependency('gtk4', version: '>= 4.0.0') + +if get_option('libnotify') + libnotify = dependency('libnotify', version: '>= 0.6.1') + zenity_conf.set('HAVE_LIBNOTIFY', true) +endif + +# TODO +#if get_option('webkitgtk') +# webkitgtk = dependency('webkit2gtk-4.0', version: '>= 2.8.1') +# zenity_conf.set('HAVE_WEBKITGTK', true) +#endif + +configure_file( + output: 'config.h', + configuration: zenity_conf +) + +update_icon_cache_prg = find_program('gtk-update-icon-cache', + required : false) + +perl = find_program('perl', required: true) + +subdir('src') +#subdir('data') +#subdir('po') +#subdir('help') diff --git a/meson_options.txt b/meson_options.txt new file mode 100644 index 0000000..d976e86 --- /dev/null +++ b/meson_options.txt @@ -0,0 +1,6 @@ +option('libnotify', type : 'boolean', value : true, + description : 'enable libnotify for desktop notification support') + +#TODO +#option('webkitgtk', type : 'boolean', value : true, +# description : 'enable webkitgtk support') diff --git a/src/meson.build b/src/meson.build new file mode 100644 index 0000000..374e79a --- /dev/null +++ b/src/meson.build @@ -0,0 +1,43 @@ +# for i in `ls *.c`; do echo " '${i}',"; done +zenity_sources = [ + 'about.c', + 'calendar.c', + 'color.c', + 'entry.c', + 'fileselection.c', + 'forms.c', + 'main.c', + 'msg.c', + 'notification.c', + 'option.c', + 'password.c', + 'progress.c', + 'scale.c', + 'text.c', + 'tree.c', + 'util.c' +] + +zenity_deps = [ + gtk_dep, + libnotify +] + +zenity_res = gnome.compile_resources( + 'zenity-resources', + 'zenity.gresource.xml', + c_name: 'zenity' +) + +zenity_c_args = [ + '-DG_LOG_DOMAIN="Zenity"' +] + +zenity = executable( + meson.project_name(), + zenity_sources + zenity_res, + include_directories: zenity_root_dir, + dependencies: zenity_deps, + c_args: zenity_c_args, + install: true +) diff --git a/src/option.c b/src/option.c index 1b67fad..ff78e69 100644 --- a/src/option.c +++ b/src/option.c @@ -28,6 +28,8 @@ #include <stdlib.h> #include <string.h> #include <time.h> +#include <locale.h> +#include <langinfo.h> #include <config.h> diff --git a/src/option.h b/src/option.h index ab76f1e..475f9ae 100644 --- a/src/option.h +++ b/src/option.h @@ -25,11 +25,9 @@ #define OPTION_H #include "zenity.h" + #include <glib.h> -#include <langinfo.h> -#ifdef HAVE_LOCALE_H -#include <locale.h> -#endif +#include <config.h> typedef enum { MODE_CALENDAR, diff --git a/src/zenity.h b/src/zenity.h index a7b59d9..449d022 100644 --- a/src/zenity.h +++ b/src/zenity.h @@ -1,9 +1,13 @@ +/* vim: colorcolumn=80 ts=4 sw=4 + */ #ifndef ZENITY_H #define ZENITY_H #include <gtk/gtk.h> #include <glib/gi18n.h> +#include <config.h> + G_BEGIN_DECLS typedef struct { @@ -176,8 +180,8 @@ void zenity_progress (ZenityData *data, ZenityProgressData *progress_data); void zenity_text (ZenityData *data, ZenityTextData *text_data); void zenity_tree (ZenityData *data, ZenityTreeData *tree_data); #ifdef HAVE_LIBNOTIFY -void zenity_notification ( - ZenityData *data, ZenityNotificationData *notification_data); +void zenity_notification (ZenityData *data, + ZenityNotificationData *notification_data); #endif void zenity_colorselection ( |