common_flags = [
'-DHAVE_CONFIG_H',
'-DG_LOG_DOMAIN="GLib-Net"',
+ '-DG_LOG_USE_STRUCTURED',
'-DLOCALE_DIR="@0@"'.format(localedir),
'-DG_DISABLE_DEPRECATED',
- '-DGLIB_VERSION_MIN_REQUIRED=GLIB_VERSION_2_46'
+ '-DGLIB_VERSION_MIN_REQUIRED=GLIB_VERSION_2_70'
]
+# TIZEN dlog
+if get_option('tizen_debug')
+ debug_dep = dependency('dlog')
+ config_h.set('TIZEN_DEBUG', get_option('tizen_debug'))
+endif
+
add_project_arguments(common_flags, language: 'c')
+ cflags = cc.get_supported_arguments(['-Werror=declaration-after-statement',
+ '-Werror=implicit-function-declaration'])
+ add_project_arguments(cflags, language: 'c')
+
symbol_map = join_paths(meson.current_source_dir(), meson.project_name() + '.map')
module_ldflags = []
openssl_dep = []
else
# XXX: https://github.com/mesonbuild/meson/issues/2945
- openssl_dep = dependency('openssl1.1', required: openssl_option.enabled() and cc.get_id() != 'msvc')
- openssl_dep = dependency('openssl', version: '>= 1.0.2', required: false)
++
++ openssl_dep = dependency('openssl1.1', version: '>= 1.0.2', required: false)
if openssl_dep.found()
backends += ['openssl']
- elif cc.get_id() == 'msvc' and not openssl_option.disabled()
+ else
# MSVC builds of OpenSSL does not generate pkg-config files,
# so we check for it manually here in this case, if we can't find those files
# Based on the CMake check for OpenSSL in CURL's CMakeLists.txt,
subdir('tls/openssl')
endif
--subdir('tls/tests')
++#subdir('tls/tests')
# Will automatically pick it up from the cross file if defined
gio_querymodules = find_program('gio-querymodules', required : false)
--- /dev/null
- Version: 2.60.1
+%bcond_with libproxy
+Name: glib-networking
- Source: http://download.gnome.org/sources/glib-networking/2.60/%{name}-%{version}.tar.xz
++Version: 2.72.alpha
+Release: 0
+License: LGPL-2.1+
+Summary: Network-related GIO modules for glib
+Group: System/Libraries
++Source: http://download.gnome.org/sources/glib-networking/2.72/%{name}-%{version}.tar.xz
+Source99: baselibs.conf
+Source1001: glib-networking.manifest
+Url: http://www.gnome.org
+BuildRequires: intltool
+BuildRequires: which
+BuildRequires: libgcrypt-devel
+BuildRequires: meson
+BuildRequires: pkgconfig(dbus-1)
+BuildRequires: pkgconfig(gio-2.0) >= 2.46.0
+BuildRequires: pkgconfig(openssl1.1)
+BuildRequires: pkgconfig(dlog)
+BuildRequires: pkgconfig(libtzplatform-config)
+BuildRequires: ca-certificates-devel
+Requires: ca-certificates
+%if %{with libproxy}
+BuildRequires: pkgconfig(libproxy-1.0)
+%endif
+
+%description
+This package contains network-related GIO modules for glib.
+
+Currently, there is only a proxy module based on libproxy.
+
+%lang_package
+
+%prep
+%setup -q
+cp %{SOURCE1001} .
+
+%build
+meson --prefix /usr/ --libdir %{_libdir} build \
+ -Dstatic_modules=false \
+ -Dgnutls=disabled \
+ -Dopenssl=enabled \
+ -Ddefault_ca_file=%{TZ_SYS_RO_CA_BUNDLE} \
+ -Dtizen_ext=true \
+ -Dtizen_debug=true
+ninja -C build all
+
+%install
+export DESTDIR=%{buildroot}
+ninja -C build install
+
+%find_lang %{name}
+
+%files
+%manifest %{name}.manifest
+%defattr(-, root, root)
+%license COPYING
+%{_libdir}/gio/modules/libgioopenssl.so
+%if %{with libproxy}
+%{_libdir}/gio/modules/libgiolibproxy.so
+%{_libexecdir}/glib-pacrunner
+%{_datadir}/dbus-1/services/org.gtk.GLib.PACRunner.service
+%endif
glib_dep,
gmodule_dep,
gobject_dep,
- tlsbase_dep,
openssl_dep,
+ tlsbase_dep,
]
- deps += [debug_dep]
+if get_option('tizen_debug')
++ deps += [
++ debug_dep,
++ ]
++endif
++
+ if ['darwin', 'ios'].contains(host_system)
+ deps += [
+ security_dep,
+ ]
+ elif ['windows'].contains(host_system)
+ deps += [
+ crypt32_dep,
+ ]
endif
module = shared_module(
* Christoph Reiter
*/
+ #pragma once
+
/* Due to name clashes between Windows and openssl headers we have to
* make sure windows.h is included before openssl and that we undef the
- * clashing macros.
+ * clashing macros. We also need `struct timeval` for DTLSv1_get_timeout(),
+ * and the following header also covers it for Windows.
*/
- #ifndef __G_TLS_OPENSSL_INCLUDE_H__
- #define __G_TLS_OPENSSL_INCLUDE_H__
-
- #include "glib.h"
-
+
+#ifdef TIZEN_DEBUG
+#include <dlog.h>
+
+#ifdef LOG_TAG
+#undef LOG_TAG
+#endif
+
+#define LOG_TAG "glib-networking"
+#define TIZEN_LOGD(foramt, args...) LOGD(format, ##args)
+#define TIZEN_LOGI(format, args...) LOGI(format, ##args)
+#define TIZEN_LOGE(format, args...) LOGE(format, ##args)
+#else
+#define TIZEN_LOGD(foramt, args...)
+#define TIZEN_LOGI(format, args...)
+#define TIZEN_LOGE(format, args...)
+#endif
+
+ #include <gio/gnetworking.h>
#ifdef G_OS_WIN32
- #define WIN32_LEAN_AND_MEAN
- #include <windows.h>
/* These are defined by the Windows headers, but clash with openssl */
#undef X509_NAME
#undef X509_CERT_PAIR