[Python-modules-commits] [python-datrie] 03/03: Don't use bundled libdatrie

Filip Pytloun fpytloun-guest at moszumanska.debian.org
Tue Sep 12 11:14:40 UTC 2017


This is an automated email from the git hooks/post-receive script.

fpytloun-guest pushed a commit to branch master
in repository python-datrie.

commit 6a39e60c6f7c1e072e6079e4bb1cd1dc2c2c5f99
Author: Filip Pytloun <filip at pytloun.cz>
Date:   Tue Sep 12 12:20:17 2017 +0200

    Don't use bundled libdatrie
---
 MANIFEST.in                                        |   2 -
 debian/.git-dpm                                    |   4 +-
 debian/control                                     |  15 ++-
 .../patches/0002-Don-t-use-bundled-libdatrie.patch | 119 +++++++++++++++++++++
 debian/patches/series                              |   1 +
 debian/rules                                       |   3 +
 setup.py                                           |   8 +-
 src/cdatrie.c                                      |   6 +-
 src/cdatrie.pxd                                    |   6 +-
 src/datrie.c                                       |   6 +-
 10 files changed, 141 insertions(+), 29 deletions(-)

diff --git a/MANIFEST.in b/MANIFEST.in
index 4279900..a077ffe 100644
--- a/MANIFEST.in
+++ b/MANIFEST.in
@@ -4,8 +4,6 @@ include COPYING
 include tox.ini
 include tox-bench.ini
 include update_c.sh
-recursive-include libdatrie *.h
-recursive-include libdatrie *.c
 include tests/words100k.txt.zip
 recursive-include tests *.py
 
diff --git a/debian/.git-dpm b/debian/.git-dpm
index cb196c9..8c04022 100644
--- a/debian/.git-dpm
+++ b/debian/.git-dpm
@@ -1,6 +1,6 @@
 # see git-dpm(1) from git-dpm package
-8adadbf1e0a450a6efc0f2abb76b94f4972a8afb
-8adadbf1e0a450a6efc0f2abb76b94f4972a8afb
+ab5580d59753f802f2b7c2be154ed2e821862fdc
+ab5580d59753f802f2b7c2be154ed2e821862fdc
 2a0b14f84a2b1c84d01e5e90a0f9cd22197402f5
 2a0b14f84a2b1c84d01e5e90a0f9cd22197402f5
 python-datrie_0.7.1.orig.tar.gz
diff --git a/debian/control b/debian/control
index 08c31f2..7d50133 100644
--- a/debian/control
+++ b/debian/control
@@ -2,9 +2,10 @@ Source: python-datrie
 Maintainer: Filip Pytloun <filip at pytloun.cz>
 Section: python
 Priority: optional
-Build-Depends: debhelper (>= 10),
+Build-Depends: cython,
+               debhelper (>= 10),
                dh-python,
-               libdatrie-dev,
+               libdatrie-dev (>= 0.2.10-6),
                python-all-dev,
                python-hypothesis,
                python-pytest,
@@ -12,7 +13,7 @@ Build-Depends: debhelper (>= 10),
                python3-all-dev,
                python3-hypothesis,
                python3-pytest,
-               python3-setuptools,
+               python3-setuptools
 Standards-Version: 4.0.0
 Testsuite: autopkgtest-pkg-python
 Homepage: https://github.com/kmike/datrie
@@ -23,9 +24,7 @@ X-Python3-Version: >= 3.3
 
 Package: python-datrie
 Architecture: any
-Depends: ${misc:Depends},
-         ${python:Depends},
-         ${shlibs:Depends},
+Depends: ${misc:Depends}, ${python:Depends}, ${shlibs:Depends}
 Description: Super-fast, efficiently stored Trie for Python
  trie variable is a dict-like object that can have unicode keys of certain
  ranges and Python objects as values.
@@ -39,9 +38,7 @@ Description: Super-fast, efficiently stored Trie for Python
 
 Package: python3-datrie
 Architecture: any
-Depends: ${misc:Depends},
-         ${python3:Depends},
-         ${shlibs:Depends},
+Depends: ${misc:Depends}, ${python3:Depends}, ${shlibs:Depends}
 Description: Super-fast, efficiently stored Trie for Python 3
  trie variable is a dict-like object that can have unicode keys of certain
  ranges and Python objects as values.
diff --git a/debian/patches/0002-Don-t-use-bundled-libdatrie.patch b/debian/patches/0002-Don-t-use-bundled-libdatrie.patch
new file mode 100644
index 0000000..c9b9a10
--- /dev/null
+++ b/debian/patches/0002-Don-t-use-bundled-libdatrie.patch
@@ -0,0 +1,119 @@
+From ab5580d59753f802f2b7c2be154ed2e821862fdc Mon Sep 17 00:00:00 2001
+From: Filip Pytloun <filip at pytloun.cz>
+Date: Tue, 12 Sep 2017 11:11:38 +0200
+Subject: Don't use bundled libdatrie
+
+---
+ MANIFEST.in     | 2 --
+ setup.py        | 8 +-------
+ src/cdatrie.c   | 6 +++---
+ src/cdatrie.pxd | 6 +++---
+ src/datrie.c    | 6 +++---
+ 5 files changed, 10 insertions(+), 18 deletions(-)
+
+diff --git a/MANIFEST.in b/MANIFEST.in
+index 4279900..a077ffe 100644
+--- a/MANIFEST.in
++++ b/MANIFEST.in
+@@ -4,8 +4,6 @@ include COPYING
+ include tox.ini
+ include tox-bench.ini
+ include update_c.sh
+-recursive-include libdatrie *.h
+-recursive-include libdatrie *.c
+ include tests/words100k.txt.zip
+ recursive-include tests *.py
+ 
+diff --git a/setup.py b/setup.py
+index eea48b6..6aa8d95 100755
+--- a/setup.py
++++ b/setup.py
+@@ -6,9 +6,6 @@ import os
+ 
+ from setuptools import setup, Extension
+ 
+-LIBDATRIE_DIR = 'libdatrie'
+-LIBDATRIE_FILES = glob.glob(os.path.join(LIBDATRIE_DIR, "datrie", "*.c"))
+-
+ DESCRIPTION = __doc__
+ LONG_DESCRIPTION = open('README.rst').read() + open('CHANGES.rst').read()
+ LICENSE = 'LGPLv2+'
+@@ -43,14 +40,11 @@ setup(name="datrie",
+       license=LICENSE,
+       url='https://github.com/kmike/datrie',
+       classifiers=CLASSIFIERS,
+-      libraries=[('libdatrie', {
+-          "sources": LIBDATRIE_FILES,
+-          "include_dirs": [LIBDATRIE_DIR]})],
+       ext_modules=[
+           Extension("datrie", [
+               'src/datrie.c',
+               'src/cdatrie.c',
+               'src/stdio_ext.c'
+-          ], include_dirs=[LIBDATRIE_DIR])
++          ], libraries=['datrie'])
+       ],
+       tests_require=["pytest", "hypothesis"])
+diff --git a/src/cdatrie.c b/src/cdatrie.c
+index 83f30a6..43324e8 100644
+--- a/src/cdatrie.c
++++ b/src/cdatrie.c
+@@ -238,9 +238,9 @@ static CYTHON_INLINE float __PYX_NAN() {
+ #define __PYX_HAVE_API__cdatrie
+ #include "string.h"
+ #include "stdio.h"
+-#include "../libdatrie/datrie/triedefs.h"
+-#include "../libdatrie/datrie/alpha-map.h"
+-#include "../libdatrie/datrie/trie.h"
++#include "triedefs.h"
++#include "alpha-map.h"
++#include "trie.h"
+ #ifdef _OPENMP
+ #include <omp.h>
+ #endif /* _OPENMP */
+diff --git a/src/cdatrie.pxd b/src/cdatrie.pxd
+index 6a33393..f0414e5 100644
+--- a/src/cdatrie.pxd
++++ b/src/cdatrie.pxd
+@@ -1,13 +1,13 @@
+ # cython: profile=False
+ from libc cimport stdio
+ 
+-cdef extern from "../libdatrie/datrie/triedefs.h":
++cdef extern from "/usr/include/datrie/triedefs.h":
+     ctypedef int AlphaChar # it should be utf32 letter
+     ctypedef unsigned char TrieChar  # 1 byte
+     ctypedef int TrieIndex
+     ctypedef int TrieData  # int
+ 
+-cdef extern from "../libdatrie/datrie/alpha-map.h":
++cdef extern from "/usr/include/datrie/alpha-map.h":
+ 
+     struct AlphaMap:
+         pass
+@@ -20,7 +20,7 @@ cdef extern from "../libdatrie/datrie/alpha-map.h":
+     int alpha_char_strlen (AlphaChar *str)
+ 
+ 
+-cdef extern from "../libdatrie/datrie/trie.h":
++cdef extern from "/usr/include/datrie/trie.h":
+ 
+     ctypedef struct Trie:
+         pass
+diff --git a/src/datrie.c b/src/datrie.c
+index 848d7c7..565cda5 100644
+--- a/src/datrie.c
++++ b/src/datrie.c
+@@ -239,9 +239,9 @@ static CYTHON_INLINE float __PYX_NAN() {
+ #include "string.h"
+ #include "stdlib.h"
+ #include "stdio.h"
+-#include "../libdatrie/datrie/triedefs.h"
+-#include "../libdatrie/datrie/alpha-map.h"
+-#include "../libdatrie/datrie/trie.h"
++#include "triedefs.h"
++#include "alpha-map.h"
++#include "trie.h"
+ #ifdef _OPENMP
+ #include <omp.h>
+ #endif /* _OPENMP */
diff --git a/debian/patches/series b/debian/patches/series
index 2c9265a..fcb5421 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -1 +1,2 @@
 0001-Don-t-require-pytest-running-on-regular-setup.patch
+0002-Don-t-use-bundled-libdatrie.patch
diff --git a/debian/rules b/debian/rules
index 3a94e99..189170b 100755
--- a/debian/rules
+++ b/debian/rules
@@ -4,3 +4,6 @@ export PYBUILD_NAME=datrie
 %:
 	dh $@ --with python2,python3 --buildsystem=pybuild
 
+override_dh_auto_build:
+	cython src/datrie.pyx src/cdatrie.pxd src/stdio_ext.pxd
+	dh_auto_build
diff --git a/setup.py b/setup.py
index eea48b6..6aa8d95 100755
--- a/setup.py
+++ b/setup.py
@@ -6,9 +6,6 @@ import os
 
 from setuptools import setup, Extension
 
-LIBDATRIE_DIR = 'libdatrie'
-LIBDATRIE_FILES = glob.glob(os.path.join(LIBDATRIE_DIR, "datrie", "*.c"))
-
 DESCRIPTION = __doc__
 LONG_DESCRIPTION = open('README.rst').read() + open('CHANGES.rst').read()
 LICENSE = 'LGPLv2+'
@@ -43,14 +40,11 @@ setup(name="datrie",
       license=LICENSE,
       url='https://github.com/kmike/datrie',
       classifiers=CLASSIFIERS,
-      libraries=[('libdatrie', {
-          "sources": LIBDATRIE_FILES,
-          "include_dirs": [LIBDATRIE_DIR]})],
       ext_modules=[
           Extension("datrie", [
               'src/datrie.c',
               'src/cdatrie.c',
               'src/stdio_ext.c'
-          ], include_dirs=[LIBDATRIE_DIR])
+          ], libraries=['datrie'])
       ],
       tests_require=["pytest", "hypothesis"])
diff --git a/src/cdatrie.c b/src/cdatrie.c
index 83f30a6..43324e8 100644
--- a/src/cdatrie.c
+++ b/src/cdatrie.c
@@ -238,9 +238,9 @@ static CYTHON_INLINE float __PYX_NAN() {
 #define __PYX_HAVE_API__cdatrie
 #include "string.h"
 #include "stdio.h"
-#include "../libdatrie/datrie/triedefs.h"
-#include "../libdatrie/datrie/alpha-map.h"
-#include "../libdatrie/datrie/trie.h"
+#include "triedefs.h"
+#include "alpha-map.h"
+#include "trie.h"
 #ifdef _OPENMP
 #include <omp.h>
 #endif /* _OPENMP */
diff --git a/src/cdatrie.pxd b/src/cdatrie.pxd
index 6a33393..f0414e5 100644
--- a/src/cdatrie.pxd
+++ b/src/cdatrie.pxd
@@ -1,13 +1,13 @@
 # cython: profile=False
 from libc cimport stdio
 
-cdef extern from "../libdatrie/datrie/triedefs.h":
+cdef extern from "/usr/include/datrie/triedefs.h":
     ctypedef int AlphaChar # it should be utf32 letter
     ctypedef unsigned char TrieChar  # 1 byte
     ctypedef int TrieIndex
     ctypedef int TrieData  # int
 
-cdef extern from "../libdatrie/datrie/alpha-map.h":
+cdef extern from "/usr/include/datrie/alpha-map.h":
 
     struct AlphaMap:
         pass
@@ -20,7 +20,7 @@ cdef extern from "../libdatrie/datrie/alpha-map.h":
     int alpha_char_strlen (AlphaChar *str)
 
 
-cdef extern from "../libdatrie/datrie/trie.h":
+cdef extern from "/usr/include/datrie/trie.h":
 
     ctypedef struct Trie:
         pass
diff --git a/src/datrie.c b/src/datrie.c
index 848d7c7..565cda5 100644
--- a/src/datrie.c
+++ b/src/datrie.c
@@ -239,9 +239,9 @@ static CYTHON_INLINE float __PYX_NAN() {
 #include "string.h"
 #include "stdlib.h"
 #include "stdio.h"
-#include "../libdatrie/datrie/triedefs.h"
-#include "../libdatrie/datrie/alpha-map.h"
-#include "../libdatrie/datrie/trie.h"
+#include "triedefs.h"
+#include "alpha-map.h"
+#include "trie.h"
 #ifdef _OPENMP
 #include <omp.h>
 #endif /* _OPENMP */

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/python-modules/packages/python-datrie.git



More information about the Python-modules-commits mailing list