From 6ded48c4b455c776f82d848fe919e87182c67e85 Mon Sep 17 00:00:00 2001 From: Michael Vetter Date: Thu, 21 Oct 2021 21:40:30 +0200 Subject: [PATCH] meson: add basic meson build files Can only build minimal profanity without optional dependencies yet. Not all functionality from autoconf is in here yet. --- meson.build | 72 ++++++++++++++++++++++++++++++++++++++++++++++ src/meson.build | 76 +++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 148 insertions(+) create mode 100644 meson.build create mode 100644 src/meson.build diff --git a/meson.build b/meson.build new file mode 100644 index 00000000..59f4cca2 --- /dev/null +++ b/meson.build @@ -0,0 +1,72 @@ +project('profanity', + 'c', + license: 'GPL3+', + default_options: ['c_std=gnu99'], + version: '0.12.0', + meson_version: '>= 0.54.0') + + +cc = meson.get_compiler('c') +conf = configuration_data() + + +# general dependencies +glib_dep = dependency('glib-2.0', version: '>= 2.62.0') +gio_dep = dependency('gio-2.0') +curl_dep = dependency('libcurl', version: '>= 7.62.0') +sqlite_dep = dependency('sqlite3', version: '>= 3.22.0') +thread_dep = dependency('threads') # pthread +thread_dep = dependency('readline') +m_dep = cc.find_library('m', required : true) + + +# this will detect ncursesw etc (-I / -l flags) +curses_dep = dependency('curses', required: false) +# get ncurses definitions +check_headers = [ + ['ncursesw/menu.h', 'HAVE_NCURSESW_MENU_H'], + ['ncurses/menu.h', 'HAVE_NCURSES_MENU_H'], + ['menu.h', 'HAVE_MENU_H'], + ['ncursesw/curses.h', 'HAVE_NCURSESW_CURSES_H'], + ['ncursesw.h', 'HAVE_NCURSESW_H'], + ['ncurses/curses.h', 'HAVE_NCURSES_CURSES_H'], + ['ncurses.h', 'HAVE_NCURSES_H'], + ['curses.h', 'HAVE_CURSES_H'], +] + +foreach h : check_headers + if cc.has_header(h.get(0)) + conf.set(h.get(1), 1) + endif +endforeach + + +libstrophe_dep = dependency('libstrophe', version: '>= 0.10.0') +conf.set('HAVE_LIBSTROPHE', 1) + + +conf.set_quoted('PACKAGE_VERSION', meson.project_version()) +conf.set_quoted('PACKAGE_STATUS', 'development') +# TODO: PROF_GIT_BRANCH, PROF_GIT_REVISION, PACKAGE_STATUS, + +# change later: +conf.set_quoted('GLOBAL_PYTHON_PLUGINS_PATH', '') +conf.set_quoted('GLOBAL_C_PLUGINS_PATH', '') + + +config_h = configure_file(output : 'config.h', configuration : conf) + +subdir('src') + +profanity = executable('profanity', + core_sources_c, + dependencies : [ glib_dep, + gio_dep, + curl_dep, + sqlite_dep, + thread_dep, + m_dep, + curses_dep, + libstrophe_dep ], + include_directories : incdir, + install : true) diff --git a/src/meson.build b/src/meson.build new file mode 100644 index 00000000..c2ff132a --- /dev/null +++ b/src/meson.build @@ -0,0 +1,76 @@ +core_sources_c = [ 'src/main.c', + 'src/profanity.c', + 'src/log.c', + 'src/common.c', + 'src/database.c', + 'src/xmpp/contact.c', + 'src/xmpp/stanza.c', + 'src/xmpp/chat_session.c', + 'src/xmpp/muc.c', + 'src/xmpp/jid.c', + 'src/xmpp/chat_state.c', + 'src/xmpp/resource.c', + 'src/xmpp/roster_list.c', + 'src/xmpp/capabilities.c', + 'src/xmpp/session.c', + 'src/xmpp/connection.c', + 'src/xmpp/iq.c', + 'src/xmpp/message.c', + 'src/xmpp/presence.c', + 'src/xmpp/roster.c', + 'src/xmpp/bookmark.c', + 'src/xmpp/blocking.c', + 'src/xmpp/form.c', + 'src/xmpp/avatar.c', + 'src/xmpp/ox.c', + 'src/event/common.c', + 'src/event/client_events.c', + 'src/event/server_events.c', + 'src/ui/window.c', + 'src/ui/core.c', + 'src/ui/console.c', + 'src/ui/titlebar.c', + 'src/ui/statusbar.c', + 'src/ui/inputwin.c', + 'src/ui/screen.c', + 'src/ui/notifier.c', + 'src/ui/window_list.c', + 'src/ui/occupantswin.c', + 'src/ui/rosterwin.c', + 'src/ui/chatwin.c', + 'src/ui/mucwin.c', + 'src/ui/privwin.c', + 'src/ui/confwin.c', + 'src/ui/xmlwin.c', + 'src/ui/buffer.c', + 'src/ui/tray.c', + 'src/command/cmd_defs.c', + 'src/command/cmd_funcs.c', + 'src/command/cmd_ac.c', + 'src/tools/parser.c', + 'src/tools/http_common.c', + 'src/tools/http_upload.c', + 'src/tools/http_download.c', + 'src/tools/bookmark_ignore.c', + 'src/tools/autocomplete.c', + 'src/tools/clipboard.c', + 'src/config/files.c', + 'src/config/conflists.c', + 'src/config/account.c', + 'src/config/accounts.c', + 'src/config/tlscerts.c', + 'src/config/preferences.c', + 'src/config/theme.c', + 'src/config/color.c', + 'src/config/scripts.c', + 'src/plugins/plugins.c', + 'src/plugins/api.c', + 'src/plugins/callbacks.c', + 'src/plugins/autocompleters.c', + 'src/plugins/themes.c', + 'src/plugins/settings.c', + 'src/plugins/disco.c', + config_h +] + +incdir = include_directories('.', 'command', 'config', 'ui', 'plugins', 'xmpp')