[packages/python-mysql-connector] Up to 8.0.23; force capi extension build

arekm arekm at pld-linux.org
Thu Apr 28 15:42:26 CEST 2022


commit c42c644a0369bd2874cf56c8b479090033a5035d
Author: Arkadiusz Miśkiewicz <arekm at maven.pl>
Date:   Thu Apr 28 15:41:24 2022 +0200

    Up to 8.0.23; force capi extension build

 32bit.patch                 | 11 ----------
 build.patch                 | 50 +++++++++++++++++++++++++++++++++++++++++++++
 force-capi.patch            | 20 ++++++++++++++++++
 python-mysql-connector.spec | 11 +++++-----
 4 files changed, 76 insertions(+), 16 deletions(-)
---
diff --git a/python-mysql-connector.spec b/python-mysql-connector.spec
index 88c9186..cef54d8 100644
--- a/python-mysql-connector.spec
+++ b/python-mysql-connector.spec
@@ -12,13 +12,14 @@ Summary(pl.UTF-8):	Protokół kliencki MySQL zaimplementowany w Pythonie
 Name:		python-%{pname}
 # check documentation to see which version is GA (we don't want devel releases)
 # https://dev.mysql.com/downloads/connector/python/
-Version:	8.0.21
-Release:	6
+Version:	8.0.23
+Release:	1
 License:	GPL v2
 Group:		Libraries/Python
-Source0:	http://cdn.mysql.com/Downloads/Connector-Python/mysql-connector-python-%{version}.zip
-# Source0-md5:	2ae30416c0a35673e4de08e79f6bde15
-Patch0:		32bit.patch
+# Source0:	http://cdn.mysql.com/Downloads/Connector-Python/mysql-connector-python-%{version}-src.tar.gz
+Source0:	https://pypi.debian.net/mysql-connector-python/mysql-connector-python-%{version}.tar.gz
+# Source0-md5:	798f57c5e577a34787342821a0cb3a87
+Patch0:		force-capi.patch
 Patch1:		tests.patch
 Patch2:		build.patch
 URL:		http://dev.mysql.com/doc/connector-python/en/
diff --git a/32bit.patch b/32bit.patch
deleted file mode 100644
index e777cfa..0000000
--- a/32bit.patch
+++ /dev/null
@@ -1,11 +0,0 @@
---- mysql-connector-python-8.0.16/lib/cpy_distutils.py~	2019-04-26 06:57:29.000000000 +0200
-+++ mysql-connector-python-8.0.16/lib/cpy_distutils.py	2019-04-26 06:58:18.098036824 +0200
-@@ -183,7 +183,7 @@ def unix_lib_is64bit(lib_file):
-     stdout = prc.communicate()[0]
-     stdout = stdout.split(':')[1]
-     log.debug("# lib_file {0} stdout: {1}".format(lib_file, stdout))
--    if 'x86_64' in stdout or 'x86-64' in stdout or '32-bit' not in stdout:
-+    if ('x86_64' in stdout or 'x86-64' in stdout) and '32-bit' not in stdout:
-         return True
- 
-     return False
diff --git a/build.patch b/build.patch
index e6d3552..a02f34e 100644
--- a/build.patch
+++ b/build.patch
@@ -14,3 +14,53 @@
      } else {
          // Make sure to not enforce SSL
  #if MYSQL_VERSION_ID > 50703 && MYSQL_VERSION_ID < 50711
+--- mysql-connector-python-8.0.23/src/mysql_capi.c~	2022-04-28 15:35:47.000000000 +0200
++++ mysql-connector-python-8.0.23/src/mysql_capi.c	2022-04-28 15:38:01.363105540 +0200
+@@ -1040,6 +1040,7 @@ MySQL_set_character_set(MySQL *self, PyO
+   @return   int
+     @retval 0   Zero for success.
+ */
++#if MYSQL_VERSION_ID >= 80021
+ PyObject*
+ MySQL_set_load_data_local_infile_option(MySQL *self, PyObject *args)
+ {
+@@ -1067,6 +1068,7 @@ MySQL_set_load_data_local_infile_option(
+ 
+     Py_RETURN_NONE;
+ }
++#endif
+ 
+ /**
+   Commit the current transaction.
+--- mysql-connector-python-8.0.23/src/mysql_connector.c~	2020-12-16 07:04:09.000000000 +0100
++++ mysql-connector-python-8.0.23/src/mysql_connector.c	2022-04-28 15:38:28.053105544 +0200
+@@ -217,9 +217,11 @@ static PyMethodDef MySQL_methods[]=
+     {"set_character_set", (PyCFunction)MySQL_set_character_set,
+      METH_VARARGS,
+      "Set the default character set for the current connection"},
++#if MYSQL_VERSION_ID >= 80021
+     {"set_load_data_local_infile_option",
+      (PyCFunction)MySQL_set_load_data_local_infile_option, METH_VARARGS,
+      "Set the load_data_local_infile_option for the current connection"},
++#endif
+     {"shutdown", (PyCFunction)MySQL_shutdown,
+      METH_VARARGS,
+      "Ask MySQL server to shut down"},
+--- mysql-connector-python-8.0.23/src/mysql_capi.c~	2022-04-28 15:39:05.000000000 +0200
++++ mysql-connector-python-8.0.23/src/mysql_capi.c	2022-04-28 15:39:52.313105545 +0200
+@@ -1204,13 +1204,13 @@ MySQL_connect(MySQL *self, PyObject *arg
+ 	if (local_infile == 1) {
+ 		unsigned int accept= 1;
+ 		mysql_options(&self->session, MYSQL_OPT_LOCAL_INFILE, &accept);
+-
++#if MYSQL_VERSION_ID >= 80021
+ 	} else if (local_infile == 0 && load_data_local_dir != NULL) {
+ 		if (load_data_local_dir != NULL){
+ 			mysql_options(&self->session, MYSQL_OPT_LOAD_DATA_LOCAL_DIR,
+                           load_data_local_dir);
+ 		}
+-
++#endif
+ 	} else {
+ 		unsigned int denied= 0;
+ 		mysql_options(&self->session, MYSQL_OPT_LOCAL_INFILE, &denied);
diff --git a/force-capi.patch b/force-capi.patch
new file mode 100644
index 0000000..4e5928f
--- /dev/null
+++ b/force-capi.patch
@@ -0,0 +1,20 @@
+--- mysql-connector-python-8.0.23/cpydist/__init__.py~	2020-12-16 07:04:09.000000000 +0100
++++ mysql-connector-python-8.0.23/cpydist/__init__.py	2022-04-28 14:15:47.843105028 +0200
+@@ -107,7 +107,7 @@ class BaseCommand(Command):
+     user_options = COMMON_USER_OPTIONS + CEXT_OPTIONS
+     boolean_options = ["debug", "byte_code_only", "keep-temp"]
+ 
+-    with_mysql_capi = None
++    with_mysql_capi = "/usr"
+     with_mysqlxpb_cext = False
+ 
+     with_openssl_include_dir = None
+@@ -135,7 +135,7 @@ class BaseCommand(Command):
+ 
+     def initialize_options(self):
+         """Initialize the options."""
+-        self.with_mysql_capi = None
++        self.with_mysql_capi = "/usr"
+         self.with_mysqlxpb_cext = False
+         self.with_openssl_include_dir = None
+         self.with_openssl_lib_dir = None
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/python-mysql-connector.git/commitdiff/c42c644a0369bd2874cf56c8b479090033a5035d



More information about the pld-cvs-commit mailing list