[libsoup/wip/meson: 27/75] Initial meson support



commit da1831186c5326d206e8b9afe0d5114cf3aefe51
Author: Sebastian Dröge <slomo coaxion net>
Date:   Tue Oct 3 11:12:43 2017 +0200

    Initial meson support
    
    Does not build libsoup-gnome and exclude gssapi and ntlm_auth, and also
    misses other features of the autotools build system. But generates a
    useable library.

 examples/meson.build               |    8 ++
 libsoup/meson.build                |  176 ++++++++++++++++++++++++++++++++++++
 libsoup/soup-enum-types.c.template |   42 +++++++++
 libsoup/soup-enum-types.h.template |   26 ++++++
 libsoup/soup.h                     |    1 +
 meson.build                        |   63 +++++++++++++
 6 files changed, 316 insertions(+), 0 deletions(-)
---
diff --git a/examples/meson.build b/examples/meson.build
new file mode 100644
index 0000000..6e01b47
--- /dev/null
+++ b/examples/meson.build
@@ -0,0 +1,8 @@
+get_example = executable('get', 'get.c',
+    dependencies : [glib_dep, libsoup_dep])
+
+simple_httpd_example = executable('simple_httpd', 'simple-httpd.c',
+    dependencies : [glib_dep, libsoup_dep])
+
+simple_proxy_example = executable('simple_proxy', 'simple-proxy.c',
+    dependencies : [glib_dep, libsoup_dep])
diff --git a/libsoup/meson.build b/libsoup/meson.build
new file mode 100644
index 0000000..6a62d9d
--- /dev/null
+++ b/libsoup/meson.build
@@ -0,0 +1,176 @@
+soup_sources = [
+  'soup-address.c',
+  'soup-auth.c',
+  'soup-auth-basic.c',
+  'soup-auth-digest.c',
+  'soup-auth-ntlm.c',
+  'soup-auth-negotiate.c',
+  'soup-auth-domain.c',
+  'soup-auth-domain-basic.c',
+  'soup-auth-domain-digest.c',
+  'soup-auth-manager.c',
+  'soup-body-input-stream.c',
+  'soup-body-output-stream.c',
+  'soup-cache.c',
+  'soup-cache-client-input-stream.c',
+  'soup-cache-input-stream.c',
+  'soup-client-input-stream.c',
+  'soup-connection.c',
+  'soup-connection-auth.c',
+  'soup-content-decoder.c',
+  'soup-content-processor.c',
+  'soup-content-sniffer.c',
+  'soup-content-sniffer-stream.c',
+  'soup-converter-wrapper.c',
+  'soup-cookie.c',
+  'soup-cookie-jar.c',
+  'soup-cookie-jar-db.c',
+  'soup-cookie-jar-text.c',
+  'soup-date.c',
+  'soup-directory-input-stream.c',
+  'soup-filter-input-stream.c',
+  'soup-form.c',
+  'soup-headers.c',
+  'soup-init.c',
+  'soup-io-stream.c',
+  'soup-logger.c',
+  'soup-message.c',
+  'soup-message-body.c',
+  'soup-message-client-io.c',
+  'soup-message-headers.c',
+  'soup-message-io.c',
+  'soup-message-queue.c',
+  'soup-message-server-io.c',
+  'soup-method.c',
+  'soup-misc.c',
+  'soup-multipart.c',
+  'soup-multipart-input-stream.c',
+  'soup-password-manager.c',
+  'soup-path-map.c',
+  'soup-proxy-resolver.c',
+  'soup-proxy-resolver-default.c',
+  'soup-proxy-resolver-wrapper.c',
+  'soup-proxy-uri-resolver.c',
+  'soup-request.c',
+  'soup-request-data.c',
+  'soup-request-file.c',
+  'soup-request-http.c',
+  'soup-requester.c',
+  'soup-server.c',
+  'soup-session.c',
+  'soup-session-async.c',
+  'soup-session-feature.c',
+  'soup-session-sync.c',
+  'soup-socket.c',
+  'soup-socket-properties.c',
+  'soup-status.c',
+  'soup-tld.c',
+  'soup-uri.c',
+  'soup-value-utils.c',
+  'soup-version.c',
+  'soup-websocket.c',
+  'soup-websocket-connection.c',
+  'soup-xmlrpc.c',
+  'soup-xmlrpc-old.c',
+]
+
+soup_headers = [
+  'soup.h',
+  'soup-address.h',
+  'soup-auth.h',
+  'soup-auth-domain.h',
+  'soup-auth-domain-basic.h',
+  'soup-auth-domain-digest.h',
+  'soup-auth-manager.h',
+  'soup-autocleanups.h',
+  'soup-cache.h',
+  'soup-content-decoder.h',
+  'soup-content-sniffer.h',
+  'soup-cookie.h',
+  'soup-cookie-jar.h',
+  'soup-cookie-jar-db.h',
+  'soup-cookie-jar-text.h',
+  'soup-date.h',
+  'soup-form.h',
+  'soup-headers.h',
+  'soup-logger.h',
+  'soup-message.h',
+  'soup-message-body.h',
+  'soup-message-headers.h',
+  'soup-method.h',
+  'soup-misc.h',
+  'soup-multipart.h',
+  'soup-multipart-input-stream.h',
+  'soup-password-manager.h',
+  'soup-portability.h',
+  'soup-proxy-resolver.h',
+  'soup-proxy-resolver-default.h',
+  'soup-proxy-uri-resolver.h',
+  'soup-request.h',
+  'soup-request-data.h',
+  'soup-request-file.h',
+  'soup-request-http.h',
+  'soup-requester.h',
+  'soup-server.h',
+  'soup-session.h',
+  'soup-session-async.h',
+  'soup-session-feature.h',
+  'soup-session-sync.h',
+  'soup-socket.h',
+  'soup-status.h',
+  'soup-tld.h',
+  'soup-types.h',
+  'soup-uri.h',
+  'soup-value-utils.h',
+  'soup-websocket.h',
+  'soup-websocket-connection.h',
+  'soup-xmlrpc.h',
+  'soup-xmlrpc-old.h',
+]
+
+includedir = 'libsoup-@0@/libsoup'.format(apiversion)
+install_headers(soup_headers, subdir : includedir)
+
+version_cdata = configuration_data()
+version_cdata.set('SOUP_MAJOR_VERSION', soup_version_major)
+version_cdata.set('SOUP_MINOR_VERSION', soup_version_minor)
+version_cdata.set('SOUP_MICRO_VERSION', soup_version_micro)
+
+configure_file(input : 'soup-version.h.in',
+  output : 'soup-version.h',
+  install_dir : join_paths(get_option('includedir'), includedir),
+  configuration : version_cdata)
+
+soup_enums = gnome.mkenums('soup-enum-types',
+  sources : soup_headers,
+  h_template : 'soup-enum-types.h.template',
+  c_template : 'soup-enum-types.c.template',
+  install_header : true,
+  install_dir : join_paths(get_option('includedir'), includedir))
+
+soupenum_h = soup_enums[1]
+soupenum_c = soup_enums[0]
+
+tldparser = find_program(join_paths(meson.current_source_dir(), 'tld-parser.py'))
+tlddata = custom_target('tlddata',
+  output : 'tld_data.inc',
+  input : join_paths(meson.source_root(), 'data', 'effective_tld_names.dat'),
+  install : false,
+  command : [tldparser, '@INPUT@', '@OUTPUT@'])
+
+libsoup_c_args  = ['-DHAVE_CONFIG_H']
+libsoup_c_args += ['-DG_LOG_DOMAIN="libsoup"']
+libsoup_c_args += ['-DLIBSOUP_COMPILATION']
+
+libsoup = library('libsoup-@0@'.format(apiversion), soup_sources,
+    soupenum_h, soupenum_c, tlddata,
+    version : libversion,
+    soversion : soversion,
+    c_args : libsoup_c_args,
+    include_directories : [configinc],
+    install : true,
+    dependencies : [glib_dep, libxml_dep, sqlite_dep, platform_deps]
+  )
+
+libsoup_dep = declare_dependency(link_with : libsoup,
+    include_directories : configinc)
diff --git a/libsoup/soup-enum-types.c.template b/libsoup/soup-enum-types.c.template
new file mode 100644
index 0000000..6107dc0
--- /dev/null
+++ b/libsoup/soup-enum-types.c.template
@@ -0,0 +1,42 @@
+/*** BEGIN file-header ***/
+#define LIBSOUP_USE_UNSTABLE_REQUEST_API
+#include <libsoup/soup.h>
+
+#define C_ENUM(v) ((gint) v)
+#define C_FLAGS(v) ((guint) v)
+
+/*** END file-header ***/
+
+/*** BEGIN file-production ***/
+/* enumerations from "@basename@" */
+/*** END file-production ***/
+
+/*** BEGIN value-header ***/
+GType
+@enum_name@_get_type (void)
+{
+  static gsize id = 0;
+  static const G@Type@Value values[] = {
+/*** END value-header ***/
+
+/*** BEGIN value-production ***/
+    { C_@TYPE@(@VALUENAME@), "@VALUENAME@", "@valuenick@" },
+/*** END value-production ***/
+
+/*** BEGIN value-tail ***/
+    { 0, NULL, NULL }
+  };
+
+  if (g_once_init_enter (&id)) {
+    GType tmp = g_@type@_register_static ("@EnumName@", values);
+    g_once_init_leave (&id, tmp);
+  }
+
+  return (GType) id;
+}
+
+/*** END value-tail ***/
+
+/*** BEGIN file-tail ***/
+
+/*** END file-tail ***/
diff --git a/libsoup/soup-enum-types.h.template b/libsoup/soup-enum-types.h.template
new file mode 100644
index 0000000..e23a867
--- /dev/null
+++ b/libsoup/soup-enum-types.h.template
@@ -0,0 +1,26 @@
+/*** BEGIN file-header ***/
+#ifndef __SOUP_ENUM_TYPES_H__
+#define __SOUP_ENUM_TYPES_H__
+
+#include <glib-object.h>
+#include <libsoup/soup-version.h>
+#define GLIB_MKENUMS_EXTERN _SOUP_EXTERN
+
+G_BEGIN_DECLS
+/*** END file-header ***/
+
+/*** BEGIN file-production ***/
+
+/* enumerations from "@basename@" */
+/*** END file-production ***/
+
+/*** BEGIN value-header ***/
+GType @enum_name@_get_type (void);
+#define @ENUMPREFIX@_TYPE_@ENUMSHORT@ (@enum_name@_get_type ())
+/*** END value-header ***/
+
+/*** BEGIN file-tail ***/
+G_END_DECLS
+
+#endif /* __SOUP_ENUM_TYPES_H__ */
+/*** END file-tail ***/
diff --git a/libsoup/soup.h b/libsoup/soup.h
index 6bedb62..c13d932 100644
--- a/libsoup/soup.h
+++ b/libsoup/soup.h
@@ -39,6 +39,7 @@ extern "C" {
 #include <libsoup/soup-proxy-resolver-default.h>
 #include <libsoup/soup-proxy-uri-resolver.h>
 #include <libsoup/soup-request.h>
+#include <libsoup/soup-requester.h>
 #include <libsoup/soup-request-data.h>
 #include <libsoup/soup-request-file.h>
 #include <libsoup/soup-request-http.h>
diff --git a/meson.build b/meson.build
new file mode 100644
index 0000000..ae5de58
--- /dev/null
+++ b/meson.build
@@ -0,0 +1,63 @@
+project('libsoup', 'c',
+        version: '2.58.0',
+        meson_version : '>=0.40.1',
+        license : 'LGPL')
+
+gnome = import('gnome')
+cc = meson.get_compiler('c')
+
+soup_version = meson.project_version()
+version_arr = soup_version.split('.')
+soup_version_major = version_arr[0]
+soup_version_minor = version_arr[1]
+soup_version_micro = version_arr[2]
+
+libversion = '1.8.0'
+apiversion = '2.4'
+soversion = '0'
+
+host_system = host_machine.system()
+
+glib_dep = [dependency('glib-2.0', version : '>=2.38'),
+            dependency('gobject-2.0', version : '>=2.38'),
+            dependency('gio-2.0', version : '>=2.38')]
+
+sqlite_dep = [dependency('sqlite3')]
+
+libxml_dep = [dependency('libxml-2.0')]
+
+cdata = configuration_data()
+
+platform_deps = []
+if host_machine.system() == 'windows'
+  platform_deps = [cc.find_library('ws2_32')]
+  cdata.set('_SOUP_EXTERN', '__declspec(dllexport)')
+  cdata.set('DLL_EXPORT', 1)
+endif
+
+configinc = include_directories('.')
+
+prefix = get_option('prefix')
+
+cdata.set('PACKAGE_VERSION', '"@0@"'.format(soup_version))
+cdata.set('LOCALEDIR', '"@0@/@1@"'.format(prefix, get_option('localedir')))
+cdata.set('GETTEXT_PACKAGE', '"libsoup-2.4"')
+configure_file(output : 'config.h', configuration : cdata)
+
+pkgconf = configuration_data()
+
+pkgconf.set('prefix', get_option('prefix'))
+pkgconf.set('exec_prefix', '${prefix}')
+pkgconf.set('libdir', '${prefix}/@0@'.format(get_option('libdir')))
+pkgconf.set('includedir', '${prefix}/@0@'.format(get_option('includedir')))
+pkgconf.set('VERSION', soup_version)
+
+pkg_install_dir = '@0@/pkgconfig'.format(get_option('libdir'))
+
+configure_file(output : 'libsoup-2.4.pc',
+    input : 'libsoup-2.4.pc.in',
+    configuration : pkgconf,
+    install_dir : pkg_install_dir)
+
+subdir('libsoup')
+subdir('examples')


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]