From ae51b769019ea5e4c32ec6e386f3d2183562c1cb Mon Sep 17 00:00:00 2001 From: Logan Rathbone Date: Tue, 8 Jun 2021 22:55:49 -0400 Subject: Port build system from autotools to meson. --- src/Makefile.am | 57 --------------------------------------------------------- src/main.c | 2 +- src/meson.build | 51 +++++++++++++++++++++++++++++++++++++++++++++++++++ src/zenity.h | 10 ---------- 4 files changed, 52 insertions(+), 68 deletions(-) delete mode 100644 src/Makefile.am create mode 100644 src/meson.build (limited to 'src') diff --git a/src/Makefile.am b/src/Makefile.am deleted file mode 100644 index bcdd2056..00000000 --- a/src/Makefile.am +++ /dev/null @@ -1,57 +0,0 @@ -bin_PROGRAMS = zenity - -bin_SCRIPTS = gdialog - -zenity_SOURCES = \ - about.c \ - calendar.c \ - entry.c \ - fileselection.c \ - main.c \ - msg.c \ - notification.c \ - option.c \ - option.h \ - progress.c \ - scale.c \ - text.c \ - tree.c \ - color.c \ - password.c \ - util.c \ - util.h \ - forms.c \ - zenity.h - -zenity_CPPFLAGS = \ - -DGNOMELOCALEDIR=\""$(datadir)/locale"\" \ - -DZENITY_DATADIR=\""$(pkgdatadir)"\" \ - $(AM_CPPFLAGS) - -zenity_CFLAGS = \ - $(ZENITY_CFLAGS) \ - $(LIBNOTIFY_CFLAGS) \ - $(WEBKIT_CFLAGS) \ - $(WARN_CFLAGS) \ - $(AM_CFLAGS) - -zenity_LDFLAGS = \ - $(AM_LDFLAGS) - -zenity_LDADD = \ - $(ZENITY_LIBS) \ - $(LIBNOTIFY_LIBS) \ - $(WEBKIT_LIBS) - -uidir = $(datadir)/zenity - -ui_DATA = \ - zenity.ui - -DISTCLEANFILES= \ - gdialog - -EXTRA_DIST = \ - $(ui_DATA) \ - gdialog \ - gdialog.in diff --git a/src/main.c b/src/main.c index 7f0c2db7..18b2a725 100644 --- a/src/main.c +++ b/src/main.c @@ -43,7 +43,7 @@ main (gint argc, gchar **argv) { setlocale (LC_ALL, ""); #endif - bindtextdomain (GETTEXT_PACKAGE, GNOMELOCALEDIR); + bindtextdomain (GETTEXT_PACKAGE, LOCALEDIR); bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8"); textdomain (GETTEXT_PACKAGE); diff --git a/src/meson.build b/src/meson.build new file mode 100644 index 00000000..748fe316 --- /dev/null +++ b/src/meson.build @@ -0,0 +1,51 @@ +# 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, + webkitgtk, + x11 +] + +zenity_c_args = [ + '-DG_LOG_DOMAIN="Zenity"' +] + +zenity = executable( + meson.project_name(), + zenity_sources, + include_directories: zenity_root_dir, + dependencies: zenity_deps, + c_args: zenity_c_args, + install: true +) + +if perl.found() + configure_file( + input: 'gdialog.in', + output: 'gdialog', + configuration: zenity_conf, + install_dir: zenity_bindir, + install: true + ) +endif + +install_data('zenity.ui') diff --git a/src/zenity.h b/src/zenity.h index b86a264d..404eec77 100644 --- a/src/zenity.h +++ b/src/zenity.h @@ -5,7 +5,6 @@ G_BEGIN_DECLS -#ifdef ENABLE_NLS #include #define _(String) dgettext (GETTEXT_PACKAGE, String) #ifdef gettext_noop @@ -13,15 +12,6 @@ G_BEGIN_DECLS #else #define N_(String) (String) #endif -#else /* NLS is disabled */ -#define _(String) (String) -#define N_(String) (String) -#define textdomain(String) (String) -#define gettext(String) (String) -#define dgettext(Domain, String) (String) -#define dcgettext(Domain, String, Type) (String) -#define bindtextdomain(Domain, Directory) (Domain) -#endif typedef struct { gchar *dialog_title; -- cgit From 8d343b714fa4c0aeaa7e639892159aa0d619f124 Mon Sep 17 00:00:00 2001 From: Logan Rathbone Date: Mon, 28 Jun 2021 23:17:46 -0400 Subject: meson: bump gtk req. Suppress compiler warning. --- src/text.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src') diff --git a/src/text.c b/src/text.c index ffe7b35e..bbfa4212 100644 --- a/src/text.c +++ b/src/text.c @@ -289,11 +289,13 @@ zenity_text (ZenityData *data, ZenityTextData *text_data) { if (text_data->no_wrap) gtk_text_view_set_wrap_mode (GTK_TEXT_VIEW (text_view), GTK_WRAP_NONE); +G_GNUC_BEGIN_IGNORE_DEPRECATIONS if (text_data->font) { PangoFontDescription *fontDesc = pango_font_description_from_string (text_data->font); gtk_widget_override_font (GTK_WIDGET (text_view), fontDesc); } +G_GNUC_END_IGNORE_DEPRECATIONS if (text_data->uri) zenity_util_fill_file_buffer (text_buffer, text_data->uri); -- cgit