Update meson build to match autotools. meson

Sun, 18 Dec 2016 21:04:55 -0500

author
Elliott Sales de Andrade <qulogic@pidgin.im>
date
Sun, 18 Dec 2016 21:04:55 -0500
branch
meson
changeset 38482
aeed00394acf
parent 38481
7a155dcb4e5d
child 38483
fa04037c27e6

Update meson build to match autotools.

libpurple/meson.build file | annotate | diff | comparison | revisions
libpurple/protocols/bonjour/meson.build file | annotate | diff | comparison | revisions
libpurple/protocols/gg/meson.build file | annotate | diff | comparison | revisions
libpurple/protocols/jabber/meson.build file | annotate | diff | comparison | revisions
meson.build file | annotate | diff | comparison | revisions
meson_options.txt file | annotate | diff | comparison | revisions
--- a/libpurple/meson.build	Sun Dec 18 20:44:07 2016 -0500
+++ b/libpurple/meson.build	Sun Dec 18 21:04:55 2016 -0500
@@ -64,7 +64,6 @@
 	'protocol.c',
 	'protocols.c',
 	'purple-gio.c',
-	'purple-socket.c',
 	'queuedoutputstream.c',
 	'request.c',
 	'request-datasheet.c',
@@ -146,7 +145,6 @@
 	'protocol.h',
 	'protocols.h',
 	'purple-gio.h',
-	'purple-socket.h',
 	'queuedoutputstream.h',
 	'request.h',
 	'request-datasheet.h',
--- a/libpurple/protocols/bonjour/meson.build	Sun Dec 18 20:44:07 2016 -0500
+++ b/libpurple/protocols/bonjour/meson.build	Sun Dec 18 21:04:55 2016 -0500
@@ -16,7 +16,7 @@
 ]
 
 if IS_WIN32
-	BONJOURSOURCES += ['dns_sd_proxy.c']
+	BONJOURSOURCES += ['dns_sd_proxy.c', 'mdns_dns_sd.c']
 #	FIXME: libbonjour_la_LIBADD += -lnetapi32
 else
 	BONJOURSOURCES += ['mdns_avahi.c']
--- a/libpurple/protocols/gg/meson.build	Sun Dec 18 20:44:07 2016 -0500
+++ b/libpurple/protocols/gg/meson.build	Sun Dec 18 21:04:55 2016 -0500
@@ -1,47 +1,3 @@
-INTGG_SOURCES = [
-	'lib/common.c',
-	'lib/config.h',
-	'lib/dcc.c',
-	'lib/dcc7.c',
-	'lib/debug.c',
-	'lib/debug.h',
-	'lib/deflate.c',
-	'lib/deflate.h',
-	'lib/encoding.c',
-	'lib/encoding.h',
-	'lib/endian.c',
-	'lib/events.c',
-	'lib/fileio.h',
-	'lib/handlers.c',
-	'lib/http.c',
-	'lib/internal.h',
-	'lib/libgadu.c',
-	'lib/libgadu.h',
-	'lib/message.c',
-	'lib/message.h',
-	'lib/network.c',
-	'lib/network.h',
-	'lib/obsolete.c',
-	'lib/packets.pb-c.c',
-	'lib/packets.pb-c.h',
-	'lib/protobuf-c.c',
-	'lib/protobuf-c.h',
-	'lib/protobuf.c',
-	'lib/protobuf.h',
-	'lib/protocol.h',
-	'lib/pubdir.c',
-	'lib/pubdir50.c',
-	'lib/resolver.c',
-	'lib/resolver.h',
-	'lib/session.h',
-	'lib/strman.h',
-	'lib/sha1.c',
-	'lib/tvbuff.c',
-	'lib/tvbuff.h',
-	'lib/tvbuilder.c',
-	'lib/tvbuilder.h'
-]
-
 GGSOURCES = [
 	'avatar.c',
 	'avatar.h',
@@ -95,24 +51,12 @@
 	'oauth/oauth-purple.h'
 ]
 
-if HAVE_LIBGADU
-	intgg = declare_dependency()
-else
-	intgg = declare_dependency(
-	    sources : INTGG_SOURCES,
-	    include_directories : include_directories('lib'),
-	    c_args : '-DGG_IGNORE_DEPRECATED',
-	    dependencies : [gnutls, zlib]
-	)
-endif
-
-
 if STATIC_GG
 	gg_prpl = static_library('gg', GGSOURCES,
 	    c_args : '-DPURPLE_STATIC_PRPL',
-	    dependencies : [intgg, libgadu, json, libpurple_dep, glib])
+	    dependencies : [libgadu, json, libpurple_dep, glib])
 elif DYNAMIC_GG
 	gg_prpl = shared_library('gg', GGSOURCES,
-	    dependencies : [intgg, libgadu, json, libpurple_dep, glib],
+	    dependencies : [libgadu, json, libpurple_dep, glib],
 	    install : true, install_dir : PURPLE_PLUGINDIR)
 endif
--- a/libpurple/protocols/jabber/meson.build	Sun Dec 18 20:44:07 2016 -0500
+++ b/libpurple/protocols/jabber/meson.build	Sun Dec 18 21:04:55 2016 -0500
@@ -95,10 +95,6 @@
 	JABBERSOURCES += ['auth_cyrus.c']
 endif
 
-if IS_WIN32
-	JABBERSOURCES += ['win32/posix.uname.c']
-endif
-
 if STATIC_JABBER
 	jabber_prpl = static_library('jabber', JABBERSOURCES,
 	    c_args : '-DPURPLE_STATIC_PRPL',
--- a/meson.build	Sun Dec 18 20:44:07 2016 -0500
+++ b/meson.build	Sun Dec 18 21:04:55 2016 -0500
@@ -949,56 +949,34 @@
 # Check for Gadu-Gadu protocol library (libgadu)
 #######################################################################
 
-libgadu = dependency('libgadu', version : '>= 1.12.0', required : false)
-have_libgadu = libgadu.found()
+enable_libgadu = get_option('libgadu')
+if enable_libgadu
+	libgadu = dependency('libgadu', version : '>= 1.12.0', required : false)
+	have_libgadu = libgadu.found()
 
-if have_libgadu
-	if not compiler.has_function('gg_is_gpl_compliant', args : '-lgadu')
-#		LIBGADU_LIBS=''
-#		LIBGADU_CFLAGS=''
-		have_libgadu = false
-		message('''
+	if have_libgadu
+		if not compiler.has_function('gg_is_gpl_compliant', dependencies : libgadu)
+			have_libgadu = false
+			message('''
 libgadu is not compatible with the GPL when compiled with OpenSSL support.
 
-To compile against system libgadu, please recompile libgadu using:
+To link against libgadu, please recompile libgadu using:
 ./configure --with-openssl=no
 Then rerun this ./configure
+			''')
+		endif
+	endif
 
-Falling back to using our own copy of libgadu.
-		''')
+	if not have_libgadu and force_deps
+		error('''
+Libgadu development headers not found.
+Use -Dlibgadu=false if you do not need GG (GaduGadu) support.
+''')
 	endif
+else
+	have_libgadu = false
 endif
 
-HAVE_LIBGADU = have_libgadu
-if have_libgadu
-	conf.set('HAVE_LIBGADU', true)
-else
-	gg_have_gnutls_csxst = compiler.has_function('gnutls_certificate_set_x509_system_trust', args : '-lgnutls')
-
-	gg_gnutls_sts = ''
-	if not gg_have_gnutls_csxst
-		foreach i : '/etc/ssl/ca-bundle.pem /etc/ssl/certs/ca-certificates.crt /etc/pki/tls/cert.pem /usr/local/share/certs/ca-root-nss.crt /etc/ssl/cert.pem'.split()
-			if gg_gnutls_sts == '' and run_command('test', '-e', i).returncode() == 0
-				gg_gnutls_sts = i
-			endif
-		endforeach
-	endif
-
-	if gg_have_gnutls_csxst
-		conf.set('HAVE_GNUTLS_CERTIFICATE_SET_X509_SYSTEM_TRUST', true)
-	endif
-	if gg_gnutls_sts != ''
-		conf.set('GG_CONFIG_GNUTLS_SYSTEM_TRUST_STORE',
-		         '"@0@"'.format(gg_gnutls_sts))
-	endif
-
-	# redundant - only here to stay compatible with libgadu upstream
-	GNUTLS_2_10 = dependency('gnutls', version : '>= 2.10.0', required : false)
-	conf.set('HAVE_GNUTLS_2_10', GNUTLS_2_10.found())
-endif
-
-#AC_SUBST(LIBGADU_LIBS)
-#AC_SUBST(LIBGADU_CFLAGS)
 
 DEFAULT_PRPLS = ['bonjour', 'facebook', 'gg', 'irc', 'jabber', 'msn', 'mxit',
                  'novell', 'oscar', 'sametime', 'silc', 'simple', 'yahoo',
@@ -1025,6 +1003,8 @@
 		# Do nothing
 	elif prpl == 'silc' and (not silcincludes or not silcclient)
 		# Do nothing
+	elif prpl == 'gg' and not have_libgadu
+		# Do nothing
 	elif prpl == 'zephyr' and is_win32
 		# Do nothing
 	else
@@ -1083,6 +1063,8 @@
 		# Do nothing.
 	elif prpl == 'silc' and (not silcincludes or not silcclient)
 		# Do nothing.
+	elif prpl == 'gg' and not have_libgadu
+		# Do nothing.
 	elif prpl == 'zephyr' and is_win32
 		# Do nothing.
 	else
@@ -1229,18 +1211,16 @@
 # Check for Secret Service headers
 #######################################################################
 
-# disabled - see secretservice.c
+enable_secret_service = get_option('secret-service')
+if enable_secret_service
+	secretservice = dependency('libsecret-1', required : force_deps)
+	if secretservice.found()
+	else
+		enable_secret_service = false
+	endif
+endif
 
-#if get_option('secret-service')
-#	PKG_CHECK_MODULES(SECRETSERVICE, [libsecret-1], [
-#		AC_SUBST(SECRETSERVICE_CFLAGS)
-#		AC_SUBST(SECRETSERVICE_LIBS)
-#		AC_DEFINE(HAVE_SECRETSERVICE, 1, [Define if we have Secret Service.])
-#	])
-#endif
-
-#AM_CONDITIONAL(ENABLE_SECRETSERVICE, test 'x$enable_secret_service' = 'xyes')
-ENABLE_SECRETSERVICE = false
+ENABLE_SECRETSERVICE = enable_secret_service
 
 #######################################################################
 # Check for GNOME Keyring headers
@@ -1842,7 +1822,6 @@
 message('Build with Cyrus SASL support. : ' + enable_cyrus_sasl.to_string())
 message('Use kerberos 4 with zephyr.... : ' + kerberos.to_string())
 message('Use external libzephyr........ : ' + zephyr.to_string())
-message('Use external libgadu.......... : ' + have_libgadu.to_string())
 message('Install pixmaps............... : ' + INSTALL_PIXMAPS.to_string())
 message('Old tray icon compatibility... : ' + ENABLE_TRAYCOMPAT.to_string())
 message('Install translations.......... : ' + INSTALL_I18N.to_string())
@@ -1857,7 +1836,7 @@
 message('')
 message('Build with GNOME Keyring...... : ' + enable_gnome_keyring.to_string())
 message('Build with KWallet............ : ' + enable_kwallet.to_string())
-#message('Build with Secret Service..... : ' + enable_secret_service)
+message('Build with Secret Service..... : ' + enable_secret_service.to_string())
 message('')
 message('Build with plugin support..... : ' + PLUGINS.to_string())
 message('Enable Introspection...........: ' + enable_introspection.to_string())
--- a/meson_options.txt	Sun Dec 18 20:44:07 2016 -0500
+++ b/meson_options.txt	Sun Dec 18 21:04:55 2016 -0500
@@ -74,6 +74,9 @@
 option('silc-libs', type : 'string',
        description : 'compile the SILC plugin against the SILC libs in DIR')
 
+option('libgadu', type : 'boolean', value : true,
+       description : 'compile with libgadu (required for GaduGadu support)')
+
 option('distrib', type : 'boolean', value : false)
 
 option('static-prpls', type : 'string',
@@ -103,6 +106,9 @@
 option('unity-integration', type : 'boolean', value : false,
        description : 'compile with support for unity integration plugin')
 
+option('secret-service', type : 'boolean', value : true,
+       description : 'enable Secret Service support')
+
 option('gnome-keyring', type : 'boolean', value : true,
        description : 'enable GNOME Keyring support')
 

mercurial