21086262 swig upgrade breaks m2crypto and thus pkg
authorNorm Jacobs <Norm.Jacobs@Oracle.COM>
Thu, 14 May 2015 23:23:23 -0500
changeset 4293 17b5d565eb85
parent 4292 b567a8854fea
child 4295 8e6a71e8754b
21086262 swig upgrade breaks m2crypto and thus pkg
components/python/m2crypto/patches/swig-3.0.5.patch
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/components/python/m2crypto/patches/swig-3.0.5.patch	Thu May 14 23:23:23 2015 -0500
@@ -0,0 +1,69 @@
+#
+# Based on community discussion at
+#	https://github.com/martinpaljak/M2Crypto/issues/60
+#
+diff --git a/SWIG/_lib.i b/SWIG/_lib.i
+index 0d40698..c74e531 100644
+--- a/SWIG/_lib.i
++++ b/SWIG/_lib.i
[email protected]@ -66,6 +66,8 @@ int ssl_verify_callback(int ok, X509_STORE_CTX *ctx) {
+     int cret;
+     int new_style_callback = 0, warning_raised_exception=0;
+     PyGILState_STATE gilstate;
++    PyObject *self = 0;
++    (void)self;
+
+     ssl = (SSL *)X509_STORE_CTX_get_app_data(ctx);
+
[email protected]@ -151,6 +153,8 @@ int ssl_verify_callback(int ok, X509_STORE_CTX *ctx) {
+ void ssl_info_callback(const SSL *s, int where, int ret) {
+     PyObject *argv, *retval, *_SSL;
+     PyGILState_STATE gilstate;
++    PyObject *self = 0;
++    (void)self;
+
+     gilstate = PyGILState_Ensure();
+
[email protected]@ -170,6 +174,8 @@ DH *ssl_set_tmp_dh_callback(SSL *ssl, int is_export, int keylength) {
+     PyObject *argv, *ret, *_ssl;
+     DH *dh;
+     PyGILState_STATE gilstate;
++    PyObject *self = 0;
++    (void)self;
+
+     gilstate = PyGILState_Ensure();
+
[email protected]@ -193,6 +199,8 @@ RSA *ssl_set_tmp_rsa_callback(SSL *ssl, int is_export, int keylength) {
+     PyObject *argv, *ret, *_ssl;
+     RSA *rsa;
+     PyGILState_STATE gilstate;
++    PyObject *self = 0;
++    (void)self;
+
+     gilstate = PyGILState_Ensure();
+
+diff --git a/SWIG/_pkcs7.i b/SWIG/_pkcs7.i
+index 22d791a..92b1aeb 100644
+--- a/SWIG/_pkcs7.i
++++ b/SWIG/_pkcs7.i
[email protected]@ -157,6 +157,8 @@ PyObject *smime_read_pkcs7(BIO *bio) {
+     BIO *bcont = NULL;
+     PKCS7 *p7;
+     PyObject *tuple, *_p7, *_BIO;
++    PyObject *self = 0;
++    (void)self;
+
+     if (BIO_method_type(bio) == BIO_TYPE_MEM) {
+         /* OpenSSL FAQ explains that this is needed for mem BIO to return EOF,
+
+--- M2Crypto-0.21.1/setup.py	Sat Jan 15 13:10:06 2011
++++ M2Crypto-0.21.1.new/setup.py	Sat Jan 15 13:10:06 2011
[email protected]@ -57,6 +57,7 @@
+         self.swig_opts.append('-includeall')
+         #self.swig_opts.append('-D__i386__') # Uncomment for early OpenSSL 0.9.7 versions, or on Fedora Core if build fails
+         #self.swig_opts.append('-DOPENSSL_NO_EC') # Try uncommenting if you can't build with EC disabled
++        self.swig_opts.append('-builtin')
+         
+         self.include_dirs += [os.path.join(self.openssl, opensslIncludeDir),
+                               os.path.join(os.getcwd(), 'SWIG')]        
+