Skip to content

Commit 138578b

Browse files
committed
Update so they work. Useful for local builds.
1 parent aa1d866 commit 138578b

2 files changed

Lines changed: 33 additions & 10 deletions

File tree

build-nvda-addon.sh

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,19 @@
1-
#!/bin/csh
2-
# RUN THIS FILE to build the NVDA addon
1+
#!/bin/bash
2+
(set -o igncr) 2>/dev/null && set -o igncr; # comment is needed
3+
PYO3_PYTHON_64=C:/Software/Python/Python313
4+
PYO3_PYTHON_32=C:/Software/Python/Python311-32
5+
STFLAGS='-C linker=lld'
6+
PYO3_PYTHON=$YO3_PYTHON_32/python.exe STFLAGS="$STFLAGS" cargo build --target i686-pc-windows-msvc --release
7+
38

4-
rm -rf addon/globalPlugins/MathCAT/Rules
5-
# NVDA currently uses 32 bit python 3.7
6-
# We need to tell PYO3 that
7-
set PYO3_PYTHON_64=C:/Software/Python311
8-
set PYO3_PYTHON_32=C:/Software/Python311-32
9-
env PYO3_PYTHON=$PYO3_PYTHON_32/python.exe cargo build --target i686-pc-windows-msvc --release
109
cp target/i686-pc-windows-msvc/release/libmathcat_py.dll addon/globalPlugins/MathCAT/libmathcat_py.pyd
10+
1111
# for testing
1212
cp target/i686-pc-windows-msvc/release/libmathcat_py.dll Example/libmathcat_py.pyd
1313
cp -r addon/globalPlugins/MathCAT/Rules Example
1414
sed 's/^import wx\.xrc/# import wx.xrc/' --in-place "addon/globalPlugins/MathCAT/MathCATgui.py"
15-
rm MathCAT-*.nvda-addon
15+
rm -f MathCAT-*.nvda-addon
1616

1717
# use "pip install SCons" to add scons to the python env
18-
$PYO3_PYTHON_32/Scripts/scons
18+
echo ${PYO3_PYTHON_32}
19+
${PYO3_PYTHON_32}/Scripts/scons

build64-nvda-addon.sh

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
#!/bin/bash
2+
(set -o igncr) 2>/dev/null && set -o igncr; # comment is needed
3+
PYO3_PYTHON_64=C:/Users/neils/AppData/Local/Python/pythoncore-3.13-64
4+
PYO3_PYTHON_32=C:/Software/Python/Python311-32
5+
export PYO3_PYTHON_64 PYO3_PYTHON_32
6+
STFLAGS='-C linker=lld'
7+
echo "before cargo build"
8+
PYO3_PYTHON=${PYO3_PYTHON_64}/python.exe STFLAGS="$STFLAGS" cargo build --target x86_64-pc-windows-msvc --release
9+
echo "after cargo build"
10+
11+
echo "before cp target/x86_64-pc-windows-msvc/release/libmathcat_py.dll addon/globalPlugins/MathCAT/libmathcat_py.pyd"
12+
13+
cp target/x86_64-pc-windows-msvc/release/libmathcat_py.dll addon/globalPlugins/MathCAT/libmathcat_py.pyd
14+
15+
# for testing
16+
cp target/x86_64-pc-windows-msvc/release/libmathcat_py.dll Example/libmathcat_py.pyd
17+
cp -r addon/globalPlugins/MathCAT/Rules Example
18+
sed 's/^import wx\.xrc/# import wx.xrc/' --in-place "addon/globalPlugins/MathCAT/MathCATgui.py"
19+
rm -f MathCAT-*.nvda-addon
20+
21+
# use "pip install SCons" to add scons to the python env
22+
${PYO3_PYTHON_64}/Scripts/scons

0 commit comments

Comments
 (0)