File tree Expand file tree Collapse file tree 8 files changed +50
-81
lines changed
addon/globalPlugins/MathCAT Expand file tree Collapse file tree 8 files changed +50
-81
lines changed Original file line number Diff line number Diff line change 1+ # first run "rustup target add i686-pc-windows-msvc" to download needed files
2+ #
3+ # NVDA only runs on windows and only supports 32 bit builds (at this time)
4+ # Because of this, we force the target architecture.
5+ [build ]
6+ target = " i686-pc-windows-msvc"
Original file line number Diff line number Diff line change 11[package ]
22name = " MathCatForPython"
3- version = " 0.1.1 "
3+ version = " 0.1.2 "
44authors = [" Neil Soiffer <soiffer@alum.mit.edu>" ]
55edition = " 2018"
66
@@ -13,12 +13,16 @@ name = "libmathcat_py"
1313crate-type = [" cdylib" ]
1414
1515[dependencies ]
16- mathcat = " 0.1.2 "
16+ mathcat = " 0.1.6 "
1717
1818[dependencies .pyo3 ]
1919version = " 0.15.1"
2020features = [" extension-module" , " abi3" ]
2121
22- # 32 bit target stable-i686-pc-windows-msvc
23- # if changing to building 32 bit python version, change .cargo/config.toml
24- # along with changing env variable PYO3_PYTHON
22+ [build-dependencies ]
23+ mathcat = " 0.1.6"
24+ zip = " 0.5.8"
25+
26+ [profile .release ]
27+ lto = true
28+ # opt-level = "z" # Optimize for size.
Load Diff This file was deleted.
Original file line number Diff line number Diff line change 1+ #! /bin/csh
2+ # RUN THIS FILE to build the NVDA addon
3+
4+ cargo build --target i686-pc-windows-msvc --release
5+
6+ cp target/i686-pc-windows-msvc/release/libmathcat_py.dll NVDA-addon/addon/globalPlugins/MathCAT/libmathcat.pyd
7+ cd NVDA-addon
8+ rm mathCAT-* .nvda-addon
9+ scons
10+
Original file line number Diff line number Diff line change 1+ //! The build.rs file is necessary to unzip the rules.
2+ //! rules.zip are needed so there is a way to get the rules dir into the build since you can't get it from the crate.
3+ //!
4+ //! Note: this only creates the Rules dir. Run build-addon.sh to actually build the addon.
5+
6+ use std:: path:: PathBuf ;
7+ use zip:: ZipArchive ;
8+
9+ fn main ( ) {
10+ // first remove the Rules directory
11+ std:: fs:: remove_dir_all ( "NVDA-addon/addon/globalPlugins/MathCAT/Rules" )
12+ . expect ( "Failed to remove directory 'NVDA-addon/addon/globalPlugins/MathCAT/Rules'" ) ;
13+ let archive = libmathcat:: ZIPPED_RULE_FILES ;
14+ let archive = std:: io:: Cursor :: new ( archive) ;
15+ let location = PathBuf :: from ( "NVDA-addon/addon/globalPlugins/MathCAT" ) ;
16+
17+ let mut zip_archive = ZipArchive :: new ( archive) . unwrap ( ) ;
18+ zip_archive. extract ( & location) . expect ( "Zip extraction failed" ) ;
19+
20+ // the test dir 'zz' doesn't need to be part of the addon
21+ std:: fs:: remove_dir_all ( "NVDA-addon/addon/globalPlugins/MathCAT/Rules/zz" )
22+ . expect ( "Failed to remove directory 'NVDA-addon/addon/globalPlugins/MathCAT/Rules/zz'" ) ;
23+ }
Load Diff This file was deleted.
Original file line number Diff line number Diff line change @@ -165,12 +165,12 @@ mod py_tests {
165165 // this isn't a real test
166166 pyo3:: prepare_freethreaded_python ( ) ;
167167 let mathml_str = "<math><mo>(</mo><mrow><mn>451</mn><mo>,</mo><mn>231</mn></mrow><mo>)</mo></math>" ;
168- match convert_error ( libmathcat:: interface:: SetMathML ( mathml_str. to_string ( ) ) ) {
168+ match convert_error ( libmathcat:: interface:: set_mathml ( mathml_str. to_string ( ) ) ) {
169169 Ok ( _mathml_with_ids) => println ! ( "MathML is set w/o error" ) ,
170170 Err ( e) => println ! ( "Error is {}" , e. to_string( ) ) ,
171171 }
172172 // still alive?
173- match convert_error ( libmathcat:: interface:: SetMathML ( mathml_str. to_string ( ) ) ) {
173+ match convert_error ( libmathcat:: interface:: set_mathml ( mathml_str. to_string ( ) ) ) {
174174 Ok ( _mathml_with_ids) => panic ! ( "MathML is set 2nd time w/o error" ) ,
175175 Err ( e) => panic ! ( "Error remains {}" , e. to_string( ) ) ,
176176 }
You can’t perform that action at this time.
0 commit comments