From 0001455c790adfebb79df2aed0726030def783a4 Mon Sep 17 00:00:00 2001 From: Funda Wang Date: Tue, 11 Apr 2023 19:22:51 +0800 Subject: [PATCH] link C module with libpython --- link-C-modules-with-libpython.patch | 13 +++++++++++++ python-setuptools.spec | 8 ++++++-- 2 files changed, 19 insertions(+), 2 deletions(-) create mode 100644 link-C-modules-with-libpython.patch diff --git a/link-C-modules-with-libpython.patch b/link-C-modules-with-libpython.patch new file mode 100644 index 0000000..7e46b88 --- /dev/null +++ b/link-C-modules-with-libpython.patch @@ -0,0 +1,13 @@ +diff --git a/setuptools/_distutils/command/build_ext.py b/setuptools/_distutils/command/build_ext.py +index 1a6dd39..c4ad11e 100644 +--- a/setuptools/_distutils/command/build_ext.py ++++ b/setuptools/_distutils/command/build_ext.py +@@ -759,7 +759,7 @@ class build_ext(Command): + # shared libraries are resolved at link time. + from distutils.sysconfig import get_config_var + +- link_libpython = False ++ link_libpython = True + if get_config_var('Py_ENABLE_SHARED'): + # A native build on an Android device or on Cygwin + if hasattr(sys, 'getandroidapilevel'): diff --git a/python-setuptools.spec b/python-setuptools.spec index a5f0f6a..fdcdced 100644 --- a/python-setuptools.spec +++ b/python-setuptools.spec @@ -1,4 +1,4 @@ -%define anolis_release 1 +%define anolis_release 2 %bcond_with tests %global srcname setuptools @@ -13,7 +13,8 @@ License: MIT and ASL 2.0 and (BSD or ASL 2.0) and Python URL: https://pypi.python.org/pypi/%{srcname} Source0: %{pypi_source %{srcname} %{version}} -Patch0: Remove-optional-or-unpackaged-test-deps.patch +Patch0: Remove-optional-or-unpackaged-test-deps.patch +Patch1: link-C-modules-with-libpython.patch BuildArch: noarch BuildRequires: python3-devel @@ -135,6 +136,9 @@ PYTHONPATH=$(pwd) %pytest \ %doc CHANGES.rst README.rst %changelog +* Tue Apr 11 2023 Funda Wang - 65.5.1-2 +- link C module with libpython + * Thu Feb 16 2023 mgb01105731 - 65.5.1-1 - update to version 65.5.1 -- Gitee