Skip to content

Commit e501579

Browse files
committed
Some cleanup on building
Addresses #16 Added sed command to make import wx.xrc a comment
1 parent 38449fd commit e501579

File tree

5 files changed

+11
-14
lines changed

5 files changed

+11
-14
lines changed

.cargo/config.toml

Lines changed: 0 additions & 6 deletions
This file was deleted.

.vscode/settings.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,12 @@
11
{
22
"cSpell.words": [
33
"libmathcat",
4+
"Nemeth",
45
"Placemarker",
6+
"prefs",
57
"pyfunction",
68
"pymodule",
9+
"sconstruct",
710
"SSML"
811
]
912
}

NVDA-addon/addon/globalPlugins/MathCAT/MathCATgui.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
###########################################################################
99

1010
import wx
11-
#import wx.xrc
11+
# import wx.xrc
1212

1313
import gettext
1414
_ = gettext.gettext

build-addon.sh renamed to build-nvda-addon.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
#!/bin/csh
22
# RUN THIS FILE to build the NVDA addon
33

4+
rm -rf NVDA-addon/addon/globalPlugins/MathCAT/Rules
45
cargo build --target i686-pc-windows-msvc --release
56

67
cp target/i686-pc-windows-msvc/release/libmathcat_py.dll NVDA-addon/addon/globalPlugins/MathCAT/libmathcat.pyd
78
cd NVDA-addon
9+
sed 's/^import wx\.xrc/# import wx.xrc/' --in-place "addon/globalPlugins/MathCAT/MathCATgui.py"
810
rm MathCAT-*.nvda-addon
911
scons
10-

build.rs

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,12 @@
11
//! The build.rs file is necessary to unzip the rules.
22
//! 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.
33
//!
4-
//! Note: this only creates the Rules dir. Run build-addon.sh to actually build the addon.
4+
//! Note: this only creates the Rules dir. Run build-addon.sh to actually build the NVDA addon.
55
66
use std::path::PathBuf;
77
use zip::ZipArchive;
88

99
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'");
1310
let archive = libmathcat::ZIPPED_RULE_FILES;
1411
let archive = std::io::Cursor::new(archive);
1512
let location = PathBuf::from("NVDA-addon/addon/globalPlugins/MathCAT");
@@ -18,6 +15,8 @@ fn main() {
1815
zip_archive.extract(&location).expect("Zip extraction failed");
1916

2017
// 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/Languages/zz")
22-
.expect("Failed to remove directory 'NVDA-addon/addon/globalPlugins/MathCAT/Rules/zz'");
18+
let mut zz_dir = location.clone();
19+
zz_dir.push("Rules/Languages/zz");
20+
std::fs::remove_dir_all(&zz_dir)
21+
.expect(&format!("Failed to remove directory {}", zz_dir.to_str().unwrap()));
2322
}

0 commit comments

Comments
 (0)