mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Move creation of pycygrun into the install script
This commit is contained in:
parent
ad4f4b65fe
commit
906dd4305f
@ -9,6 +9,7 @@ import re
|
||||
import shutil
|
||||
import os
|
||||
import glob
|
||||
import stat
|
||||
|
||||
known_extensions = {
|
||||
'bz2.pyd',
|
||||
@ -128,6 +129,16 @@ def main():
|
||||
if num != 1:
|
||||
raise SystemExit('Failed to patch mimetypes.py')
|
||||
f.write(raw)
|
||||
pycgrun = os.path.join(install_dir, 'pycygrun')
|
||||
with open(pycgrun, 'wb') as f:
|
||||
f.write(b'''\
|
||||
#!/bin/zsh
|
||||
SCRIPT=$(readlink -f $0)
|
||||
SCRIPTPATH=`dirname $SCRIPT`
|
||||
PYSCRIPT=`cygpath -w $1`
|
||||
exec $SCRIPTPATH/python.exe $PYSCRIPT ${@:2}
|
||||
''')
|
||||
os.chmod(pycgrun, stat.S_IRWXU)
|
||||
|
||||
print('python installed to:', install_dir)
|
||||
|
||||
|
@ -39,7 +39,7 @@ Run::
|
||||
Create a file ~/bin/winenv with the following::
|
||||
|
||||
cat << ' EOF' | sed -e 's/^ *//' > ~/bin/winenv
|
||||
#!pyrun
|
||||
#!pycygrun
|
||||
import os, subprocess, sys
|
||||
env = os.environ.copy()
|
||||
# Ensure windows based exes are used in preference to cygwin ones
|
||||
@ -144,20 +144,6 @@ For 32-bit::
|
||||
|
||||
Make sure ~/sw/private/python is in your PATH
|
||||
|
||||
Run::
|
||||
|
||||
cat << ' EOF' | sed -e 's/^ *//' > ~/sw/private/python/pyrun
|
||||
#!/bin/zsh
|
||||
SCRIPT=$(readlink -f $0)
|
||||
SCRIPTPATH=`dirname $SCRIPT`
|
||||
PYSCRIPT=`cygpath -w $1`
|
||||
exec $SCRIPTPATH/python.exe $PYSCRIPT ${@:2}
|
||||
EOF
|
||||
chmod +x ~/sw/private/python/pyrun
|
||||
|
||||
This creates a pyrun executable that can be used as a shebang in python scripts
|
||||
you intend to run directly via cygwin.
|
||||
|
||||
Basic dependencies
|
||||
--------------------
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user