forked from WineAsCI/python-lib-template
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis-setup.sh
executable file
·302 lines (281 loc) · 16.2 KB
/
.travis-setup.sh
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
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
#!/bin/bash
sudo add-apt-repository -y ppa:pipelight/daily
wget https://dl.winehq.org/wine-builds/Release.key
sudo apt-key add Release.key
sudo apt-add-repository 'https://dl.winehq.org/wine-builds/ubuntu/'
sudo apt-key update
sudo apt-get -qy update
sudo apt-get install -y --allow-unauthenticated winehq-stable xvfb cabextract #winbind xvfb cabextract
WINETRICKS=https://raw.githubusercontent.com/Winetricks/winetricks/20200412/src/winetricks #https://raw.githubusercontent.com/Winetricks/winetricks/3fd9a36d9fb973ccf334413937e4d71aa5401311/src/winetricks
case "$WINEENV" in
py26)
VERSION=2.6.6
INSTALLER_URL="https://www.python.org/ftp/python/$VERSION/python-$VERSION.msi"
INSTALL_COMMAND="wine msiexec /i python-$VERSION.msi"
CLEAN_COMMAND="del /f python-$VERSION.msi"
EXECDIR="$HOME/.wine/drive_c/Python26"
MORE_COMMANDS= # Crash: https://travis-ci.org/WineAsCI/python-lib-template/jobs/49725679#L1789
;;
py27)
VERSION=2.7.9
INSTALLER_URL="https://www.python.org/ftp/python/$VERSION/python-$VERSION.msi"
INSTALL_COMMAND="wine msiexec /i python-$VERSION.msi"
CLEAN_COMMAND="del /f python-$VERSION.msi"
EXECDIR="$HOME/.wine/drive_c/Python27"
MORE_COMMANDS='wget http://download.microsoft.com/download/7/9/6/796EF2E4-801B-4FC4-AB28-B59FBF6D907B/VCForPython27.msi; wine msiexec /i VCForPython27.msi'
;;
py27_64)
VERSION=2.7.10
INSTALLER_URL="https://www.python.org/ftp/python/$VERSION/python-$VERSION.amd64.msi"
INSTALL_COMMAND="wine msiexec /i python-$VERSION.amd64.msi"
CLEAN_COMMAND="del /f python-$VERSION.amd64.msi"
EXECDIR="$HOME/.wine/drive_c/Python27"
MORE_COMMANDS='wget http://download.microsoft.com/download/7/9/6/796EF2E4-801B-4FC4-AB28-B59FBF6D907B/VCForPython27.msi; wine msiexec /i VCForPython27.msi'
;;
py33)
VERSION=3.3.5
INSTALLER_URL="https://www.python.org/ftp/python/$VERSION/python-$VERSION.msi"
INSTALL_COMMAND="wine msiexec /i python-$VERSION.msi"
CLEAN_COMMAND="del /f python-$VERSION.msi"
EXECDIR="$HOME/.wine/drive_c/Python33"
MORE_COMMANDS= # Needs VC++ 10.0
;;
py34_64)
VERSION=3.4.4
INSTALLER_URL="https://www.python.org/ftp/python/$VERSION/python-$VERSION.amd64.msi"
INSTALL_COMMAND="wine msiexec /i python-$VERSION.amd64.msi"
CLEAN_COMMAND="del /f python-$VERSION.amd64.msi"
EXECDIR="$HOME/.wine/drive_c/Python34"
MORE_COMMANDS= # Needs VC++ 10.0
;;
py34)
VERSION=3.4.4
INSTALLER_URL="https://www.python.org/ftp/python/$VERSION/python-$VERSION.msi"
INSTALL_COMMAND="wine msiexec /i python-$VERSION.msi"
CLEAN_COMMAND="del /f python-$VERSION.msi"
EXECDIR="$HOME/.wine/drive_c/Python34"
MORE_COMMANDS= # Needs VC++ 10.0
;;
py35_64)
VERSION=3.5.1
VERSIONSHORT=35
cat <<EOF > install_list.txt
https://www.python.org/ftp/python/$VERSION/amd64/core.msi
https://www.python.org/ftp/python/$VERSION/amd64/dev.msi
https://www.python.org/ftp/python/$VERSION/amd64/lib.msi
https://www.python.org/ftp/python/$VERSION/amd64/exe.msi
https://www.python.org/ftp/python/$VERSION/amd64/tools.msi
https://www.python.org/ftp/python/$VERSION/amd64/pip.msi
EOF
cat install_list.txt
INSTALLER_URL="-i install_list.txt"
INSTALL_COMMAND="wget $WINETRICKS;chmod +x winetricks;Xvfb :1& export DISPLAY=:1;./winetricks nocrashdialog -q vcrun2015;pkill Xvfb;export DISPLAY=;wine msiexec /i core.msi TARGETDIR=C:\Python$VERSIONSHORT;wine msiexec /i dev.msi TARGETDIR=C:\Python$VERSIONSHORT;wine msiexec /i lib.msi TARGETDIR=C:\Python$VERSIONSHORT;wine msiexec /i exe.msi TARGETDIR=C:\Python$VERSIONSHORT;wine msiexec /i tools.msi TARGETDIR=C:\Python$VERSIONSHORT;wine msiexec /i pip.msi TARGETDIR=C:\Python$VERSIONSHORT;"
CLEAN_COMMAND=""
EXECDIR="$HOME/.wine/drive_c/Python35"
MORE_COMMANDS= # Needs VC++ 10.0
;;
py35)
VERSION=3.5.1
VERSIONSHORT=35
cat <<EOF > install_list.txt
https://www.python.org/ftp/python/$VERSION/win32/core.msi
https://www.python.org/ftp/python/$VERSION/win32/dev.msi
https://www.python.org/ftp/python/$VERSION/win32/lib.msi
https://www.python.org/ftp/python/$VERSION/win32/exe.msi
https://www.python.org/ftp/python/$VERSION/win32/tools.msi
https://www.python.org/ftp/python/$VERSION/win32/pip.msi
EOF
cat install_list.txt
INSTALLER_URL="-i install_list.txt"
INSTALL_COMMAND="wget $WINETRICKS;chmod +x winetricks;Xvfb :1& export DISPLAY=:1;./winetricks nocrashdialog -q vcrun2015;pkill Xvfb;export DISPLAY=;wine msiexec /i core.msi TARGETDIR=C:\Python$VERSIONSHORT;wine msiexec /i dev.msi TARGETDIR=C:\Python$VERSIONSHORT;wine msiexec /i lib.msi TARGETDIR=C:\Python$VERSIONSHORT;wine msiexec /i exe.msi TARGETDIR=C:\Python$VERSIONSHORT;wine msiexec /i tools.msi TARGETDIR=C:\Python$VERSIONSHORT;wine msiexec /i pip.msi TARGETDIR=C:\Python$VERSIONSHORT;"
CLEAN_COMMAND=""
EXECDIR="$HOME/.wine/drive_c/Python35"
MORE_COMMANDS= # Needs VC++ 10.0
;;
py36_64)
VERSION=3.6.1
VERSIONSHORT=36
cat <<EOF > install_list.txt
https://www.python.org/ftp/python/$VERSION/amd64/core.msi
https://www.python.org/ftp/python/$VERSION/amd64/dev.msi
https://www.python.org/ftp/python/$VERSION/amd64/lib.msi
https://www.python.org/ftp/python/$VERSION/amd64/exe.msi
https://www.python.org/ftp/python/$VERSION/amd64/tools.msi
https://www.python.org/ftp/python/$VERSION/amd64/pip.msi
EOF
cat install_list.txt
INSTALLER_URL="-i install_list.txt"
INSTALL_COMMAND="wget $WINETRICKS;chmod +x winetricks;Xvfb :1& export DISPLAY=:1;./winetricks nocrashdialog -q vcrun2015;pkill Xvfb;export DISPLAY=;wine msiexec /i core.msi TARGETDIR=C:\Python$VERSIONSHORT;wine msiexec /i dev.msi TARGETDIR=C:\Python$VERSIONSHORT;wine msiexec /i lib.msi TARGETDIR=C:\Python$VERSIONSHORT;wine msiexec /i exe.msi TARGETDIR=C:\Python$VERSIONSHORT;wine msiexec /i tools.msi TARGETDIR=C:\Python$VERSIONSHORT;wine msiexec /i pip.msi TARGETDIR=C:\Python$VERSIONSHORT;"
CLEAN_COMMAND=""
EXECDIR="$HOME/.wine/drive_c/Python36"
MORE_COMMANDS= # Needs VC++ 10.0
;;
py36)
VERSION=3.6.1
VERSIONSHORT=36
cat <<EOF > install_list.txt
https://www.python.org/ftp/python/$VERSION/win32/core.msi
https://www.python.org/ftp/python/$VERSION/win32/dev.msi
https://www.python.org/ftp/python/$VERSION/win32/lib.msi
https://www.python.org/ftp/python/$VERSION/win32/exe.msi
https://www.python.org/ftp/python/$VERSION/win32/tools.msi
https://www.python.org/ftp/python/$VERSION/win32/pip.msi
EOF
cat install_list.txt
INSTALLER_URL="-i install_list.txt"
INSTALL_COMMAND="wget $WINETRICKS;chmod +x winetricks;Xvfb :1& export DISPLAY=:1;./winetricks nocrashdialog -q vcrun2015;pkill Xvfb;export DISPLAY=;wine msiexec /i core.msi TARGETDIR=C:\Python$VERSIONSHORT;wine msiexec /i dev.msi TARGETDIR=C:\Python$VERSIONSHORT;wine msiexec /i lib.msi TARGETDIR=C:\Python$VERSIONSHORT;wine msiexec /i exe.msi TARGETDIR=C:\Python$VERSIONSHORT;wine msiexec /i tools.msi TARGETDIR=C:\Python$VERSIONSHORT;wine msiexec /i pip.msi TARGETDIR=C:\Python$VERSIONSHORT;"
CLEAN_COMMAND=""
EXECDIR="$HOME/.wine/drive_c/Python36"
MORE_COMMANDS= # Needs VC++ 10.0
;;
py37_64)
VERSION=3.7.0
VERSIONSHORT=37
cat <<EOF > install_list.txt
https://www.python.org/ftp/python/$VERSION/amd64/core.msi
https://www.python.org/ftp/python/$VERSION/amd64/dev.msi
https://www.python.org/ftp/python/$VERSION/amd64/lib.msi
https://www.python.org/ftp/python/$VERSION/amd64/exe.msi
https://www.python.org/ftp/python/$VERSION/amd64/tools.msi
https://www.python.org/ftp/python/$VERSION/amd64/pip.msi
EOF
cat install_list.txt
INSTALLER_URL="-i install_list.txt"
INSTALL_COMMAND="wget $WINETRICKS;chmod +x winetricks;Xvfb :1& export DISPLAY=:1;./winetricks nocrashdialog -q vcrun2015;pkill Xvfb;export DISPLAY=;wine msiexec /i core.msi TARGETDIR=C:\Python$VERSIONSHORT;wine msiexec /i dev.msi TARGETDIR=C:\Python$VERSIONSHORT;wine msiexec /i lib.msi TARGETDIR=C:\Python$VERSIONSHORT;wine msiexec /i exe.msi TARGETDIR=C:\Python$VERSIONSHORT;wine msiexec /i tools.msi TARGETDIR=C:\Python$VERSIONSHORT;wine msiexec /i pip.msi TARGETDIR=C:\Python$VERSIONSHORT;"
CLEAN_COMMAND=""
EXECDIR="$HOME/.wine/drive_c/Python37"
MORE_COMMANDS= # Needs VC++ 10.0
;;
py37)
VERSION=3.7.0
VERSIONSHORT=37
cat <<EOF > install_list.txt
https://www.python.org/ftp/python/$VERSION/win32/core.msi
https://www.python.org/ftp/python/$VERSION/win32/dev.msi
https://www.python.org/ftp/python/$VERSION/win32/lib.msi
https://www.python.org/ftp/python/$VERSION/win32/exe.msi
https://www.python.org/ftp/python/$VERSION/win32/tools.msi
https://www.python.org/ftp/python/$VERSION/win32/pip.msi
EOF
cat install_list.txt
INSTALLER_URL="-i install_list.txt"
INSTALL_COMMAND="wget $WINETRICKS;chmod +x winetricks;Xvfb :1& export DISPLAY=:1;./winetricks nocrashdialog -q vcrun2015;pkill Xvfb;export DISPLAY=;wine msiexec /i core.msi TARGETDIR=C:\Python$VERSIONSHORT;wine msiexec /i dev.msi TARGETDIR=C:\Python$VERSIONSHORT;wine msiexec /i lib.msi TARGETDIR=C:\Python$VERSIONSHORT;wine msiexec /i exe.msi TARGETDIR=C:\Python$VERSIONSHORT;wine msiexec /i tools.msi TARGETDIR=C:\Python$VERSIONSHORT;wine msiexec /i pip.msi TARGETDIR=C:\Python$VERSIONSHORT;"
CLEAN_COMMAND=""
EXECDIR="$HOME/.wine/drive_c/Python37"
MORE_COMMANDS= # Needs VC++ 10.0
;;
py38_64)
VERSION=3.8.3
VERSIONSHORT=38
cat <<EOF > install_list.txt
https://www.python.org/ftp/python/$VERSION/amd64/core.msi
https://www.python.org/ftp/python/$VERSION/amd64/dev.msi
https://www.python.org/ftp/python/$VERSION/amd64/lib.msi
https://www.python.org/ftp/python/$VERSION/amd64/exe.msi
https://www.python.org/ftp/python/$VERSION/amd64/tools.msi
https://www.python.org/ftp/python/$VERSION/amd64/pip.msi
EOF
cat install_list.txt
INSTALLER_URL="-i install_list.txt"
INSTALL_COMMAND="wget $WINETRICKS;chmod +x winetricks;Xvfb :1& export DISPLAY=:1;./winetricks nocrashdialog -q vcrun2017;pkill Xvfb;export DISPLAY=;wine msiexec /i core.msi TARGETDIR=C:\Python$VERSIONSHORT;export WINEPATH=C:\Python$VERSIONSHORT;wine msiexec /i dev.msi TARGETDIR=C:\Python$VERSIONSHORT;wine msiexec /i lib.msi TARGETDIR=C:\Python$VERSIONSHORT;wine msiexec /i exe.msi TARGETDIR=C:\Python$VERSIONSHORT;wine msiexec /i tools.msi TARGETDIR=C:\Python$VERSIONSHORT;wine msiexec /i pip.msi TARGETDIR=C:\Python$VERSIONSHORT;"
CLEAN_COMMAND=""
EXECDIR="$HOME/.wine/drive_c/Python$VERSIONSHORT"
MORE_COMMANDS= # Needs VC++ 10.0
;;
py38)
VERSION=3.8.3
VERSIONSHORT=38
cat <<EOF > install_list.txt
https://www.python.org/ftp/python/$VERSION/win32/core.msi
https://www.python.org/ftp/python/$VERSION/win32/dev.msi
https://www.python.org/ftp/python/$VERSION/win32/lib.msi
https://www.python.org/ftp/python/$VERSION/win32/exe.msi
https://www.python.org/ftp/python/$VERSION/win32/tools.msi
https://www.python.org/ftp/python/$VERSION/win32/pip.msi
EOF
cat install_list.txt
INSTALLER_URL="-i install_list.txt"
INSTALL_COMMAND="wget $WINETRICKS;chmod +x winetricks;Xvfb :1& export DISPLAY=:1;./winetricks nocrashdialog -q vcrun2017;pkill Xvfb;export DISPLAY=;wine msiexec /i core.msi TARGETDIR=C:\Python$VERSIONSHORT;wine msiexec /i dev.msi TARGETDIR=C:\Python$VERSIONSHORT;wine msiexec /i lib.msi TARGETDIR=C:\Python$VERSIONSHORT;wine msiexec /i exe.msi TARGETDIR=C:\Python$VERSIONSHORT;wine msiexec /i tools.msi TARGETDIR=C:\Python$VERSIONSHORT;wine msiexec /i pip.msi TARGETDIR=C:\Python$VERSIONSHORT;"
CLEAN_COMMAND=""
EXECDIR="$HOME/.wine/drive_c/Python$VERSIONSHORT"
MORE_COMMANDS= # Needs VC++ 10.0
;;
py39_64)
VERSION=3.9.0
VERSIONSHORT=39
cat <<EOF > install_list.txt
https://www.python.org/ftp/python/$VERSION/amd64/core.msi
https://www.python.org/ftp/python/$VERSION/amd64/dev.msi
https://www.python.org/ftp/python/$VERSION/amd64/lib.msi
https://www.python.org/ftp/python/$VERSION/amd64/exe.msi
https://www.python.org/ftp/python/$VERSION/amd64/tools.msi
https://www.python.org/ftp/python/$VERSION/amd64/pip.msi
EOF
cat install_list.txt
INSTALLER_URL="-i install_list.txt"
INSTALL_COMMAND="wget $WINETRICKS;chmod +x winetricks;Xvfb :1& export DISPLAY=:1;./winetricks nocrashdialog -q vcrun2017;pkill Xvfb;export DISPLAY=;wine msiexec /i core.msi TARGETDIR=C:\Python$VERSIONSHORT;export WINEPATH=C:\Python$VERSIONSHORT;wine msiexec /i dev.msi TARGETDIR=C:\Python$VERSIONSHORT;wine msiexec /i lib.msi TARGETDIR=C:\Python$VERSIONSHORT;wine msiexec /i exe.msi TARGETDIR=C:\Python$VERSIONSHORT;wine msiexec /i tools.msi TARGETDIR=C:\Python$VERSIONSHORT;wine msiexec /i pip.msi TARGETDIR=C:\Python$VERSIONSHORT;"
CLEAN_COMMAND=""
EXECDIR="$HOME/.wine/drive_c/Python$VERSIONSHORT"
MORE_COMMANDS= # Needs VC++ 10.0
;;
py39)
VERSION=3.9.0
VERSIONSHORT=39
cat <<EOF > install_list.txt
https://www.python.org/ftp/python/$VERSION/win32/core.msi
https://www.python.org/ftp/python/$VERSION/win32/dev.msi
https://www.python.org/ftp/python/$VERSION/win32/lib.msi
https://www.python.org/ftp/python/$VERSION/win32/exe.msi
https://www.python.org/ftp/python/$VERSION/win32/tools.msi
https://www.python.org/ftp/python/$VERSION/win32/pip.msi
EOF
cat install_list.txt
INSTALLER_URL="-i install_list.txt"
INSTALL_COMMAND="wget $WINETRICKS;chmod +x winetricks;Xvfb :1& export DISPLAY=:1;./winetricks nocrashdialog -q vcrun2017;pkill Xvfb;export DISPLAY=;wine msiexec /i core.msi TARGETDIR=C:\Python$VERSIONSHORT;wine msiexec /i dev.msi TARGETDIR=C:\Python$VERSIONSHORT;wine msiexec /i lib.msi TARGETDIR=C:\Python$VERSIONSHORT;wine msiexec /i exe.msi TARGETDIR=C:\Python$VERSIONSHORT;wine msiexec /i tools.msi TARGETDIR=C:\Python$VERSIONSHORT;wine msiexec /i pip.msi TARGETDIR=C:\Python$VERSIONSHORT;"
CLEAN_COMMAND=""
EXECDIR="$HOME/.wine/drive_c/Python$VERSIONSHORT"
MORE_COMMANDS= # Needs VC++ 10.0
;;
pypy)
VERSION=2.5.0
INSTALLER_URL="https://bitbucket.org/pypy/pypy/downloads/pypy-$VERSION-win32.zip"
INSTALL_COMMAND="unzip pypy-$VERSION-win32.zip"
CLEAN_COMMAND="del /f pypy-$VERSION-win32.zip"
EXECDIR="$PWD/pypy-$VERSION-win32"
PYTHON="$EXECDIR/pypy.exe"
PIP="$EXECDIR/bin/pip.exe"
EASY_INSTALL="$EXECDIR/bin/easy_install.exe"
;;
*)
echo "WINEENV $WINEENV not supported."
exit 1
esac
[[ -z "$PYTHON" ]] && PYTHON="$EXECDIR/python.exe"
[[ -z "$EASY_INSTALL" ]] && EASY_INSTALL="$EXECDIR/Tools/scripts/easy_install.exe"
[[ -z "$PIP" ]] && PIP="$EXECDIR/Tools/scripts/pip.exe"
export PATH="/opt/wine-stable/bin:$PATH"
echo "foo"
which wine
#export WINEARCH=win32
wine wineboot
# Needed for the vcrun2015 installer
#wget http://www.orbitals.com/programs/py.exe
wget $INSTALLER_URL
eval $INSTALL_COMMAND
sleep 60;
eval $CLEAN_COMMAND
ls -al /home/travis/.wine/drive_c/
sed -i 's/_windows_cert_stores = .*/_windows_cert_stores = ("ROOT",)/' "$EXECDIR/Lib/ssl.py"
eval $MORE_COMMANDS
echo "/opt/wine-stable/bin/wine $PYTHON" '$@' > _python
sudo apt-get install -y tree
echo "$EXECDIR"
tree $EXECDIR
#/opt/wine-staging/bin/
wine $PIP install setuptools
ls $EXECDIR/Tools/scripts
echo "/opt/wine-stable/bin/wine $EASY_INSTALL" '$@' > _easy_install # /opt/wine-staging/bin/
echo "/opt/wine-stable/bin/wine $PIP" '$@' > _pip # /opt/wine-staging/bin/
chmod +x _python _easy_install _pip
#wget https://bootstrap.pypa.io/ez_setup.py -O - | sed "s/DEFAULT_VERSION = .*/DEFAULT_VERSION = '24.3.0'/g" | ./_python
#./_easy_install pip