FAQ | This is a LIVE service | Changelog

Skip to content
Snippets Groups Projects
Commit 3e08762d authored by Silas S. Brown's avatar Silas S. Brown
Browse files

Gradint update

git-svn-id: http://svn.code.sf.net/p/e-guidedog/code/ssb22/gradint@1633 29193198-4895-4776-b068-10539e920549
parent cd6759fc
No related branches found
No related tags found
No related merge requests found
......@@ -15,7 +15,9 @@
# but if present will be included in all versions.
# Use this for bundling Gradint with partials-synths,
# preset-collections, encoders, whatever, into one
# installer for giving to someone.
# installer for giving to someone. Note that you can
# support both Windows and Linux using a single bundle
# with win2linux.sh (see comments at top of that script)
Extra_Data=partials *_disabled [^g]*.exe
All_Versions=gradint-build.7z gradint.exe gradint.tbz gradint.bgz gradint.zip gradintcab.zip gradint-S60.zip gradint-android.zip servertools.bgz
......
......@@ -191,6 +191,11 @@ if not fileExists(configFiles[0]):
if os.sep=="\\" and '/' in sys.argv[0] and fileExists(sys.argv[0].replace('/','\\')): sys.argv[0]=sys.argv[0].replace('/','\\') # hack for some Windows Python builds accepting slash in command line but reporting os.sep as backslash
os.chdir(starting_directory)
os.chdir(sys.argv[0][:sys.argv[0].rfind(os.sep)])
if not fileExists(configFiles[0]): # argv[0] might be a symlink
os.chdir(starting_directory)
try: rp = os.path.realpath(sys.argv[0])
except: rp = 0 # e.g. no os.path, or no os.path.realpath
if rp: os.chdir(rp[:rp.rfind(os.sep)])
if not fileExists(configFiles[0]):
# Finally, try the module pathname, in case some other Python program has imported us without changing directory. Apparently we need to get this from an exception.
try: raise 0
......
#!/bin/bash
# Convert a Windows gradint.exe or gradint-bundle.exe
# (optionally with bundled samples, partials etc) into
# a Linux installation of Gradint. Use this to support
# both Windows and Linux from one bundle.
# (c) 2013 Silas S. Brown. License: GPL v3 (as Gradint)
# This script can be placed on a USB stick or whatever, in
# the same directory as:
# (1) gradint.exe or gradint-bundle.exe
# (2) 7za binary (for correct CPU type and libraries), if
# 7za is not installed on the system,
# (3) espeak binary (ditto)
# (4) any *.deb files to install with dpkg, e.g. python-tk
# and its dependencies (e.g. blt tk-8.5)
# (these will be installed with --force-depends, in case
# you're doing an offline install and can manage without
# having the most up-to-date dependencies - do this at
# your own risk)
# You can also put the 7za, espeak and deb files into a
# bin/ subdirectory.
if ! test "$(echo *.deb)" == "*.deb"; then
echo "Installing *.deb (with --force-depends)"
sudo dpkg --force-depends -i *.deb
elif ! test "$(echo bin/*.deb)" == "bin/*.deb"; then
echo "Installing bin/*.deb (with --force-depends)"
sudo dpkg --force-depends -i bin/*.deb
fi
# TODO: if got internet, sudo apt-get update ; sudo apt-get -f install
if test -f espeak || test -f bin/espeak; then
echo "Copying espeak binary to /usr/local/bin"
if test -f espeak; then sudo cp espeak /usr/local/bin/
else sudo cp bin/espeak /usr/local/bin/; fi
elif ! which espeak 2>/dev/null >/dev/null && ! which speak 2>/dev/null >/dev/null; then
echo "Warning: no espeak binary found on system, and none to install" # TODO: try to apt-get it? but might not have an Internet connection
echo -n "Press Enter: " ; read
fi
mkdir -p "$HOME/gradint0"
if test -e gradint-bundle.exe; then
PATH="$PATH:.:./bin" 7za "-o$HOME/gradint0" x gradint-bundle.exe || exit 1
else PATH="$PATH:.:./bin" 7za "-o$HOME/gradint0" x gradint.exe || exit 1; fi
cd $HOME/gradint0 || exit 1
mv gradint .. || exit 1
cd .. && rm -rf gradint0
cd gradint || exit 1
unzip library.zip gradint.py || exit 1
rm -rf tcl library.zip *.exe *.pyd *.dll
if python -c 'import tkinter'; then
if test -e ~/Desktop && ! test -e ~/Desktop/Gradint; then
echo "Creating symlink on Desktop"
ln -s "$(pwd)/gradint.py" ~/Desktop/Gradint
else echo "Not creating symlink on desktop" # TODO: cater for more possibilities
fi
else echo "Warning: no tkinter on this system; gradint will be command-line only" ; echo -n "Press Enter: " ; read # TODO: if internet, try sudo apt-get install python-tk
fi
echo "Copying espeak-data to /usr/share/"
sudo cp -r espeak/espeak-data /usr/share/ && rm -rf espeak
echo "win2linux.sh finished"
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment