Fix compilation failure

This commit is contained in:
zhengxiaoxiao 2024-08-14 15:27:42 +08:00
parent 9a293d33a4
commit 901db1af44
2 changed files with 34 additions and 1 deletions

View File

@ -1,6 +1,6 @@
Name: PyPAM Name: PyPAM
Version: 0.5.0 Version: 0.5.0
Release: 4 Release: 5
Summary: PAM bindings for Python Summary: PAM bindings for Python
License: LGPLv2.1 License: LGPLv2.1
Url: http://www.pangalactic.org/PyPAM Url: http://www.pangalactic.org/PyPAM
@ -12,6 +12,7 @@ Patch0003: PyPAM-0.5.0-nofree.patch
Patch0004: PyPAM-0.5.0-memory-errors.patch Patch0004: PyPAM-0.5.0-memory-errors.patch
Patch0005: PyPAM-0.5.0-return-value.patch Patch0005: PyPAM-0.5.0-return-value.patch
Patch0006: PyPAM-python3-support.patch Patch0006: PyPAM-python3-support.patch
Patch0007: fix-compilcation-failed.patch
BuildRequires: python3-devel pam-devel gcc BuildRequires: python3-devel pam-devel gcc
%filter_provides_in %{python3_sitearch}/PAM*.so$ %filter_provides_in %{python3_sitearch}/PAM*.so$
@ -58,6 +59,9 @@ PYTHONPATH=build/lib.linux-`uname -m`-cpython-%{python3_version_nodots}/ %{__pyt
%doc NEWS README ChangeLog INSTALL examples %doc NEWS README ChangeLog INSTALL examples
%changelog %changelog
* Wed Aug 14 2024 zhengxiaoxiao <zhengxiaoxiao2@huawei.com> - 0.5.0-5
- Fix compilation failure
* Wed Jul 5 2023 liyanan <thistleslyn@163.com> - 0.5.0-4 * Wed Jul 5 2023 liyanan <thistleslyn@163.com> - 0.5.0-4
- Fix compilation failure caused by setuptool upgrade - Fix compilation failure caused by setuptool upgrade

View File

@ -0,0 +1,29 @@
From 766dd31a539ef8df187864c95999a4435f326c33 Mon Sep 17 00:00:00 2001
From: qsw333 <wangqingsan@huawei.com>
Date: Fri, 26 Jul 2024 15:57:17 +0800
Subject: [PATCH] fix compilcation failed
---
PAMmodule.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/PAMmodule.c b/PAMmodule.c
index a41d97b..7ca8fe0 100644
--- a/PAMmodule.c
+++ b/PAMmodule.c
@@ -674,8 +674,11 @@ void initPAM(void)
if (PyPAM_Error == NULL)
INITERROR;
PyDict_SetItemString(d, "error", PyPAM_Error);
-
+#if PY_VERSION_HEX >= 0x030a00f0
+ Py_SET_TYPE(&PyPAMObject_Type, &PyType_Type);
+#else
Py_TYPE(&PyPAMObject_Type) = &PyType_Type;
+#endif
PyPAMObject_Type.tp_doc = PyPAMObject_doc;
Py_INCREF(&PyPAMObject_Type);
--
2.33.0