Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion addon/globalPlugins/MathCAT/MathCAT.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
import winKernel
import gui

from . import libmathcat_py as libmathcat
from ._libmathcat_loader import libmathcat
from typing import Type
from collections.abc import Generator, Callable
from keyboardHandler import KeyboardInputGesture # navigation key strokes
Expand Down
2 changes: 1 addition & 1 deletion addon/globalPlugins/MathCAT/MathCATPreferences.py
Original file line number Diff line number Diff line change
Expand Up @@ -808,7 +808,7 @@ def writeUserPreferences() -> None:
folder exists, and saves the preferences to disk.
"""
# Language is special because it is set elsewhere by SetPreference which overrides the user_prefs -- so set it here
from . import libmathcat_py as libmathcat
from ._libmathcat_loader import libmathcat

try:
libmathcat.SetPreference("Language", userPreferences["Speech"]["Language"])
Expand Down
19 changes: 19 additions & 0 deletions addon/globalPlugins/MathCAT/_libmathcat_loader.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# -*- coding: UTF-8 -*-

"""Loads the libmathcat_py extension module matching the running process's bitness.

Both a 32-bit and a 64-bit build of libmathcat_py ship in this addon so a single
package works under both 32-bit and 64-bit NVDA.
"""

import importlib.util
import os
import sys

# checking for 64 vs 32-bit: https://docs.python.org/3/library/platform.html#cross-platform
_bitness = "x64" if sys.maxsize > 2**32 else "x86"
_pyd_path = os.path.join(os.path.dirname(__file__), f"libmathcat_py_{_bitness}.pyd")

_spec = importlib.util.spec_from_file_location("libmathcat_py", _pyd_path)
libmathcat = importlib.util.module_from_spec(_spec)
_spec.loader.exec_module(libmathcat)
Binary file removed addon/globalPlugins/MathCAT/libmathcat_py.pyd
Binary file not shown.
Binary file added addon/globalPlugins/MathCAT/libmathcat_py_x64.pyd
Binary file not shown.
2 changes: 1 addition & 1 deletion build-nvda-addon.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ STFLAGS='-C linker=lld'
PYO3_PYTHON=$YO3_PYTHON_32/python.exe STFLAGS="$STFLAGS" cargo build --target i686-pc-windows-msvc --release


cp target/i686-pc-windows-msvc/release/libmathcat_py.dll addon/globalPlugins/MathCAT/libmathcat_py.pyd
cp target/i686-pc-windows-msvc/release/libmathcat_py.dll addon/globalPlugins/MathCAT/libmathcat_py_x86.pyd

# for testing
cp target/i686-pc-windows-msvc/release/libmathcat_py.dll Example/libmathcat_py.pyd
Expand Down
4 changes: 2 additions & 2 deletions build64-nvda-addon.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ echo "before cargo build"
PYO3_PYTHON=${PYO3_PYTHON_64}/python.exe STFLAGS="$STFLAGS" cargo build --target x86_64-pc-windows-msvc --release
echo "after cargo build"

echo "before cp target/x86_64-pc-windows-msvc/release/libmathcat_py.dll addon/globalPlugins/MathCAT/libmathcat_py.pyd"
echo "before cp target/x86_64-pc-windows-msvc/release/libmathcat_py.dll addon/globalPlugins/MathCAT/libmathcat_py_x64.pyd"

cp target/x86_64-pc-windows-msvc/release/libmathcat_py.dll addon/globalPlugins/MathCAT/libmathcat_py.pyd
cp target/x86_64-pc-windows-msvc/release/libmathcat_py.dll addon/globalPlugins/MathCAT/libmathcat_py_x64.pyd

# for testing
cp target/x86_64-pc-windows-msvc/release/libmathcat_py.dll Example/libmathcat_py.pyd
Expand Down
2 changes: 1 addition & 1 deletion buildVars.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ def _(arg):
# Documentation file name
"addon_docFileName": "readme.html",
# Minimum NVDA version supported (e.g. "2018.3.0", minor version is optional)
"addon_minimumNVDAVersion": "2026.1",
"addon_minimumNVDAVersion": "2025.1",
# Last NVDA version supported/tested (e.g. "2018.4.0", ideally more recent than minimum version)
"addon_lastTestedNVDAVersion": "2026.1",
# Add-on update channel (default is None, denoting stable releases,
Expand Down