libsoup: Update to 2.52.0

This commit is contained in:
Alexey Pavlov
2015-09-24 08:57:05 +03:00
parent b641720268
commit ca33bbe10b
4 changed files with 135 additions and 9 deletions

View File

@@ -0,0 +1,29 @@
From 7b5cb1228c914b38cbcd935be1bd419754636072 Mon Sep 17 00:00:00 2001
From: Chun-wei Fan <fanchunwei@src.gnome.org>
Date: Tue, 22 Sep 2015 18:19:04 +0800
Subject: [PATCH] soup-session.c: Fix Build on MinGW
MinGW requires that a prototype be declared for DllMain() before we can use
it, so define it here to fix the build, as the previous patch to add this
did not check for this part.
---
libsoup/soup-session.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/libsoup/soup-session.c b/libsoup/soup-session.c
index ca8d80c..1eda025 100644
--- a/libsoup/soup-session.c
+++ b/libsoup/soup-session.c
@@ -81,6 +81,10 @@
#define WIN32_LEAN_AND_MEAN
#include <windows.h>
+BOOL WINAPI DllMain (HINSTANCE hinstDLL,
+ DWORD fdwReason,
+ LPVOID lpvReserved);
+
HMODULE soup_dll;
BOOL WINAPI
--
2.3.5.windows.8

View File

@@ -0,0 +1,17 @@
--- libsoup-2.52.0/m4/vapigen.m4.orig 2015-01-14 14:51:42.117600000 +0300
+++ libsoup-2.52.0/m4/vapigen.m4 2015-01-14 14:52:07.297000000 +0300
@@ -85,11 +85,11 @@
[yes], [
VAPIGEN=`$PKG_CONFIG --variable=vapigen vapigen`
VAPIGEN_MAKEFILE=`$PKG_CONFIG --variable=datadir vapigen`/vala/Makefile.vapigen
- VAPIDIR=`$PKG_CONFIG --variable=vapidir vapigen`
+ VAPIDIR=`$PKG_CONFIG --dont-define-prefix --variable=vapidir vapigen`
AS_IF([ test "x$2" = "x"], [
- VAPIGEN_VAPIDIR=`$PKG_CONFIG --variable=vapidir vapigen`
+ VAPIGEN_VAPIDIR=`$PKG_CONFIG --dont-define-prefix --variable=vapidir $vapigen_pkg_name`
], [
- VAPIGEN_VAPIDIR=`$PKG_CONFIG --variable=vapidir_versioned vapigen`
+ VAPIGEN_VAPIDIR=`$PKG_CONFIG --dont-define-prefix --variable=vapidir_versioned $vapigen_pkg_name`
])
],
[no], [

View File

@@ -0,0 +1,64 @@
From f58c9879c1986d4b77c68bd81879f692a0c62d07 Mon Sep 17 00:00:00 2001
From: Chun-wei Fan <fanchunwei@src.gnome.org>
Date: Thu, 6 Aug 2015 00:30:52 +0800
Subject: libsoup/soup-session.c: Don't Hardcode Paths on Windows
On Windows, use g_win32_get_package_installation_directory_of_module()
and g_build_filename() to acquire the localedir to find the translations
on Windows, instead of relying on the LOCALEDIR which is hardcoded at
compile time, so that the libsoup DLL can be relocated on Windows with its
translations. Therefore, we define a simple DllMain() which is used to
acquire the proper HMODULE for the purpose.
https://bugzilla.gnome.org/show_bug.cgi?id=752952
diff --git a/libsoup/soup-session.c b/libsoup/soup-session.c
index 6420183..ca8d80c 100644
--- a/libsoup/soup-session.c
+++ b/libsoup/soup-session.c
@@ -77,10 +77,43 @@
* subtypes) have a #SoupContentDecoder by default.
**/
+#if defined (G_OS_WIN32)
+#define WIN32_LEAN_AND_MEAN
+#include <windows.h>
+
+HMODULE soup_dll;
+
+BOOL WINAPI
+DllMain (HINSTANCE hinstDLL,
+ DWORD fdwReason,
+ LPVOID lpvReserved)
+{
+ switch (fdwReason) {
+ case DLL_PROCESS_ATTACH:
+ soup_dll = hinstDLL;
+ break;
+
+ case DLL_THREAD_DETACH:
+
+ default:
+ /* do nothing */
+ ;
+ }
+}
+#endif
+
static void
soup_init (void)
{
+#ifdef G_OS_WIN32
+ char *basedir = g_win32_get_package_installation_directory_of_module (soup_dll);
+ char *localedir = g_build_filename (basedir, "share", "locale", NULL);
+ bindtextdomain (GETTEXT_PACKAGE, localedir);
+ g_free (localedir);
+ g_free (basedir);
+#else
bindtextdomain (GETTEXT_PACKAGE, LOCALEDIR);
+#endif
#ifdef HAVE_BIND_TEXTDOMAIN_CODESET
bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8");
#endif
--
cgit v0.10.2

View File

@@ -1,8 +1,9 @@
# Maintainer: Alexey Pavlov <alexpux@gmail.com>
_realname=libsoup
pkgbase=mingw-w64-${_realname}
pkgname="${MINGW_PACKAGE_PREFIX}-${_realname}"
pkgver=2.51.3
pkgver=2.52.0
pkgrel=1
pkgdesc="HTTP client/server library (mingw-w64)"
arch=(any)
@@ -11,40 +12,55 @@ license=("LGPL")
makedepends=("${MINGW_PACKAGE_PREFIX}-gcc"
"${MINGW_PACKAGE_PREFIX}-gobject-introspection"
"${MINGW_PACKAGE_PREFIX}-pkg-config"
"${MINGW_PACKAGE_PREFIX}-vala"
"intltool")
depends=("${MINGW_PACKAGE_PREFIX}-gcc-libs"
"${MINGW_PACKAGE_PREFIX}-glib2"
"${MINGW_PACKAGE_PREFIX}-glib-networking"
"${MINGW_PACKAGE_PREFIX}-libxml2"
"${MINGW_PACKAGE_PREFIX}-sqlite3"
"${MINGW_PACKAGE_PREFIX}-glib-networking")
"${MINGW_PACKAGE_PREFIX}-sqlite3")
options=('staticlibs' 'strip')
source=("http://ftp.gnome.org/pub/gnome/sources/${_realname}/${pkgver%.*}/${_realname}-${pkgver}.tar.xz"
0001-give-cc-to-gir-scanner.mingw.patch
0004-localedir-fix.patch)
md5sums=('0a08e41c112ef52d9e66ccdfa95887c5'
0004-localedir-fix.patch
0005-missing-declaration.patch
0006-change-pkg-config-invocations.mingw.patch
0007-dont-hardcode-paths.patch)
md5sums=('74ef72cd984dc6daf3ba601288974c26'
'a1ddc19ab3f73bbddda1d41a6a7de399'
'ee2cc56c1448c32020288c817b81ff7f')
'ee2cc56c1448c32020288c817b81ff7f'
'8d30c2d030281a6e363167f5c9dd8599'
'412394f65ad3153aa9587b888acf2f96'
'74ffcee27943dfded1d0da15c3975eff')
prepare() {
cd "${srcdir}/${_realname}-${pkgver}"
patch -p1 -i ${srcdir}/0001-give-cc-to-gir-scanner.mingw.patch
patch -p1 -i ${srcdir}/0004-localedir-fix.patch
#patch -p1 -i ${srcdir}/0005-missing-declaration.patch
patch -p1 -i ${srcdir}/0006-change-pkg-config-invocations.mingw.patch
patch -p1 -R -i ${srcdir}/0007-dont-hardcode-paths.patch
autoreconf -fi
}
build() {
#CPPFLAGS+=" --save-temps"
mkdir -p "${srcdir}/build-${MINGW_CHOST}"
cd "${srcdir}/build-${MINGW_CHOST}"
"${srcdir}"/${_realname}-$pkgver/configure \
../${_realname}-${pkgver}/configure \
--prefix=${MINGW_PREFIX} \
--build=${MINGW_CHOST} \
--host=${MINGW_CHOST} \
--without-apache-httpd \
--without-apache-module-dir \
--with-gnome \
--enable-introspection
--enable-vala \
--enable-introspection \
--disable-silent-rules
make
make #-j1 V=1
}
package() {