diff --git a/mysql-connector-python-rpath.patch b/mysql-connector-python-rpath.patch new file mode 100644 index 0000000..7f9e0d0 --- /dev/null +++ b/mysql-connector-python-rpath.patch @@ -0,0 +1,13 @@ +diff -Naur mysql-connector-python-8.0.33-src/cpydist/__init__.py mysql-connector-python_patched/cpydist/__init__.py +--- mysql-connector-python-8.0.33-src/cpydist/__init__.py 2023-03-30 12:58:04.000000000 +0200 ++++ mysql-connector-python_patched/cpydist/__init__.py 2025-07-21 09:21:19.084953101 +0200 +@@ -722,9 +722,6 @@ + # Add extra link args + if self.extra_link_args: + ext.extra_link_args.extend(self.extra_link_args.split()) +- # Add -rpath if the platform is Linux +- if platform.system() == "Linux" and not self.skip_vendor: +- ext.extra_link_args.extend(["-Wl,-rpath,$ORIGIN/mysql/vendor"]) + # Add include dirs + if self.with_openssl_include_dir: + ext.include_dirs.append(self.with_openssl_include_dir) diff --git a/mysql-connector-python.spec b/mysql-connector-python.spec index b1c4eb7..e4bd660 100644 --- a/mysql-connector-python.spec +++ b/mysql-connector-python.spec @@ -37,6 +37,8 @@ URL: http://dev.mysql.com/doc/connector-python/en/index.html # generate-modified-sources.sh script available in this repo Source0: %{name}-%{version}-src-without-fonts.tar.gz +Patch0: %{name}-rpath.patch + BuildRequires: python3-devel >= 3 BuildRequires: gcc-c++ # for building the extension modules @@ -83,6 +85,7 @@ Documentation: http://dev.mysql.com/doc/connector-python/en/index.html %prep %setup -q -n %{name}-%{version}-src chmod -x examples/*py +%patch -P0 -p1 %build export MYSQL_CAPI=%{_prefix} # searches for bin/mysql_config in here, enables the extension module