From 5d11149ba6e12a089172fa70c2cfb0f8be722a68 Mon Sep 17 00:00:00 2001 From: bipin kumar Date: Sun, 14 May 2023 11:32:58 +0530 Subject: [PATCH] python-ncls: Set cython language_level to 3 --- BioArchLinux/python-ncls/PKGBUILD | 13 ++++++++++--- BioArchLinux/python-ncls/cython3.patch | 18 ++++++++++++++++++ 2 files changed, 28 insertions(+), 3 deletions(-) create mode 100644 BioArchLinux/python-ncls/cython3.patch diff --git a/BioArchLinux/python-ncls/PKGBUILD b/BioArchLinux/python-ncls/PKGBUILD index 8ad307a01a..4a8f28d2ea 100644 --- a/BioArchLinux/python-ncls/PKGBUILD +++ b/BioArchLinux/python-ncls/PKGBUILD @@ -3,7 +3,7 @@ pkgname=python-ncls _module=${pkgname#python-} pkgver=0.0.67 -pkgrel=2 +pkgrel=3 pkgdesc="A wrapper for the nested containment list data structure" arch=('x86_64') url="https://github.com/biocore-ntnu/ncls" @@ -23,13 +23,20 @@ makedepends=( options=(!emptydirs) source=("https://files.pythonhosted.org/packages/source/${_module::1}/$_module/$_module-$pkgver.tar.gz" - "LICENSE") + "LICENSE" + "cython3.patch") sha256sums=('fa3e673d60e97bb021a516287d74bb959870cf9d910ec82403b99c443d8f447e' - '48186409eb1721726d28884f40346a8380a893e95a50bef75584e2e9c2d4fcd5') + '48186409eb1721726d28884f40346a8380a893e95a50bef75584e2e9c2d4fcd5' + '174a620d7dce0952e9e657ff40f25e73f0f5a9e38c96fffc91ccbc20805a7ee4') prepare() { cp LICENSE "$_module-$pkgver" + cp cython3.patch "$_module-$pkgver" rm "$_module-$pkgver"/ncls/src/{fncls.c,ncls.c,ncls32.c} + # Set cython language_level to 3 + cd "$_module-$pkgver" + patch -p1 < cython3.patch + } build() { diff --git a/BioArchLinux/python-ncls/cython3.patch b/BioArchLinux/python-ncls/cython3.patch new file mode 100644 index 0000000000..cb3a00865f --- /dev/null +++ b/BioArchLinux/python-ncls/cython3.patch @@ -0,0 +1,18 @@ +--- a/setup.py 2023-05-14 00:15:53.983680836 +0530 ++++ b/setup.py 2023-05-14 00:17:57.185420794 +0530 +@@ -63,12 +63,14 @@ + "ncls.src.fncls", ["ncls/src/fncls.pyx", "ncls/src/fintervaldb.c"], + # define_macros=macros, + include_dirs=include_dirs)] ++for e in extensions: ++ e.cython_directives = {'language_level': "3"} + + # using setuptools to cythonize if cython not found + # not recommended by cython docs, but still + try: + from Cython.Build import cythonize +- ext_modules = cythonize(extensions, language_level=2) ++ ext_modules = cythonize(extensions, compiler_directives={'language_level' : "3"}) + except ImportError: + print() + print("Warning: Cannot compile with Cython. Using legacy build.")