pidgin/purple-plugin-pack

Add preliminary top-level Meson file.
meson
2017-06-23, Elliott Sales de Andrade
c289a6fcb381
Parents bb7cb1e4e162
Children 8f9675f4aaf8
Add preliminary top-level Meson file.
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/meson.build Fri Jun 23 01:51:43 2017 -0400
@@ -0,0 +1,209 @@
+project('purple-plugin-pack', 'c',
+ version : '2.7.1dev')
+
+#######################################################################
+# Our header
+#######################################################################
+add_project_arguments('-DHAVE_CONFIG_H', language : 'c')
+conf = configuration_data()
+
+conf.set_quoted('PP_VERSION', meson.project_version())
+
+# I'm lazy and figured config.h is the best place for this ;)
+conf.set_quoted('PP_WEBSITE', 'https://bitbucket.org/pidgin/purple-plugin-pack')
+
+#######################################################################
+# Good ol' gettext
+#######################################################################
+#AC_PROG_INTLTOOL
+
+GETTEXT_PACKAGE = 'plugin_pack'
+conf.set_quoted('GETTEXT_PACKAGE', GETTEXT_PACKAGE)
+ALL_LINGUAS = 'de en_AU es_ES fr vi'.split()
+#AM_GLIB_GNU_GETTEXT
+
+#######################################################################
+# Look for the C compiler
+#######################################################################
+compiler = meson.get_compiler('c')
+
+enable_debug = get_option('debug')
+if enable_debug
+ conf.set('DEBUG', true)
+endif
+
+# this is used as the suffix below (for purple-3, pidgin-3, etc)
+# and also as the -3 param to plugin_pack.py
+if get_option('purple-version') == '2'
+ PURPLE_VER = ''
+else
+ PURPLE_VER = '-' + get_option('purple-version')
+endif
+
+#######################################################################
+# Check for purple
+#######################################################################
+PURPLE = dependency('purple@0@'.format(PURPLE_VER))
+
+
+PURPLE_LIBDIR = PURPLE.get_pkgconfig_variable('plugindir')
+PURPLE_DATADIR = PURPLE.get_pkgconfig_variable('datadir')
+
+# this is a hack but should work fine.
+# we use the libpurple datadir for PP_LOCALEDIR since we are not breaking up
+# the pot's yet, and need to make sure they goto the same place
+PP_LOCALEDIR = join_paths(PURPLE_DATADIR, 'locale')
+conf.set_quoted('PP_LOCALEDIR', PP_LOCALEDIR)
+
+#######################################################################
+# Check for pidgin
+#######################################################################
+PIDGIN = dependency('pidgin@0@'.format(PURPLE_VER), required : false)
+conf.set('HAVE_PIDGIN', PIDGIN.found())
+
+PIDGIN_LIBDIR = PIDGIN.get_pkgconfig_variable('plugindir')
+PIDGIN_DATADIR = PIDGIN.get_pkgconfig_variable('datadir')
+PIDGIN_PIXMAPSDIR = join_paths(PIDGIN_DATADIR, 'pixmaps/pidgin')
+
+#######################################################################
+# Check for finch
+#######################################################################
+FINCH = dependency('finch@0@'.format(PURPLE_VER), required : false)
+conf.set('HAVE_FINCH', FINCH.found())
+
+FINCH_LIBDIR = FINCH.get_pkgconfig_variable('libdir')
+FINCH_DATADIR = FINCH.get_pkgconfig_variable('datadir')
+
+#######################################################################
+# check for gtk
+#######################################################################
+GLIB = dependency('glib-2.0', required : true)
+GTK = dependency('gtk+-2.0', required : false)
+
+#######################################################################
+# check for gnt
+#######################################################################
+GNT = dependency('gnt', required : false)
+
+#######################################################################
+# check for pango
+#######################################################################
+PANGO = dependency('pango', required : false)
+
+#######################################################################
+# check for cairo
+#######################################################################
+CAIRO = dependency('cairo', required : false)
+
+#######################################################################
+# Check for talkfilters
+#######################################################################
+if compiler.has_header('talkfilters.h')
+ HAVE_TALKFILTERS = true
+else
+ message('''
+*** GNU Talk Filters is required to build the talkfilters plugin;
+*** please make sure you have the GNU Talk Filters development headers installed.
+*** The latest version of GNU Talk Filters is available at
+*** http://www.hyperrealm.com/talkfilters/talkfilters.html.''')
+ HAVE_TALKFILTERS = false
+endif
+if HAVE_TALKFILTERS
+ # work out that the library exists
+ TALKFILTERS = compiler.find_library('talkfilters')
+endif
+
+#######################################################################
+# Check for libjson-glib
+#######################################################################
+JSON_GLIB = dependency('json-glib-1.0', required : false)
+
+#######################################################################
+# Check for switchspell
+#######################################################################
+GTKSPELL = dependency('gtkspell-2.0', version : '>= 2.0.2', required : false)
+
+BUILD_SWITCH_SPELL = false
+
+if false and GTKSPELL.found()
+ #$PKG_CONFIG --static --libs gtkspell-2.0 | grep -q enchant
+ if ok
+ ENCHANT = dependency('enchant', required : false)
+ BUILD_SWITCH_SPELL = ENCHANT.found()
+
+ conf.set('HAVE_ENCHANT', ENCHANT.found())
+ else
+ if compiler.has_header('aspell.h')
+ ASPELL = compiler.find_library('aspell')
+ BUILD_SWITCH_SPELL = ASPELL.found()
+ endif
+ endif
+endif
+
+#######################################################################
+# Check for some basic headers
+#######################################################################
+if compiler.has_header('regex.h')
+ conf.set('HAS_REGEX_H', true)
+else
+ error('regex.h cannot be found')
+endif
+
+#######################################################################
+# Disable installation of translation files
+#######################################################################
+INSTALL_I18N = get_option('nls')
+
+#######################################################################
+# plugin_pack.py has already done our heavy lifting from the boot
+# strap. So we'll include our config file it created and call it to
+# determine our build directories
+#######################################################################
+#AC_PATH_PROG([PYTHON], [python], [no])
+
+# include the config file we created during bootstrapping
+#m4_include([plugin_pack.m4])
+
+#######################################################################
+# Output!!
+#######################################################################
+configure_file(
+ output : 'pp_config.h',
+ configuration : conf)
+
+message('')
+message('@0@ @1@ Configuration complete'.format(meson.project_name(), meson.project_version()))
+message('')
+message('Debugging enabled................: ' + enable_debug.to_string())
+message('')
+
+message('Build purple plugins.............: ' + PURPLE.found().to_string())
+if PURPLE.found()
+ message('Installing purple plugins to.....: ' + PURPLE_LIBDIR)
+ message('Installing purple plugin data to.: ' + PURPLE_DATADIR)
+ message('Purple plugins to be built.......:')
+ #message(PP_PURPLE_BUILD)
+endif
+message('')
+
+message('Build pidgin plugins.............: ' + PIDGIN.found().to_string())
+if PIDGIN.found()
+ message('Installing pidgin plugins to.....: ' + PIDGIN_LIBDIR)
+ message('Installing pidgin plugin data to.: ' + PIDGIN_DATADIR)
+ message('Pidgin plugins to be built.......:')
+ #message(PP_PIDGIN_BUILD)
+endif
+message('')
+
+message('Build finch plugins..............: ' + FINCH.found().to_string())
+if FINCH.found()
+ message('Installing finch plugins to......: ' + FINCH_LIBDIR)
+ message('Installing finch plugin data to..: ' + FINCH_DATADIR)
+ message('Finch plugins to be built........: none - THIS IS NORMAL')
+ # uncomment this when we have finch plugins
+ # message(PP_FINCH_BUILD)
+endif
+message('')
+
+message('Type make to compile')
+message('')
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/meson_options.txt Fri Jun 23 01:51:43 2017 -0400
@@ -0,0 +1,8 @@
+option('purple-version', type : 'combo', choices : ['2', '3'], default : '2',
+ description : 'set to 3 to compile against libpurple3')
+
+option('debug', type : 'boolean', default : false,
+ description : 'compile with debugging support')
+
+option('nls', type : 'boolean', default : true,
+ description : 'enable installation of translation files')