-
Notifications
You must be signed in to change notification settings - Fork 22
/
patch
390 lines (351 loc) · 13.8 KB
/
patch
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
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
diff -ur grass-7.8.4/lib/cairodriver/text.c ../lib/cairodriver/text.c
--- grass-7.8.4/lib/cairodriver/text.c 2020-10-05 08:39:31.000000000 +0200
+++ ../lib/cairodriver/text.c 2020-11-08 17:25:27.051487800 +0100
@@ -15,7 +15,7 @@
#include <grass/glocale.h>
#include "cairodriver.h"
-#if CAIRO_HAS_FT_FONT
+#if CAIRO_HAS_FC_FONT
#include <cairo-ft.h>
#include <fontconfig/fontconfig.h>
#endif
@@ -170,7 +170,7 @@
G_free(font);
}
-#if CAIRO_HAS_FT_FONT
+#if CAIRO_HAS_FC_FONT
static void fc_init(void)
{
@@ -281,7 +281,7 @@
*/
void Cairo_set_font(const char *name)
{
-#if CAIRO_HAS_FT_FONT
+#if CAIRO_HAS_FC_FONT
if (is_toy_font(name))
set_font_toy(name);
else
@@ -322,7 +322,7 @@
void Cairo_font_list(char ***list, int *count)
{
font_list_toy(list, count, 0);
-#if CAIRO_HAS_FT_FONT
+#if CAIRO_HAS_FC_FONT
font_list_fc(list, count, 0);
#endif
}
@@ -336,8 +336,7 @@
void Cairo_font_info(char ***list, int *count)
{
font_list_toy(list, count, 1);
-#if CAIRO_HAS_FT_FONT
+#if CAIRO_HAS_FC_FONT
font_list_fc(list, count, 1);
#endif
}
-
diff -ur grass-7.8.5/lib/gis/gisinit.c ../lib/gis/gisinit.c
--- grass-7.8.5/lib/gis/gisinit.c 2020-12-21 19:40:15.000000000 +0100
+++ ../lib/gis/gisinit.c 2021-02-08 14:46:49.600045400 +0100
@@ -49,12 +49,14 @@
G_set_program_name(pgm);
+#ifndef _WIN32
/* verify version of GRASS headers (and anything else in include) */
if (strcmp(version, GIS_H_VERSION) != 0)
G_fatal_error(_("Module built against version %s but "
"trying to use version %s. "
"You need to rebuild GRASS GIS or untangle multiple installations."),
version, GIS_H_VERSION);
+#endif
/* Make sure location and mapset are set */
G_location_path();
diff -ur grass-7.8.6RC1/mswindows/env.bat ../grass-7.8.6RC1/mswindows/env.bat
--- grass-7.8.6RC1/mswindows/env.bat 2021-05-19 23:27:58.000000000 +0200
+++ ../grass-7.8.6RC1/mswindows/env.bat 2021-05-24 22:52:39.085696600 +0200
@@ -11,8 +11,6 @@
set GDAL_DATA=%GISBASE%\share\gdal
set GEOTIFF_CSV=%GISBASE%\share\epsg_csv
-set FONTCONFIG_FILE=%GISBASE%\etc\fonts.conf
-
set PATH=%GISBASE%\extrabin;%GISBASE%\bin;%PYTHONHOME%;%PATH%
REM set RStudio temporarily to %PATH% if it exists
diff -ur grass-7.8.4/mswindows/osgeo4w/env.bat.tmpl ../mswindows/osgeo4w/env.bat.tmpl
--- grass-7.8.4/mswindows/osgeo4w/env.bat.tmpl 2020-10-05 08:39:31.000000000 +0200
+++ ../mswindows/osgeo4w/env.bat.tmpl 2020-11-08 18:01:50.115323200 +0100
@@ -2,8 +2,6 @@
REM Environmental variables for GRASS OSGeo4W installer
REM
-call "%OSGEO4W_ROOT%\bin\py3_env.bat"
-
set GISBASE=%OSGEO4W_ROOT%\apps\grass\grass@POSTFIX@
REM Uncomment if you want to use Bash instead of Cmd
@@ -12,13 +10,3 @@
set GRASS_PYTHON=%OSGEO4W_ROOT%\bin\python3.exe
set GRASS_PROJSHARE=%OSGEO4W_ROOT%\share\proj
-
-set FONTCONFIG_FILE=%GISBASE%\etc\fonts.conf
-
-REM
-REM RStudio-related
-REM
-REM set RStudio temporarily to %PATH% if it exists
-IF EXIST "%ProgramFiles%\RStudio\bin\rstudio.exe" set PATH=%PATH%;%ProgramFiles%\RStudio\bin
-REM set R_USER if %USERPROFILE%\Documents\R\ exists to catch most common cases of private R libraries
-IF EXIST "%USERPROFILE%\Documents\R\" set R_USER=%USERPROFILE%\Documents\
diff -ur grass-7.8.4/mswindows/osgeo4w/mklibs.sh ../mswindows/osgeo4w/mklibs.sh
--- grass-7.8.4/mswindows/osgeo4w/mklibs.sh 2020-10-05 08:39:31.000000000 +0200
+++ ../mswindows/osgeo4w/mklibs.sh 2020-11-18 12:11:53.836510400 +0100
@@ -1,31 +1,14 @@
#!/bin/sh
set -e
+set -x
-if [ -z "$OSGEO4W_POSTFIX" ]; then
- OSGEO4W_POSTFIX=""
-fi
+[ -d mswindows/osgeo4w/vc ] || mkdir mswindows/osgeo4w/vc
-if [ "$OSGEO4W_POSTFIX" != "64" ]; then
- MACHINE=x86
-else
- MACHINE=x64
+if [ -n "$VCPATH" ]; then
+ PATH=$PATH:$VCPATH
fi
-PROGRAMFILES="/c/Program Files (x86)"
-VSDIR="$PROGRAMFILES/Microsoft Visual Studio 14.0"
-# add example for MS Visual Studio 2017 Community 64 bit
-# VSDIR="$PROGRAMFILES/Microsoft Visual Studio/2017/Community"
-PATH="$VSDIR/Common7/IDE:$PATH"
-PATH="$VSDIR/VC/bin:$PATH"
-# add example for MS Visual Studio 2017 Community 64 bit
-# PATH="$VSDIR/VC/Tools/MSVC/14.12.25827/bin/Hostx64/x64:$PATH"
-PATH="$VSDIR/Common7/Tools:$PATH"
-PATH="$PATH:/c/OSGeo4W${OSGEO4W_POSTFIX}/bin"
-export PATH
-
-[ -d mswindows/osgeo4w/vc ] || mkdir mswindows/osgeo4w/vc
-
for dllfile in "$@"; do
dlldir=${dllfile%/*}
dllfile=${dllfile##*/}
@@ -43,6 +26,7 @@
egrep -v "^[ ]*(_+IMPORT_DESCRIPTOR_.*|_+NULL_IMPORT_DESCRIPTOR)$" >mswindows/osgeo4w/vc/${defname%$VERSION}
(cd mswindows/osgeo4w/vc ;
- lib -nologo -def:${defname} -subsystem:windows -machine:${MACHINE}
+ lib -nologo -def:${defname} -subsystem:windows -machine:x64
lib -nologo $libname || exit)
done
+
diff -ur grass-7.8.4/mswindows/osgeo4w/package.sh ../mswindows/osgeo4w/package.sh
--- grass-7.8.4/mswindows/osgeo4w/package.sh 2020-10-05 08:39:31.000000000 +0200
+++ ../mswindows/osgeo4w/package.sh 2020-11-18 12:13:37.303734600 +0100
@@ -1,7 +1,5 @@
#!/usr/bin/bash
-# osgeo4w-setup -g -k -a x86_64 -q -P gdal -P proj -P geos -P fftw -P libjpeg -P liblas-devel -P libpng -P libpq -P libtiff -P libxdr -P pdcurses -P regex-devel -P sqlite3 -P zstd-devel -P zstd -P laszip2 -P python3-core -P python3-six
-
set -e
PWD="$(pwd)"
@@ -29,19 +27,8 @@
PACKAGE_POSTFIX=""
fi
-# OSGeo4W directory postfix
-# eg. '64' for 64bit, empty for 32bit
-if [ -z $OSGEO4W_POSTFIX ]; then
- OSGEO4W_POSTFIX=""
-fi
-if [ "$OSGEO4W_POSTFIX" = "64" ]; then
- MINGW_POSTFIX=64
-else
- MINGW_POSTFIX=32
-fi
-
-export OSGEO4W_ROOT_MSYS="/c/OSGeo4W${OSGEO4W_POSTFIX}"
-export OSGEO4W_ROOT=$(cygpath -w "$OSGEO4W_ROOT_MSYS")
+[ -n "$OSGEO4W_ROOT_MSYS" ]
+echo "OSGEO4W_ROOT_MSYS:$OSGEO4W_ROOT_MSYS OSGEO4W_ROOT:$OSGEO4W_ROOT"
fetchenv() {
local IFS
@@ -53,22 +40,16 @@
diffenv=$(mktemp /tmp/diffenv.XXXXXXXXXX)
args="$@"
cmd.exe //c set >$srcenv
- cmd.exe //c "call `cygpath -w $batch` $args \>nul 2\>nul \& set" >$dstenv
+ cmd.exe //c "call `cygpath -sw $batch` $args \>nul 2\>nul \& set" >$dstenv
diff -u $srcenv $dstenv | sed -f mswindows/osgeo4w/envdiff.sed >$diffenv
. $diffenv
- PATH=$PATH:/usr/bin:/mingw${MINGW_POSTFIX}/bin/:$PWD/mswindows/osgeo4w/lib:$PWD/mswindows/osgeo4w:/c/windows32/system32:/c/windows:/c/windows32/system32:/c/windows
+ PATH=$PATH:/usr/bin:/mingw64/bin/:$PWD/mswindows/osgeo4w/lib:$PWD/mswindows/osgeo4w:/c/windows32/system32:/c/windows:/c/windows32/system32:/c/windows
rm -f $srcenv $dstenv $diffenv
}
-# Avoid GRASS' old msys
-! [ -f $OSGEO4W_ROOT_MSYS/etc/ini/msys.bat ] || mv $OSGEO4W_ROOT_MSYS/etc/ini/msys.bat $OSGEO4W_ROOT_MSYS/etc/ini/msys.bat.off
-
fetchenv $OSGEO4W_ROOT_MSYS/bin/o4w_env.bat
-fetchenv $OSGEO4W_ROOT_MSYS/bin/py3_env.bat
-! [ -f $OSGEO4W_ROOT_MSYS/etc/ini/msys.bat.off ] || mv $OSGEO4W_ROOT_MSYS/etc/ini/msys.bat.off $OSGEO4W_ROOT_MSYS/etc/ini/msys.bat
-
-PATH=/mingw${MINGW_POSTFIX}/lib/ccache/bin:$PATH
+PATH=/mingw64/lib/ccache/bin:$PATH
T0=$(date +%s)
LT=$T0
@@ -125,42 +106,19 @@
exec 3>&1 > >(tee mswindows/osgeo4w/package.log) 2>&1
-if [ "$MINGW_POSTFIX" = "64" ]; then
- mingw_libgcc=libgcc_s_seh-1.dll
-else
- mingw_libgcc=libgcc_s_dw2-1.dll
-fi
-
-DLLS="/mingw${MINGW_POSTFIX}/bin/zlib1.dll
- /mingw${MINGW_POSTFIX}/bin/libbz2-1.dll
- /mingw${MINGW_POSTFIX}/bin/libiconv-2.dll
- /mingw${MINGW_POSTFIX}/bin/libexpat-1.dll
- /mingw${MINGW_POSTFIX}/bin/libfontconfig-1.dll
- /mingw${MINGW_POSTFIX}/bin/libintl-8.dll
- /mingw${MINGW_POSTFIX}/bin/libsystre-0.dll
- /mingw${MINGW_POSTFIX}/bin/libtre-5.dll
- /mingw${MINGW_POSTFIX}/bin/libwinpthread-1.dll
- /mingw${MINGW_POSTFIX}/bin/libcairo-2.dll
- /mingw${MINGW_POSTFIX}/bin/libpixman-1-0.dll
- /mingw${MINGW_POSTFIX}/bin/libpng16-16.dll
- /mingw${MINGW_POSTFIX}/bin/libfreetype-6.dll
- /mingw${MINGW_POSTFIX}/bin/libharfbuzz-0.dll
- /mingw${MINGW_POSTFIX}/bin/libglib-2.0-0.dll
- /mingw${MINGW_POSTFIX}/bin/libgraphite2.dll
- /mingw${MINGW_POSTFIX}/bin/libpcre-1.dll
- /mingw${MINGW_POSTFIX}/bin/libstdc++-6.dll
- /mingw${MINGW_POSTFIX}/bin/$mingw_libgcc"
-
-if [ "$MINGW_POSTFIX" = "64" ]; then
- conf_host=x86_64-w64-mingw32
- # https://trac.osgeo.org/osgeo4w/ticket/550
- conf_opts="--with-liblas=$PWD/mswindows/osgeo4w/liblas-config"
-else
- conf_host=i386-w64-mingw32
- # https://trac.osgeo.org/osgeo4w/ticket/539
- # LAS support hopefully only temporarily disabled on 32bit
- conf_opts=
-fi
+DLLS="
+ /mingw64/bin/zlib1.dll
+ /mingw64/bin/libbz2-1.dll
+ /mingw64/bin/libiconv-2.dll
+ /mingw64/bin/libintl-8.dll
+ /mingw64/bin/libsystre-0.dll
+ /mingw64/bin/libtre-5.dll
+ /mingw64/bin/libwinpthread-1.dll
+ /mingw64/bin/libpng16-16.dll
+ /mingw64/bin/libpcre-1.dll
+ /mingw64/bin/libstdc++-6.dll
+ /mingw64/bin/libgcc_s_seh-1.dll
+"
if ! [ -f mswindows/osgeo4w/configure-stamp ]; then
if [ -e include/Make/Platform.make ] ; then
@@ -171,17 +129,17 @@
log remove old logs
rm -f mswindows/osgeo4w/package.log.*
- mkdir -p dist.$conf_host/bin
- cp -uv $DLLS dist.$conf_host/bin
+ mkdir -p dist.x86_64-w64-mingw32/bin
+ cp -uv $DLLS dist.x86_64-w64-mingw32/bin
mkdir -p mswindows/osgeo4w/lib
cp -uv $OSGEO4W_ROOT_MSYS/lib/libpq.lib mswindows/osgeo4w/lib/pq.lib
- cp -uv $OSGEO4W_ROOT_MSYS/lib/proj_i.lib mswindows/osgeo4w/lib/proj.lib
cp -uv $OSGEO4W_ROOT_MSYS/lib/sqlite3_i.lib mswindows/osgeo4w/lib/sqlite3.lib
+ cp -uv $OSGEO4W_ROOT_MSYS/lib/cairo.lib mswindows/osgeo4w/lib/libcairo.lib
log configure
./configure \
- --host=$conf_host \
- --with-libs="$OSGEO4W_ROOT/lib" \
+ --host=x86_64-w64-mingw32 \
+ --with-libs="$OSGEO4W_ROOT_MSYS/lib" \
--with-includes=$OSGEO4W_ROOT_MSYS/include \
--libexecdir=$OSGEO4W_ROOT_MSYS/bin \
@@ -194,10 +152,10 @@
--enable-largefile \
--with-fftw \
--with-freetype \
- --with-freetype-includes=/mingw${MINGW_POSTFIX}/include/freetype2 \
+ --with-freetype-includes=$OSGEO4W_ROOT_MSYS/include/freetype2 \
--with-proj-share=$OSGEO4W_ROOT_MSYS/share/proj \
--with-proj-includes=$OSGEO4W_ROOT_MSYS/include \
- --with-proj-libs=$PWD/mswindows/osgeo4w/lib \
+ --with-proj-libs=$OSGEO4W_ROOT_MSYS/lib \
--with-postgres \
--with-postgres-includes=$OSGEO4W_ROOT_MSYS/include \
--with-postgres-libs=$PWD/mswindows/osgeo4w/lib \
@@ -211,10 +169,11 @@
--with-zstd \
--with-odbc \
--with-cairo \
+ --with-cairo-includes=$OSGEO4W_ROOT_MSYS/include \
+ --with-cairo-ldflags="-L$PWD/mswindows/osgeo4w/lib -lcairo" \
--with-opengl=windows \
- --with-bzlib $conf_opts
-# see #3047
-# --with-mysql
+ --with-bzlib \
+ --with-liblas=$PWD/mswindows/osgeo4w/liblas-config
touch mswindows/osgeo4w/configure-stamp
fi
@@ -248,8 +207,7 @@
if [ -n "$PACKAGE_PATCH" ]; then
log building vc libraries
- OSGEO4W_POSTFIX=$OSGEO4W_POSTFIX sh \
- mswindows/osgeo4w/mklibs.sh $OSGEO4W_ROOT_MSYS/apps/grass/grass$POSTFIX/lib/*.${MAJOR}.${MINOR}.dll
+ sh mswindows/osgeo4w/mklibs.sh $OSGEO4W_ROOT_MSYS/apps/grass/grass$POSTFIX/lib/*.${MAJOR}.${MINOR}.dll
mv mswindows/osgeo4w/vc/grass*.lib $OSGEO4W_ROOT_MSYS/apps/grass/grass$POSTFIX/lib
log creating package
@@ -267,8 +225,6 @@
# copy dependencies (TODO: to be reduced)
cp -uv $DLLS apps/grass/grass$POSTFIX/bin
- cp -uv /mingw${MINGW_POSTFIX}/etc/fonts/fonts.conf \
- apps/grass/grass$POSTFIX/etc
# creating grass package
/bin/tar -cjf $PDIR/grass$PACKAGE_POSTFIX-$VERSION-$PACKAGE_PATCH.tar.bz2 \
@@ -277,7 +233,6 @@
bin/python-${GRASS_EXECUTABLE}.bat \
etc/postinstall/grass${PACKAGE_POSTFIX}.bat \
etc/preremove/grass${PACKAGE_POSTFIX}.bat
-
fi
log
diff -ur grass-7.8.5/mswindows/osgeo4w/postinstall.bat ../mswindows/osgeo4w/postinstall.bat
--- grass-7.8.5/mswindows/osgeo4w/postinstall.bat 2020-12-21 19:40:15.000000000 +0100
+++ ../mswindows/osgeo4w/postinstall.bat 2021-02-18 22:16:03.605663800 +0100
@@ -1,10 +1,12 @@
set ICON=%OSGEO4W_ROOT%\apps\grass\grass@POSTFIX@\gui\icons\grass_osgeo.ico
set BATCH=%OSGEO4W_ROOT%\bin\@GRASS_EXECUTABLE@.bat
textreplace -std -t "%BATCH%"
-textreplace -std -t "%OSGEO4W_ROOT%"\apps\grass\grass@POSTFIX@\etc\fontcap
+textreplace -std -t "%OSGEO4W_ROOT%\apps\grass\grass@POSTFIX@\etc\fontcap"
-if not %OSGEO4W_MENU_LINKS%==0 xxmklink "%OSGEO4W_STARTMENU%\GRASS GIS @VERSION@.lnk" "%BATCH%" "--gui" \ "Launch GRASS GIS @VERSION@" 1 "%ICON%"
-if not %OSGEO4W_DESKTOP_LINKS%==0 xxmklink "%OSGEO4W_DESKTOP%\GRASS GIS @VERSION@.lnk" "%BATCH%" "--gui" \ "Launch GRASS GIS @VERSION@" 1 "%ICON%"
+for /F "tokens=* USEBACKQ" %%F IN (`getspecialfolder Documents`) do set DOCUMENTS=%%F
+
+if not %OSGEO4W_MENU_LINKS%==0 xxmklink "%OSGEO4W_STARTMENU%\GRASS GIS @VERSION@.lnk" "%BATCH%" "--gui" "%DOCUMENTS%" "Launch GRASS GIS @VERSION@" 1 "%ICON%"
+if not %OSGEO4W_DESKTOP_LINKS%==0 xxmklink "%OSGEO4W_DESKTOP%\GRASS GIS @VERSION@.lnk" "%BATCH%" "--gui" "%DOCUMENTS%" "Launch GRASS GIS @VERSION@" 1 "%ICON%"
rem run g.mkfontcap outside a GRASS session during
rem an OSGeo4W installation for updating paths to fonts
diff -ur grass-7.8.5/mswindows/osgeo4w/config.h.vc ../mswindows/osgeo4w/config.h.vc
--- grass-7.8.5/mswindows/osgeo4w/config.h.vc 2020-12-21 19:40:15.000000000 +0100
+++ ../mswindows/osgeo4w/config.h.vc 2021-03-01 12:52:05.809216000 +0100
@@ -298,4 +298,6 @@
/* define if langinfo.h exists */
/* #undef HAVE_LANGINFO_H */
+#define HAVE_PROJ_H 1
+
#endif /* _config_h */
diff -u grass-7.8.5/gui/wxpython/wxgui.py ../grass-7.8.5/gui/wxpython/wxgui.py
--- grass-7.8.5/gui/wxpython/wxgui.py 2020-12-21 19:40:15.000000000 +0100
+++ ../grass-7.8.5/gui/wxpython/wxgui.py 2021-03-03 23:14:36.234361600 +0100
@@ -62,6 +62,11 @@
:return: True
"""
+
+ for p in os.getenv("PATH").split(";"):
+ if os.path.exists(p):
+ os.add_dll_directory(p)
+
# create splash screen
introImagePath = os.path.join(globalvar.IMGDIR, "splash_screen.png")
introImage = wx.Image(introImagePath, wx.BITMAP_TYPE_PNG)