forked from brltty/brltty
-
Notifications
You must be signed in to change notification settings - Fork 0
/
mkwin
executable file
·229 lines (198 loc) · 8.67 KB
/
mkwin
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
#!/bin/sh
###############################################################################
# BRLTTY - A background process providing access to the console screen (when in
# text mode) for a blind person using a refreshable braille display.
#
# Copyright (C) 1995-2014 by The BRLTTY Developers.
#
# BRLTTY comes with ABSOLUTELY NO WARRANTY.
#
# This is free software, placed under the terms of the
# GNU General Public License, as published by the Free Software
# Foundation; either version 2 of the License, or (at your option) any
# later version. Please see the file LICENSE-GPL for details.
#
# Web Page: http://mielke.cc/brltty/
#
# This software is maintained by Dave Mielke <dave@mielke.cc>.
###############################################################################
version=5.0
subversion=x
apiversion=0.6.1
whole_version=$version-$subversion
autohotkey="/c/Program Files/AutoHotkey"
nsis="/c/Program Files/NSIS"
configure_line="--quiet --prefix=/ --enable-relocatable-install --without-flite --without-mikropuhe --without-speechd --without-swift --without-theta --without-viavoice --disable-i18n"
README_head="\
This is an unofficial build of brltty $version + a few fixes for windows.
You should probably read README.txt and doc/README.Windows.txt for information
on brltty.
For a very quick startguide:
- BRLTTY only gives access to text consoles, for the rest of the windows
environment you need to also install and run NVDA.
- use the BRLTTY configurator (brlttycnf.exe) or uncomment by hand the proper
lines from etc/brltty.conf.
- For Python support (e.g. for NVDA), run Brlapi-$apiversion.win32.exe
- for sighted users, use the xw braille driver to get a virtual braille box."
README_foot="
If you are getting troubles, please run run-debug.bat and send us the debug.log
and brltty.conf files.
More documentation can be found in README.txt and doc/
=============================
Technical notes on this build
- brltty was compiled from version $version plus some path fixes using mingw32
and ./configure $configure_line
- to make life easier to windows users, Programs/brlapi_server.c was modified
to not use authentication by default: BRLAPI_DEFAUTH turned into "none",
and only local sockets were enabled: ":0+127.0.0.1:0" turned into ":0"
- *usb0* come from libusb-win32 1.2.1.0 available on
http://libusb-win32.sourceforge.net/
- braille.dll comes from http://libbraille.sourceforge.net/
- python bindings are provided in Brlapi-$apiversion.win32.exe
- C bindings are provided in include/ and lib/: a .lib file is provided for
linking in e.g. Visual C. Then you can just ship
bin/brlapi${apiversion%.*}.dll along your .exe application.
"
. "`dirname "${0}"`/prologue.sh"
[ "$MSYSTEM" = "MINGW32" ] || programError 1 "This script is for MinGW32 only"
[ "${#}" -eq 0 ] && syntaxError "missing source root."
sourceRoot="${1}"
shift
cd "${sourceRoot}" || exit "${?}"
sourceRoot="`pwd`"
if [ "${#}" -eq 0 ]
then
archiveName="`basename "${sourceRoot}"`"
else
archiveName="${1}"
shift
fi
if [ "${#}" -eq 0 ]
then
archiveFile="${archiveName}.zip"
else
archiveFile="${1}"
shift
fi
[ "${archiveFile#/}" = "${archiveFile}" ] && archiveFile="${initialDirectory}/${archiveFile}"
[ "${#}" -eq 0 ] || syntaxError "too many parameters."
temporaryDirectory=/tmp/brltty-mkwin
rm -fr ${temporaryDirectory}
mkdir -p ${temporaryDirectory}
set -e
buildRoot="${temporaryDirectory}/build"
cp -p -r -- "${sourceRoot}" "${buildRoot}"
cd "${buildRoot}"
installRoot="${temporaryDirectory}/${archiveName}"
"./configure" $configure_line
make -s
"${autohotkey}/Compiler/Ahk2Exe.exe" //in brlttycnf.ahk //out brlttycnf.exe
make -s install INSTALL_ROOT="${installRoot}" JAVA_JAR_DIR=/lib JAVA_JNI_DIR=/lib
make -s -C Drivers/BrlAPI/WindowEyes we-dynamic-library-windows
cp Bindings/Python/dist/Brlapi-$apiversion.win32.exe "${installRoot}"
cp brlttycnf.exe "${installRoot}"
cp Drivers/BrlAPI/WindowEyes/webrloem109.dll "${installRoot}"
todos() {
sed -e 's/'$'\033''\[[0-9]*m//g' -e 's/$/'$'\015'/ < "$1" > "$2"
}
todos "${sourceRoot}/LICENSE-GPL" "${installRoot}/LICENSE-GPL.txt"
todos "${sourceRoot}/LICENSE-LGPL" "${installRoot}/LICENSE-LGPL.txt"
todos "${sourceRoot}/README" "${installRoot}/README.txt"
mkdir "${installRoot}/doc"
for i in BrlAPIref Manual-BRLTTY Manual-BrlAPI
do
for file in `(cd ${sourceRoot}/Documents ; find "$i" -type f ! -name \*.3)`
do
mkdir -p "${installRoot}/doc/`dirname "$file"`"
todos "${sourceRoot}/Documents/$file" "${installRoot}/doc/$file"
done
done
for i in ChangeLog HISTORY TODO README.windows
do
todos "${sourceRoot}/Documents/$i" "${installRoot}/doc/$i.txt"
done
todos "${sourceRoot}/Drivers/BrlAPI/WindowEyes/README" "${installRoot}/doc/WindowEyes.txt"
todos "${sourceRoot}/Drivers/BrlAPI/WindowEyes/braille.ini" "${installRoot}/doc/braille.ini"
mkdir "${installRoot}/doc/BrailleDrivers"
for i in `cd Drivers/Braille ; ls` ; do
[ -r "Drivers/Braille/$i/README" ] && todos "${sourceRoot}/Drivers/Braille/$i/README" "${installRoot}/doc/BrailleDrivers/$i.txt"
done
todos "${buildRoot}/Documents/brltty.conf" "${installRoot}/etc/brltty.conf"
todos "${buildRoot}/Tables/README-ATB" "${installRoot}/etc/brltty/README-ATB.txt"
todos "${buildRoot}/Tables/README-CTB" "${installRoot}/etc/brltty/README-CTB.txt"
todos "${buildRoot}/Tables/README-DOTS" "${installRoot}/etc/brltty/README-DOTS.txt"
todos "${buildRoot}/Tables/README-TTB" "${installRoot}/etc/brltty/README-TTB.txt"
for i in `find ${installRoot}/share/man -type f -name \*.3 -o -name \*.1`
do
target="${i/%[13]}"txt
groff -T ascii -mandoc 2> /dev/null < "$i" | sed -e 's/'$'\033''\[[0-9]*m//g' > "$target"
[ -s "$target" ] || rm -f "$i" "$target"
done
sed -e 's/$/'$'\015''/' > "${installRoot}/README.first.txt" << EOF
$README_head
- to register BRLTTY as a service so that it gets started automatically at boot,
run install.bat. To unregister it, run uninstall.bat
- If your braille device is USB,
* if you have installed your manufacturer's driver, you should rather
select its virtual COM port if it provides one, else select "USB:" to use
libusb-win32's filter,
* if you do not want or can not install your manufacturer's driver, you can
select "USB:" here and install libusb-win32's driver.
- to install the libusb-win32 filter, fetch it from
http://libusb-win32.sourceforge.net/
- to install libusb-win32 drivers, right-click on bin/brltty.inf
and select install
- If your braille device is serial, or is connect through a serial to USB
converter, just select the proper COM port. Make sure to select the proper
braille display as incorrect probing seems to possibly brick some devices.
- If your braille device is bluetooth, you can either use the windows bluetooth
facilities to create a virtual COM port which you can then direct brltty to,
or you can configure by hand the braille-device line in the brltty.conf file.
$README_foot
EOF
sed -e 's/$/'$'\015''/' > "${installRoot}/install.bat" << EOF
@echo off
.\bin\brltty -I
net start BrlAPI
EOF
sed -e 's/$/'$'\015''/' > "${installRoot}/uninstall.bat" << EOF
@echo off
net stop BrlAPI
.\bin\brltty -R
EOF
sed -e 's/$/'$'\015''/' > "${installRoot}/run-debug.bat" << EOF
@echo off
echo Running brltty in debugging mode. When done, close this window (use the
echo alt-space menu for instance) and see %CD%\debug.log
.\bin\brltty -l debug -n -e > debug.log 2>&1
EOF
cp ${sourceRoot}/Autostart/Windows/brltty.inf "${installRoot}/bin"
echo "not yet" > "${installRoot}/bin/brltty.cat"
echo "not yet" > "${installRoot}/bin/brltty_x64.cat"
cp "$SYSTEMROOT/system32/drivers/libusb0.sys" "${installRoot}/bin"
cp "$SYSTEMROOT/system32/drivers/libusb0_x64.sys" "${installRoot}/bin"
cp "$SYSTEMROOT/system32/libusb0.dll" "${installRoot}/bin"
cp "$SYSTEMROOT/system32/libusb0_x64.dll" "${installRoot}/bin"
cp "$SYSTEMROOT/system32/braille.dll" "${installRoot}/bin"
cp "$SYSTEMROOT/system32/msvcr90.dll" "${installRoot}/bin"
(cd "${installRoot}/lib" ; lib /def:brlapi.def /name:brlapi-0.6.dll /out:brlapi.lib )
cp /mingw/bin/libiconv-2.dll "${installRoot}/bin"
cp /mingw/bin/libpdcurses*.dll "${installRoot}/bin"
cp /mingw/bin/libgcc_s_dw2-1.dll "${installRoot}/bin"
rm -f "${installRoot}/bin/brltty-config"
rm -f "${installRoot}/bin/brltty-install"
rm -f "${installRoot}/etc/brlapi.key"
rmdir -p "${installRoot}/lib/brltty/rw" 2> /dev/null || true
cd ..
rm -f "${archiveFile}"
zip -q -A -r "${archiveFile}" "${archiveName}"
sed -e 's/$/'$'\015''/' > "${installRoot}/README.first.txt" << EOF
$README_head
$README_foot
EOF
cp "${buildRoot}/brltty.nsi" .
cp "${buildRoot}/nsistrings.txt" "${installRoot}/"
"${nsis}/makensis" -DVERSION=${whole_version} brltty.nsi
rm -f "${initialDirectory}/brltty-win-${whole_version}.exe"
mv brltty-win-${whole_version}.exe "${initialDirectory}/brltty-win-${whole_version}.exe"
exit 0