Compare commits

..

10 Commits

Author SHA1 Message Date
openeuler-ci-bot
49e95c40d2
!10 update to version 1.5.5.1
From: @wang--ge 
Reviewed-by: @cherry530 
Signed-off-by: @cherry530
2023-04-07 08:10:53 +00:00
wang--ge
624fe0deee update to version 1.5.5.1 2023-04-07 02:09:05 +08:00
openeuler-ci-bot
1ba284550a
!9 Update package to version 1.5.4.0
From: @wubijie123 
Reviewed-by: @yangzhao_kl 
Signed-off-by: @yangzhao_kl
2023-03-02 02:18:25 +00:00
wubijie
5b1339c87c Update package to version 1.5.4.0 2023-02-27 15:10:23 +08:00
openeuler-ci-bot
23ff4a3f43
!8 Upgrade package to version 1.5.2.6
From: @ccdxx 
Reviewed-by: @yangzhao_kl 
Signed-off-by: @yangzhao_kl
2022-12-14 01:40:42 +00:00
chendexi
d5fdf99683 Upgrade package to version 1.5.2.6 2022-12-09 16:53:25 +08:00
openeuler-ci-bot
498353c7b5
!6 Update package
From: @liqiuyu123 
Reviewed-by: @yangzhao_kl 
Signed-off-by: @yangzhao_kl
2022-08-10 08:23:35 +00:00
liqiuyu123
aad8a6a59a update package 2022-08-10 14:31:36 +08:00
openeuler-ci-bot
e167103524
!5 upgrade the version to 1.5.1.0
From: @huyuqi2 
Reviewed-by: @shinwell_hu 
Signed-off-by: @shinwell_hu
2022-06-28 06:28:15 +00:00
yuqi
da6a8c5ec5 Upgrade the version of python-zstd to 1.5.1.0 2022-06-16 11:24:55 +00:00
4 changed files with 62 additions and 120 deletions

View File

@ -1,102 +0,0 @@
From 8242ae139f70a228bbcd8e7ca28f235ec0654180 Mon Sep 17 00:00:00 2001
From: Sergey Dryabzhinsky <sergey.dryabzhinsky@gmail.com>
Date: Fri, 16 Apr 2021 21:40:23 +0300
Subject: [PATCH] fix python3.8+ use py_ssize_t type
---
src/python-zstd.c | 23 ++++++++++++++---------
1 file changed, 14 insertions(+), 9 deletions(-)
diff --git a/src/python-zstd.c b/src/python-zstd.c
index 1cf7b61..9ce1577 100644
--- a/src/python-zstd.c
+++ b/src/python-zstd.c
@@ -29,13 +29,16 @@
#include <stdlib.h>
#include <stddef.h>
+
+/* Since 3.8 it is mandatory to use proper type for # formats */
+#define PY_SSIZE_T_CLEAN
#include <Python.h>
+
#include "bytesobject.h"
#include "zstd.h"
#include "util.h"
#include "python-zstd.h"
-
/**
* New function for multi-threaded compression.
* Uses origin zstd header, nothing more.
@@ -47,12 +50,13 @@ static PyObject *py_zstd_compress_mt(PyObject* self, PyObject *args)
PyObject *result;
const char *source;
- uint32_t source_size;
+ Py_ssize_t source_size;
char *dest;
- uint32_t dest_size;
+ Py_ssize_t dest_size;
size_t cSize;
int32_t level = ZSTD_CLEVEL_DEFAULT;
int32_t threads = 0;
+ ZSTD_CCtx* cctx = 0;
#if PY_MAJOR_VERSION >= 3
if (!PyArg_ParseTuple(args, "y#|ii", &source, &source_size, &level, &threads))
@@ -87,7 +91,7 @@ static PyObject *py_zstd_compress_mt(PyObject* self, PyObject *args)
return NULL;
}
- dest_size = ZSTD_compressBound(source_size);
+ dest_size = (Py_ssize_t)ZSTD_compressBound(source_size);
result = PyBytes_FromStringAndSize(NULL, dest_size);
if (result == NULL) {
return NULL;
@@ -96,12 +100,13 @@ static PyObject *py_zstd_compress_mt(PyObject* self, PyObject *args)
if (source_size > 0) {
dest = PyBytes_AS_STRING(result);
- ZSTD_CCtx* cctx = ZSTD_createCCtx();
+ cctx = ZSTD_createCCtx();
+
ZSTD_CCtx_setParameter(cctx, ZSTD_c_compressionLevel, level);
ZSTD_CCtx_setParameter(cctx, ZSTD_c_nbWorkers, threads);
Py_BEGIN_ALLOW_THREADS
- cSize = ZSTD_compress2(cctx, dest, dest_size, source, source_size);
+ cSize = ZSTD_compress2(cctx, dest, (size_t)dest_size, source, (size_t)source_size);
Py_END_ALLOW_THREADS
ZSTD_freeCCtx(cctx);
@@ -126,7 +131,7 @@ static PyObject *py_zstd_uncompress(PyObject* self, PyObject *args)
PyObject *result;
const char *source;
- uint32_t source_size;
+ Py_ssize_t source_size;
uint64_t dest_size;
char error = 0;
size_t cSize;
@@ -233,7 +238,7 @@ static PyObject *py_zstd_compress_old(PyObject* self, PyObject *args) {
PyObject *result;
const char *source;
- uint32_t source_size;
+ Py_ssize_t source_size;
char *dest;
uint32_t dest_size;
size_t cSize;
@@ -289,7 +294,7 @@ static PyObject *py_zstd_uncompress_old(PyObject* self, PyObject *args) {
PyObject *result;
const char *source;
- uint32_t source_size;
+ Py_ssize_t source_size;
uint32_t dest_size;
size_t cSize;
--
2.27.0

View File

@ -1,17 +1,11 @@
%global _empty_manifest_terminate_build 0
Name: python-zstd
Version: 1.4.8.1
Release: 3
Version: 1.5.5.1
Release: 1
Summary: ZSTD Bindings for Python
License: BSD-2-Clause
URL: https://github.com/sergey-dryabzhinsky/python-zstd
Source0: https://files.pythonhosted.org/packages/92/bc/6bc155c61db55d5b3111a8afc76aaec084372bde89a82ecd4f5fd96c639a/zstd-1.4.8.1.tar.gz
# https://github.com/sergey-dryabzhinsky/python-zstd/commit/428a31edcde94d2908aa8ca3439ca01a797de3a4
Patch1: fix-python3.8+-use-py_ssize_t-type.patch
BuildRequires: gcc
BuildRequires: python3-devel
BuildRequires: python3-setuptools
Source0: https://files.pythonhosted.org/packages/ba/b4/bf8c6a6b73c6b267a13df955f821f041fcc770b56820b135849f33e3b888/zstd-1.5.5.1.tar.gz
%description
Simple Python bindings for the Zstd compression library.
@ -19,29 +13,79 @@ Simple Python bindings for the Zstd compression library.
%package -n python3-zstd
Summary: %{summary}
Provides: python3-zstd
# The library does not do symbol versioning to fully match automatically on
# Base build requires
BuildRequires: gcc
BuildRequires: python3-devel
BuildRequires: python3-setuptools
BuildRequires: python3-cffi
%description -n python3-zstd
Simple Python bindings for the Zstd compression library.
%package help
Summary: ZSTD Bindings for Python
Provides: python3-zstd-doc
%description help
Simple Python bindings for the Zstd compression library.
%prep
%autosetup -n zstd-1.4.8.1 -p1
%autosetup -n zstd-%{version}
%build
%py3_build
%install
%py3_install
install -d -m755 %{buildroot}/%{_pkgdocdir}
if [ -d doc ]; then cp -arf doc %{buildroot}/%{_pkgdocdir}; fi
if [ -d docs ]; then cp -arf docs %{buildroot}/%{_pkgdocdir}; fi
if [ -d example ]; then cp -arf example %{buildroot}/%{_pkgdocdir}; fi
if [ -d examples ]; then cp -arf examples %{buildroot}/%{_pkgdocdir}; fi
pushd %{buildroot}
if [ -d usr/lib ]; then
find usr/lib -type f -printf "/%h/%f\n" >> filelist.lst
fi
if [ -d usr/lib64 ]; then
find usr/lib64 -type f -printf "/%h/%f\n" >> filelist.lst
fi
if [ -d usr/bin ]; then
find usr/bin -type f -printf "/%h/%f\n" >> filelist.lst
fi
if [ -d usr/sbin ]; then
find usr/sbin -type f -printf "/%h/%f\n" >> filelist.lst
fi
touch doclist.lst
if [ -d usr/share/man ]; then
find usr/share/man -type f -printf "/%h/%f.gz\n" >> doclist.lst
fi
popd
mv %{buildroot}/filelist.lst .
mv %{buildroot}/doclist.lst .
%check
%{__python3} setup.py test
%files -n python3-zstd
%license LICENSE
%doc README.rst
%{python3_sitearch}/zstd-1.4.8.1-py%{python3_version}.egg-info
%{python3_sitearch}/zstd*.so
%files -n python3-zstd -f filelist.lst
%dir %{python3_sitearch}/*
%files help -f doclist.lst
%{_docdir}/*
%changelog
* Fri Apr 07 2023 Ge Wang <wang__ge@126.com> - 1.5.5.1-1
- Update to version 1.5.5.1
* Mon Feb 27 2023 wubijie <wubijie@kylinos.cn> - 1.5.4.0-1
- Update package to version 1.5.4.0
* Fri Dec 09 2022 chendexi <chendexi@kylinos.cn> - 1.5.2.6-1
- Upgrade package to version 1.5.2.6
* Wed Aug 10 2022 liqiuyu <liqiuyu@kylinos.cn> - 1.5.2.5-1
- update to 1.5.2.5
* Fri Jun 03 2022 OpenStack_SIG <openstack@openeuler.org> - 1.5.1.0-1
- Upgrade python3-zstd to version 1.5.1.0
* Tue May 10 2022 yangping <yangping69@h-partners> - 1.4.8.1-3
- License compliance rectification

Binary file not shown.

BIN
zstd-1.5.5.1.tar.gz Normal file

Binary file not shown.