epatch "${FILESDIR}"/${PN}-9999-parallel-make.patch
epatch "${FILESDIR}"/${PN}-0.12_pre5-compilation-fix.patch
+ epatch "${FILESDIR}"/${PN}-0.12_pre5-libressl.patch
+ epatch "${FILESDIR}"/${PN}-0.12_pre5-rand-egd.patch
if use javascript ; then
if has_version ">=dev-lang/spidermonkey-1.8"; then
--- /dev/null
+Adapted from upstream
+commit 54ebe365b752f8969a67279d0d29552ab638e025
+Author: Witold Filipczyk <witekfl@poczta.onet.pl>
+Date: Mon Mar 6 17:39:36 2017 +0100
+
+ Compilation fix for OpenSSL-1.1
+
+--- a/src/network/ssl/socket.c
++++ b/src/network/ssl/socket.c
+@@ -67,7 +67,9 @@
+ ssl_set_no_tls(struct socket *socket)
+ {
+ #ifdef CONFIG_OPENSSL
+- ((ssl_t *) socket->ssl)->options |= SSL_OP_NO_TLSv1;
++#ifdef SSL_OP_NO_TLSv1
++ SSL_set_options((ssl_t *)socket->ssl, SSL_OP_NO_TLSv1);
++#endif
+ #elif defined(CONFIG_GNUTLS)
+ {
+ /* GnuTLS does not support SSLv2 because it is "insecure".
+@@ -145,7 +147,7 @@
+ }
+
+ if (client_cert) {
+- SSL_CTX *ctx = ((SSL *) socket->ssl)->ctx;
++ SSL_CTX *ctx = SSL_get_SSL_CTX((SSL *) socket->ssl);
+
+ SSL_CTX_use_certificate_chain_file(ctx, client_cert);
+ SSL_CTX_use_PrivateKey_file(ctx, client_cert,
--- /dev/null
+--- a/src/network/ssl/ssl.c
++++ b/src/network/ssl/ssl.c
+@@ -84,11 +84,16 @@ init_openssl(struct module *module)
+ * cannot initialize the PRNG and so every attempt to use SSL fails.
+ * It's actually an OpenSSL FAQ, and according to them, it's up to the
+ * application coders to seed the RNG. -- William Yodlowsky */
+- if (RAND_egd(RAND_file_name(f_randfile, sizeof(f_randfile))) < 0) {
++ RAND_file_name(f_randfile, sizeof(f_randfile));
++#ifdef HAVE_RAND_EGD
++ if (RAND_egd(f_randfile) < 0) {
+ /* Not an EGD, so read and write to it */
++#endif
+ if (RAND_load_file(f_randfile, -1))
+ RAND_write_file(f_randfile);
++#ifdef HAVE_RAND_EGD
+ }
++#endif
+
+ SSLeay_add_ssl_algorithms();
+ context = SSL_CTX_new(SSLv23_client_method());