1 |
commit: 3eb5eefcc21a755a7e29c791944532359a53ec04 |
2 |
Author: Zac Medico <zmedico <AT> gentoo <DOT> org> |
3 |
AuthorDate: Mon Oct 16 07:30:31 2017 +0000 |
4 |
Commit: Zac Medico <zmedico <AT> gentoo <DOT> org> |
5 |
CommitDate: Mon Oct 16 07:35:15 2017 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=3eb5eefc |
7 |
|
8 |
app-text/podofo: bug 614756 compile error with openssl-1.1 |
9 |
|
10 |
Thanks to Mark Wright <gienah <AT> gentoo.org> for the |
11 |
initial patch. |
12 |
|
13 |
Fixes: https://bugs.gentoo.org/614756 |
14 |
Package-Manager: Portage-2.3.11, Repoman-2.3.3 |
15 |
|
16 |
.../podofo-0.9.6_pre20170629-openssl-1.1.patch | 114 +++++++++++++++++++++ |
17 |
app-text/podofo/podofo-0.9.6_pre20170629.ebuild | 4 + |
18 |
2 files changed, 118 insertions(+) |
19 |
|
20 |
diff --git a/app-text/podofo/files/podofo-0.9.6_pre20170629-openssl-1.1.patch b/app-text/podofo/files/podofo-0.9.6_pre20170629-openssl-1.1.patch |
21 |
new file mode 100644 |
22 |
index 00000000000..22b1e419312 |
23 |
--- /dev/null |
24 |
+++ b/app-text/podofo/files/podofo-0.9.6_pre20170629-openssl-1.1.patch |
25 |
@@ -0,0 +1,114 @@ |
26 |
+From f5da3b4d9e35a2df272f2f4056c3647454eaea95 Mon Sep 17 00:00:00 2001 |
27 |
+From: Zac Medico <zmedico@×××××.com> |
28 |
+Date: Sun, 15 Oct 2017 23:04:57 -0700 |
29 |
+Subject: [PATCH] podofosign: fix compile errors with openssl-1.1.0f |
30 |
+MIME-Version: 1.0 |
31 |
+Content-Type: text/plain; charset=UTF-8 |
32 |
+Content-Transfer-Encoding: 8bit |
33 |
+ |
34 |
+https://sourceforge.net/p/podofo/mailman/message/36077904/ |
35 |
+ |
36 |
+This fixes the following compile errors with openssl-1.1.0f: |
37 |
+ |
38 |
+tools/podofosign/podofosign.cpp:877:32: error: ‘OpenSSL_add_all_algorithms’ was not declared in this scope |
39 |
+ OpenSSL_add_all_algorithms(); |
40 |
+ ^ |
41 |
+tools/podofosign/podofosign.cpp:878:29: error: ‘ERR_load_crypto_strings’ was not declared in this scope |
42 |
+ ERR_load_crypto_strings(); |
43 |
+ ^ |
44 |
+tools/podofosign/podofosign.cpp:1085:22: error: ‘ERR_free_strings’ was not declared in this scope |
45 |
+ ERR_free_strings(); |
46 |
+ ^ |
47 |
+ |
48 |
+This patch has been tested on Linux with openssl-1.0.2l and |
49 |
+openssl-1.1.0f. |
50 |
+ |
51 |
+Bug: https://bugs.gentoo.org/614756 |
52 |
+--- |
53 |
+ CMakeLists.txt | 12 ++++++++++-- |
54 |
+ tools/podofosign/podofosign.cpp | 7 +++++++ |
55 |
+ 2 files changed, 17 insertions(+), 2 deletions(-) |
56 |
+ |
57 |
+diff --git a/CMakeLists.txt b/CMakeLists.txt |
58 |
+index 0c9a2ce..b4f7b3c 100644 |
59 |
+--- a/CMakeLists.txt |
60 |
++++ b/CMakeLists.txt |
61 |
+@@ -325,6 +325,14 @@ ENDIF(CMAKE_COMPILER_IS_GNUCXX) |
62 |
+ FIND_PACKAGE(ZLIB REQUIRED) |
63 |
+ MESSAGE("Found zlib headers in ${ZLIB_INCLUDE_DIR}, library at ${ZLIB_LIBRARIES}") |
64 |
+ |
65 |
++FIND_PACKAGE(OpenSSL) |
66 |
++if(OpenSSL_FOUND) |
67 |
++ SET(PODOFO_HAVE_OPENSSL TRUE) |
68 |
++ INCLUDE_DIRECTORIES(${OPENSSL_INCLUDE_DIRS}) |
69 |
++ LINK_DIRECTORIES(${OPENSSL_LIBRARIES}) |
70 |
++ MESSAGE(STATUS "Using OpenSSL ${OPENSSL_VERSION}") |
71 |
++ MESSAGE("Found OpenSSL ${OPENSSL_VERSION} headers in ${OPENSSL_INCLUDE_DIRS}, library at ${OPENSSL_LIBRARIES}") |
72 |
++ELSE(OpenSSL_FOUND) |
73 |
+ FIND_PACKAGE(LIBCRYPTO) |
74 |
+ |
75 |
+ IF(LIBCRYPTO_FOUND) |
76 |
+@@ -334,6 +342,7 @@ IF(LIBCRYPTO_FOUND) |
77 |
+ ELSE(LIBCRYPTO_FOUND) |
78 |
+ MESSAGE("OpenSSL's libCrypto not found. Encryption support will be disabled") |
79 |
+ ENDIF(LIBCRYPTO_FOUND) |
80 |
++ENDIF(OpenSSL_FOUND) |
81 |
+ |
82 |
+ FIND_PACKAGE(LIBIDN) |
83 |
+ |
84 |
+@@ -393,8 +402,6 @@ ENDIF(CppUnit_FOUND) |
85 |
+ |
86 |
+ ENDIF(NOT PODOFO_BUILD_LIB_ONLY) |
87 |
+ |
88 |
+-FIND_PACKAGE(OpenSSL) |
89 |
+- |
90 |
+ FIND_PACKAGE(FREETYPE REQUIRED) |
91 |
+ MESSAGE("Found freetype library at ${FREETYPE_LIBRARIES}, headers ${FREETYPE_INCLUDE_DIR}") |
92 |
+ |
93 |
+@@ -499,6 +506,7 @@ SET(PODOFO_LIB_DEPENDS |
94 |
+ ${LIBCRYPTO_LDFLAGS} |
95 |
+ ${LIBCRYPTO_LIBRARIES} |
96 |
+ ${LIBJPEG_LIBRARIES} |
97 |
++ ${OPENSSL_LIBRARIES} |
98 |
+ ${PLATFORM_SYSTEM_LIBRARIES} |
99 |
+ ${stlport_libraries_if_use_stlport} |
100 |
+ ${FREETYPE_LIBRARIES} |
101 |
+diff --git a/tools/podofosign/podofosign.cpp b/tools/podofosign/podofosign.cpp |
102 |
+index b8f5f61..a7be1e5 100644 |
103 |
+--- a/tools/podofosign/podofosign.cpp |
104 |
++++ b/tools/podofosign/podofosign.cpp |
105 |
+@@ -27,6 +27,7 @@ |
106 |
+ #include <openssl/evp.h> |
107 |
+ #include <openssl/err.h> |
108 |
+ #include <openssl/pem.h> |
109 |
++#include <openssl/ssl.h> |
110 |
+ #include <openssl/x509.h> |
111 |
+ |
112 |
+ #if defined(_WIN64) |
113 |
+@@ -874,11 +875,15 @@ int main( int argc, char* argv[] ) |
114 |
+ outputfile = NULL; |
115 |
+ } |
116 |
+ |
117 |
++#ifdef PODOFO_HAVE_OPENSSL_1_1 |
118 |
++ OPENSSL_init_ssl(0, NULL); |
119 |
++#else |
120 |
+ OpenSSL_add_all_algorithms(); |
121 |
+ ERR_load_crypto_strings(); |
122 |
+ ERR_load_PEM_strings(); |
123 |
+ ERR_load_ASN1_strings(); |
124 |
+ ERR_load_EVP_strings(); |
125 |
++#endif |
126 |
+ |
127 |
+ X509* cert = NULL; |
128 |
+ EVP_PKEY* pkey = NULL; |
129 |
+@@ -1082,7 +1087,9 @@ int main( int argc, char* argv[] ) |
130 |
+ result = e.GetError(); |
131 |
+ } |
132 |
+ |
133 |
++#ifndef PODOFO_HAVE_OPENSSL_1_1 |
134 |
+ ERR_free_strings(); |
135 |
++#endif |
136 |
+ |
137 |
+ if( pSignField ) |
138 |
+ delete pSignField; |
139 |
+-- |
140 |
|
141 |
diff --git a/app-text/podofo/podofo-0.9.6_pre20170629.ebuild b/app-text/podofo/podofo-0.9.6_pre20170629.ebuild |
142 |
index eb201c16581..6362b4ee003 100644 |
143 |
--- a/app-text/podofo/podofo-0.9.6_pre20170629.ebuild |
144 |
+++ b/app-text/podofo/podofo-0.9.6_pre20170629.ebuild |
145 |
@@ -30,8 +30,12 @@ DEPEND="${RDEPEND} |
146 |
test? ( dev-util/cppunit )" |
147 |
|
148 |
DOCS="AUTHORS ChangeLog TODO" |
149 |
+PATCHES=( |
150 |
+ "${FILESDIR}/${P}-openssl-1.1.patch" |
151 |
+) |
152 |
|
153 |
src_prepare() { |
154 |
+ cmake-utils_src_prepare |
155 |
local x sed_args |
156 |
|
157 |
# The 0.9.6 ABI is not necessarily stable, so make PODOFO_SOVERSION |