15
0
forked from pool/python-datrie

Accepting request 587589 from home:oertel:branches:devel:languages:python

- add datrie-bigendian.patch (bsc#1085526)
  to use utf_32_be instead of utf_32_le on bigendian machines

OBS-URL: https://build.opensuse.org/request/show/587589
OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-datrie?expand=0&rev=6
This commit is contained in:
Tomáš Chvátal
2018-03-15 17:47:31 +00:00
committed by Git OBS Bridge
parent 49447eb114
commit 456242602c
3 changed files with 28 additions and 1 deletions

15
datrie-bigendian.patch Normal file
View File

@@ -0,0 +1,15 @@
--- datrie-0.7.1/src/datrie.pyx 2018/03/15 17:07:17 1.1
+++ datrie-0.7.1/src/datrie.pyx 2018/03/15 17:09:19
@@ -1108,8 +1108,10 @@
if length == 0:
length = cdatrie.alpha_char_strlen(key)*sizeof(cdatrie.AlphaChar)
cdef char* c_str = <char*> key
- return c_str[:length].decode('utf_32_le')
-
+ if sys.byteorder == "big":
+ return c_str[:length].decode('utf_32_be')
+ else:
+ return c_str[:length].decode('utf_32_le')
def to_ranges(lst):
"""

View File

@@ -1,3 +1,9 @@
-------------------------------------------------------------------
Thu Mar 15 18:10:19 CET 2018 - ro@suse.de
- add datrie-bigendian.patch (bsc#1085526)
to use utf_32_be instead of utf_32_le on bigendian machines
-------------------------------------------------------------------
Tue Apr 11 10:17:10 UTC 2017 - jengelh@inai.de

View File

@@ -1,7 +1,7 @@
#
# spec file for package python-datrie
#
# Copyright (c) 2017 SUSE LINUX GmbH, Nuernberg, Germany.
# Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
@@ -25,6 +25,8 @@ License: LGPL-2.1+
Group: Development/Languages/Python
Url: https://github.com/kmike/datrie
Source: https://files.pythonhosted.org/packages/source/d/datrie/datrie-%{version}.tar.gz
Patch0: datrie-bigendian.patch
BuildRequires: %{python_module Cython >= 0.26.1}
BuildRequires: %{python_module devel}
BuildRequires: %{python_module hypothesis}
BuildRequires: %{python_module pytest-runner}
@@ -40,6 +42,10 @@ A trie data structure for Python (2.x and 3.x). Uses libdatrie.
%prep
%setup -q -n datrie-%{version}
%patch0 -p1
pushd src
cython datrie.pyx
popd
%build
%python_build