glib-networking: Build with openssl support, drop glib-openssl

glib-openssl was merged into glib-networking, the former is no longer needed now.
This commit is contained in:
Christoph Reiter committed 2019-12-21 18:47:36 +01:00
1 parent 5c1779f5d3
commit 45b024ad73
4 files changed
+6 -351

No files matched your search

+6 -3
View File
@@ -4,7 +4,7 @@ _realname=glib-networking
pkgbase=mingw-w64-${_realname}
pkgname="${MINGW_PACKAGE_PREFIX}-${_realname}"
pkgver=2.62.2
pkgrel=1
pkgrel=2
pkgdesc="Network-related GIO modules for glib (mingw-w64)"
arch=(any)
url="https://gitlab.gnome.org/GNOME/glib-networking"
@@ -17,7 +17,10 @@ depends=("${MINGW_PACKAGE_PREFIX}-gcc-libs"
"${MINGW_PACKAGE_PREFIX}-glib2"
"${MINGW_PACKAGE_PREFIX}-gnutls"
"${MINGW_PACKAGE_PREFIX}-libproxy"
"${MINGW_PACKAGE_PREFIX}-openssl"
"${MINGW_PACKAGE_PREFIX}-gsettings-desktop-schemas")
replaces=("${MINGW_PACKAGE_PREFIX}-glib-openssl")
conflicts=("${MINGW_PACKAGE_PREFIX}-glib-openssl")
options=('staticlibs' 'strip')
source=("https://download.gnome.org/sources/${_realname}/${pkgver%.*}/${_realname}-${pkgver}.tar.xz"
001-fix-includes.patch)
@@ -35,8 +38,8 @@ build() {
${MINGW_PREFIX}/bin/meson \
--buildtype plain \
-Dlibproxy_support=true \
-Dgnome_proxy_support=true \
--auto-features=enabled \
-Dopenssl=enabled \
../${_realname}-${pkgver}
${MINGW_PREFIX}/bin/ninja
@@ -1,287 +0,0 @@
From 5cc4329781645361ef2a9b6d111f7dea9d3b0f4e Mon Sep 17 00:00:00 2001
From: Christoph Reiter <reiter.christoph@gmail.com>
Date: Mon, 21 May 2018 21:13:44 +0200
Subject: [PATCH] tls: Fix the build with openssl 1.0 on Windows
Due to name clashes between the Windows headers and openssl headers the include
order matters. In addition the 1.0 headers include the Windows headers themselves
which makes things more complicated.
According to
https://github.com/openssl/openssl/issues/1157#issuecomment-231330913
this is fixed in 1.1 by not including the Windows headers in the openssl headers
and requiring the user to include the Windows headers first (but I haven't tested this)
To avoid future breakage gather all openssl includes in one file, include the
Windows headers first and undef all the clashing macros.
https://bugzilla.gnome.org/show_bug.cgi?id=795782
---
tls/openssl/Makefile.am | 1 +
tls/openssl/gtlsbackend-openssl.c | 3 +-
tls/openssl/gtlsbio.h | 2 +-
tls/openssl/gtlscertificate-openssl.c | 4 +-
tls/openssl/gtlscertificate-openssl.h | 2 +-
tls/openssl/gtlsclientconnection-openssl.c | 8 +--
tls/openssl/gtlsconnection-openssl.c | 3 +-
tls/openssl/gtlsconnection-openssl.h | 2 +-
tls/openssl/gtlsfiledatabase-openssl.c | 2 +-
tls/openssl/gtlsfiledatabase-openssl.h | 4 --
tls/openssl/gtlsserverconnection-openssl.c | 3 +-
tls/openssl/openssl-include.h | 58 ++++++++++++++++++++++
tls/openssl/openssl-util.c | 2 +-
tls/openssl/openssl-util.h | 2 +-
14 files changed, 70 insertions(+), 26 deletions(-)
create mode 100644 tls/openssl/openssl-include.h
diff --git a/tls/openssl/Makefile.am b/tls/openssl/Makefile.am
index 0e05ac7..acf8f07 100644
--- a/tls/openssl/Makefile.am
+++ b/tls/openssl/Makefile.am
@@ -22,6 +22,7 @@ libgioopenssl_la_SOURCES = \
gtlsbio.c \
openssl-util.h \
openssl-util.c \
+ openssl-include.h \
$(NULL)
AM_CPPFLAGS += \
diff --git a/tls/openssl/gtlsbackend-openssl.c b/tls/openssl/gtlsbackend-openssl.c
index f118c53..3d0291d 100644
--- a/tls/openssl/gtlsbackend-openssl.c
+++ b/tls/openssl/gtlsbackend-openssl.c
@@ -28,8 +28,7 @@
#include <errno.h>
#include <string.h>
-#include <openssl/ssl.h>
-#include <openssl/crypto.h>
+#include "openssl-include.h"
#include "gtlsbackend-openssl.h"
#include "gtlscertificate-openssl.h"
diff --git a/tls/openssl/gtlsbio.h b/tls/openssl/gtlsbio.h
index 701f5d1..caa1e9b 100644
--- a/tls/openssl/gtlsbio.h
+++ b/tls/openssl/gtlsbio.h
@@ -26,7 +26,7 @@
#define __G_TLS_BIO_H__
#include <gio/gio.h>
-#include <openssl/bio.h>
+#include "openssl-include.h"
G_BEGIN_DECLS
diff --git a/tls/openssl/gtlscertificate-openssl.c b/tls/openssl/gtlscertificate-openssl.c
index 71d1643..83e6e28 100644
--- a/tls/openssl/gtlscertificate-openssl.c
+++ b/tls/openssl/gtlscertificate-openssl.c
@@ -25,9 +25,7 @@
#include "config.h"
#include <string.h>
-#include <openssl/err.h>
-#include <openssl/x509.h>
-#include <openssl/x509_vfy.h>
+#include "openssl-include.h"
#include "gtlscertificate-openssl.h"
#include "openssl-util.h"
diff --git a/tls/openssl/gtlscertificate-openssl.h b/tls/openssl/gtlscertificate-openssl.h
index 6b40502..0827c0f 100644
--- a/tls/openssl/gtlscertificate-openssl.h
+++ b/tls/openssl/gtlscertificate-openssl.h
@@ -26,7 +26,7 @@
#define __G_TLS_CERTIFICATE_OPENSSL_H__
#include <gio/gio.h>
-#include <openssl/ssl.h>
+#include "openssl-include.h"
G_BEGIN_DECLS
diff --git a/tls/openssl/gtlsclientconnection-openssl.c b/tls/openssl/gtlsclientconnection-openssl.c
index 7aa47ce..79bb5c0 100644
--- a/tls/openssl/gtlsclientconnection-openssl.c
+++ b/tls/openssl/gtlsclientconnection-openssl.c
@@ -25,16 +25,10 @@
#include "config.h"
#include "glib.h"
-#ifdef G_OS_WIN32
-#define WIN32_LEAN_AND_MEAN
-#endif
-
#include <errno.h>
-#include <openssl/ssl.h>
-#include <openssl/err.h>
-#include <openssl/x509_vfy.h>
#include <string.h>
+#include "openssl-include.h"
#include "gtlsconnection-base.h"
#include "gtlsclientconnection-openssl.h"
#include "gtlsbackend-openssl.h"
diff --git a/tls/openssl/gtlsconnection-openssl.c b/tls/openssl/gtlsconnection-openssl.c
index acc12b6..01abe53 100644
--- a/tls/openssl/gtlsconnection-openssl.c
+++ b/tls/openssl/gtlsconnection-openssl.c
@@ -27,8 +27,7 @@
#include <errno.h>
#include <stdarg.h>
-#include <openssl/ssl.h>
-#include <openssl/err.h>
+#include "openssl-include.h"
#include "gtlsconnection-openssl.h"
#include "gtlsbackend-openssl.h"
diff --git a/tls/openssl/gtlsconnection-openssl.h b/tls/openssl/gtlsconnection-openssl.h
index 0689189..31eeab3 100644
--- a/tls/openssl/gtlsconnection-openssl.h
+++ b/tls/openssl/gtlsconnection-openssl.h
@@ -28,7 +28,7 @@
#include <gio/gio.h>
#include "gtlsconnection-base.h"
-#include <openssl/ssl.h>
+#include "openssl-include.h"
G_BEGIN_DECLS
diff --git a/tls/openssl/gtlsfiledatabase-openssl.c b/tls/openssl/gtlsfiledatabase-openssl.c
index 10b5df7..db1f960 100644
--- a/tls/openssl/gtlsfiledatabase-openssl.c
+++ b/tls/openssl/gtlsfiledatabase-openssl.c
@@ -28,7 +28,7 @@
#include <gio/gio.h>
#include <glib/gi18n-lib.h>
-#include <openssl/ssl.h>
+#include "openssl-include.h"
typedef struct _GTlsFileDatabaseOpensslPrivate
{
diff --git a/tls/openssl/gtlsfiledatabase-openssl.h b/tls/openssl/gtlsfiledatabase-openssl.h
index 2d3ccfb..66c2a22 100644
--- a/tls/openssl/gtlsfiledatabase-openssl.h
+++ b/tls/openssl/gtlsfiledatabase-openssl.h
@@ -27,10 +27,6 @@
#include <gio/gio.h>
-#ifdef G_OS_WIN32
-#define WIN32_LEAN_AND_MEAN
-#endif
-
#include "gtlsdatabase-openssl.h"
G_BEGIN_DECLS
diff --git a/tls/openssl/gtlsserverconnection-openssl.c b/tls/openssl/gtlsserverconnection-openssl.c
index 73feb94..6a99574 100644
--- a/tls/openssl/gtlsserverconnection-openssl.c
+++ b/tls/openssl/gtlsserverconnection-openssl.c
@@ -27,8 +27,7 @@
#include "gtlsserverconnection-openssl.h"
#include "gtlscertificate-openssl.h"
-#include <openssl/ssl.h>
-#include <openssl/err.h>
+#include "openssl-include.h"
#include <glib/gi18n-lib.h>
typedef struct _GTlsServerConnectionOpensslPrivate
diff --git a/tls/openssl/openssl-include.h b/tls/openssl/openssl-include.h
new file mode 100644
index 0000000..7a6a460
--- /dev/null
+++ b/tls/openssl/openssl-include.h
@@ -0,0 +1,58 @@
+/*
+ * gtlscertificate-openssl.h
+ *
+ * Copyright (C) 2015 NICE s.r.l.
+ *
+ * This file is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This file is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * In addition, when the library is used with OpenSSL, a special
+ * exception applies. Refer to the LICENSE_EXCEPTION file for details.
+ *
+ * Authors: Ignacio Casal Quinteiro
+ * Christoph Reiter
+ */
+
+/* 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.
+ */
+
+#ifndef __G_TLS_OPENSSL_INCLUDE_H__
+#define __G_TLS_OPENSSL_INCLUDE_H__
+
+#include "glib.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
+#undef X509_EXTENSIONS
+#undef OCSP_REQUEST
+#undef OCSP_RESPONSE
+#endif
+
+#include <openssl/ssl.h>
+#include <openssl/bio.h>
+#include <openssl/err.h>
+#include <openssl/x509.h>
+#include <openssl/x509_vfy.h>
+#include <openssl/x509v3.h>
+#include <openssl/crypto.h>
+#if (OPENSSL_VERSION_NUMBER >= 0x0090808fL) && !defined(OPENSSL_NO_OCSP)
+#include <openssl/ocsp.h>
+#endif
+
+#endif /* __G_TLS_OPENSSL_INCLUDE_H__ */
diff --git a/tls/openssl/openssl-util.c b/tls/openssl/openssl-util.c
index 5ba63f1..c78cb6d 100644
--- a/tls/openssl/openssl-util.c
+++ b/tls/openssl/openssl-util.c
@@ -65,7 +65,7 @@
#include "openssl-util.h"
#include <string.h>
-#include <openssl/x509v3.h>
+#include "openssl-include.h"
#ifdef _MSC_VER
#define strncasecmp _strnicmp
diff --git a/tls/openssl/openssl-util.h b/tls/openssl/openssl-util.h
index 72cd2c9..10618cc 100644
--- a/tls/openssl/openssl-util.h
+++ b/tls/openssl/openssl-util.h
@@ -64,7 +64,7 @@
#ifndef __G_TLS_OPENSSL_UTIL_H__
#define __G_TLS_OPENSSL_UTIL_H__
-#include <openssl/x509.h>
+#include "openssl-include.h"
/*
* Always check subject name for host match even if subject alt names present
--
2.19.0
-50
View File
@@ -1,50 +0,0 @@
# Maintainer: Christoph Reiter <reiter.christoph@gmail.com>
_realname=glib-openssl
pkgbase=mingw-w64-${_realname}
pkgname="${MINGW_PACKAGE_PREFIX}-${_realname}"
pkgver=2.50.8
pkgrel=2
arch=('any')
pkgdesc="Network-related giomodule for glib using openssl (mingw-w64)"
depends=("${MINGW_PACKAGE_PREFIX}-glib2"
"${MINGW_PACKAGE_PREFIX}-openssl")
makedepends=("${MINGW_PACKAGE_PREFIX}-meson"
"${MINGW_PACKAGE_PREFIX}-ninja"
"${MINGW_PACKAGE_PREFIX}-pkg-config")
options=('strip' 'staticlibs')
license=('custom: LGPL2+ with openssl exception')
url="https://git.gnome.org/browse/glib-openssl"
source=("https://download.gnome.org/sources/${_realname}/${pkgver%.*}/${_realname}-${pkgver}.tar.xz"
"fix-cert-path.patch"
"0001-tls-Fix-the-build-with-openssl-1.0-on-Windows.patch")
sha256sums=('869f08e4e9a719c1df411c2fb5554400f6b24a9db0cb94c4359db8dad18d185f'
'cd771f490c74a8276c9dba0e836542a5b11ecc51c166221b091446197533faa7'
'726e04f877fd11c21b6a4f82f74ffbaf88e56f3845682906cea118c6d8444f38')
prepare() {
cd "${srcdir}"/${_realname}-${pkgver}
patch -p1 -i "${srcdir}/fix-cert-path.patch"
patch -p1 -i "${srcdir}/0001-tls-Fix-the-build-with-openssl-1.0-on-Windows.patch"
}
build() {
[[ -d build-${MINGW_CHOST} ]] && rm -rf build-${MINGW_CHOST}
mkdir -p build-${MINGW_CHOST}
cd build-${MINGW_CHOST}
meson \
--buildtype plain \
--prefix=${MINGW_PREFIX} \
../${_realname}-${pkgver}
ninja
}
package() {
cd "${srcdir}/build-${MINGW_CHOST}"
DESTDIR=${pkgdir}${MINGW_PREFIX} ninja install
install -Dm644 "${srcdir}/${_realname}-${pkgver}/COPYING" "${pkgdir}${MINGW_PREFIX}/share/licenses/${_realname}/COPYING"
}
@@ -1,11 +0,0 @@
--- glib-openssl-2.50.8/tls/openssl/gtlsbackend-openssl.c.orig 2018-02-26 11:03:32.000000000 +0100
+++ glib-openssl-2.50.8/tls/openssl/gtlsbackend-openssl.c 2018-03-13 07:58:22.822305900 +0100
@@ -191,7 +191,7 @@
gchar *cert_path;
module_dir = g_win32_get_package_installation_directory_of_module (NULL);
- cert_path = g_build_filename (module_dir, "bin", "cert.pem", NULL);
+ cert_path = g_build_filename (module_dir, "ssl", "cert.pem", NULL);
g_free (module_dir);
if (g_file_test (cert_path, G_FILE_TEST_IS_REGULAR))