commit:     c1791cb8d661fe7c8916f9787f7772da42e0b435
Author:     Andrew Savchenko <bircoph <AT> gentoo <DOT> org>
AuthorDate: Sun Jan 31 02:59:53 2021 +0000
Commit:     Andrew Savchenko <bircoph <AT> gentoo <DOT> org>
CommitDate: Sun Jan 31 02:59:53 2021 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=c1791cb8

net-proxy/privoxy: fix build without threads

Closes: https://bugs.gentoo.org/767166
Package-Manager: Portage-3.0.14, Repoman-3.0.2
Signed-off-by: Andrew Savchenko <bircoph <AT> gentoo.org>

 .../privoxy/files/privoxy-3.0.29-pthread.patch      | 21 +++++++++++++++++++++
 net-proxy/privoxy/privoxy-3.0.29.ebuild             |  5 +++--
 2 files changed, 24 insertions(+), 2 deletions(-)

diff --git a/net-proxy/privoxy/files/privoxy-3.0.29-pthread.patch 
b/net-proxy/privoxy/files/privoxy-3.0.29-pthread.patch
new file mode 100644
index 00000000000..2890b824d7e
--- /dev/null
+++ b/net-proxy/privoxy/files/privoxy-3.0.29-pthread.patch
@@ -0,0 +1,21 @@
+diff --git a/project.h b/project.h
+index ec3c1559..6c744415 100644
+--- a/project.h
++++ b/project.h
+@@ -54,16 +54,6 @@
+ #define HASH_OF_HOST_BUF_SIZE      16
+ #endif /* FEATURE_HTTPS_INSPECTION */
+ 
+-#ifdef FEATURE_PTHREAD
+-#  include <pthread.h>
+-   typedef pthread_mutex_t privoxy_mutex_t;
+-#else
+-#  ifdef _WIN32
+-#     include <windows.h>
+-#  endif
+-   typedef CRITICAL_SECTION privoxy_mutex_t;
+-#endif
+-
+ #ifdef FEATURE_HTTPS_INSPECTION_MBEDTLS
+ #include "mbedtls/net_sockets.h"
+ #include "mbedtls/entropy.h"

diff --git a/net-proxy/privoxy/privoxy-3.0.29.ebuild 
b/net-proxy/privoxy/privoxy-3.0.29.ebuild
index 966001da72e..ded50272b29 100644
--- a/net-proxy/privoxy/privoxy-3.0.29.ebuild
+++ b/net-proxy/privoxy/privoxy-3.0.29.ebuild
@@ -47,7 +47,7 @@ REQUIRED_USE="
        compression? ( zlib )
        brotli? ( zlib )
        fuzz? ( zlib )
-       ssl? ( ^^ ( mbedtls openssl ) )
+       ssl? ( ^^ ( mbedtls openssl ) threads )
 "
 
 S="${WORKDIR}/${P%_*}-${PRIVOXY_STATUS}"
@@ -57,13 +57,14 @@ PATCHES=(
        "${FILESDIR}"/${PN}-3.0.28-chdir.patch
        "${FILESDIR}"/${PN}-3.0.28-null-termination.patch
        "${FILESDIR}"/${PN}-3.0.28-strip.patch
+       "${FILESDIR}"/${P}-pthread.patch
 )
 
 pkg_pretend() {
        if ! use threads; then
                ewarn
                ewarn "Privoxy may be very slow without threads support, 
consider to enable them."
-               ewarn "See also 
http://www.privoxy.org/faq/trouble.html#GENTOO-RICERS";
+               ewarn "See also 
https://www.privoxy.org/faq/trouble.html#GENTOO-RICERS";
                ewarn
        fi
 }

Reply via email to