Skip to content

Commit

Permalink
patch hunspell to hopefully build on python 3.12
Browse files Browse the repository at this point in the history
  • Loading branch information
bhearsum committed Jan 10, 2025
1 parent 416f717 commit 1e1afb2
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 0 deletions.
3 changes: 3 additions & 0 deletions taskcluster/kinds/toolchain/kind.yml
Original file line number Diff line number Diff line change
Expand Up @@ -143,8 +143,11 @@ tasks:
description: build cyhunspell binary wheel
run:
script: build-hunspell.sh
arguments:
- hunspell.patch
resources:
- taskcluster/scripts/toolchain/build-hunspell.sh
- taskcluster/scripts/toolchain/hunspell.patch
toolchain-artifact: public/build/cyhunspell-2.0.3-cp312-cp312-linux_x86_64.whl
fetches:
fetch:
Expand Down
10 changes: 10 additions & 0 deletions taskcluster/scripts/toolchain/build-hunspell.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,18 @@
set -e
set -x

pushd `dirname $0` &>/dev/null
MY_DIR=$(pwd)
popd &>/dev/null

patch=${1:-none}

HUNSPELL_DIR=$MOZ_FETCHES_DIR/hunspell

if [ "$patch" != "none" ]; then
patch -d ${HUNSPELL_DIR} -p1 < ${MY_DIR}/${patch}
fi

cd $HUNSPELL_DIR
python3 setup.py bdist_wheel
whl=$(ls dist/*.whl)
Expand Down
23 changes: 23 additions & 0 deletions taskcluster/scripts/toolchain/hunspell.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
diff --git a/hunspell/hunspell.cpp b/hunspell/hunspell.cpp
index 27ff298..efccd2e 100644
--- a/hunspell/hunspell.cpp
+++ b/hunspell/hunspell.cpp
@@ -229,17 +229,17 @@ END: Cython Metadata */
#define CYTHON_USE_ASYNC_SLOTS 0
#elif !defined(CYTHON_USE_ASYNC_SLOTS)
#define CYTHON_USE_ASYNC_SLOTS 1
#endif
#if PY_VERSION_HEX < 0x02070000
#undef CYTHON_USE_PYLONG_INTERNALS
#define CYTHON_USE_PYLONG_INTERNALS 0
#elif !defined(CYTHON_USE_PYLONG_INTERNALS)
- #define CYTHON_USE_PYLONG_INTERNALS 1
+ #define CYTHON_USE_PYLONG_INTERNALS (PY_VERSION_HEX < 0x030C00A5)
#endif
#ifndef CYTHON_USE_PYLIST_INTERNALS
#define CYTHON_USE_PYLIST_INTERNALS 1
#endif
#ifndef CYTHON_USE_UNICODE_INTERNALS
#define CYTHON_USE_UNICODE_INTERNALS 1
#endif
#if PY_VERSION_HEX < 0x030300F0 || PY_VERSION_HEX >= 0x030B00A2

0 comments on commit 1e1afb2

Please sign in to comment.