5
5
# MODULE: crosscompile.sh
6
6
# AUTHOR(S): Huidae Cho <grass4u gmail.com>
7
7
# PURPOSE: Builds a cross-compiled portable package of GRASS GIS
8
- # COPYRIGHT: (C) 2019, 2020 by Huidae Cho and the GRASS Development Team
8
+ # COPYRIGHT: (C) 2019-2021 by Huidae Cho and the GRASS Development Team
9
9
#
10
10
# This program is free software under the GNU General Public
11
11
# License (>=v2). Read the file COPYING that comes with GRASS
15
15
#
16
16
# This script requires MXE <https://mxe.cc/> for cross-compilation and was
17
17
# tested on Slackware 14.2 x86_64 with up-to-date packages from slackpkg and
18
- # sbopkg.
18
+ # sbopkg. It was also tested on WSLackware
19
+ # <https://github.com/Mohsens22/WSLackware> in WSL
20
+ # <https://docs.microsoft.com/en-us/windows/wsl/>.
19
21
#
20
22
# Basic steps:
21
23
#
29
31
#
30
32
# cd ~/usr/src
31
33
# git clone https://github.com/OSGeo/grass.git
34
+ # git clone https://github.com/OSGeo/grass-addons.git
32
35
# cd grass
33
36
# mswindows/crosscompile.sh --mxe-path=$HOME/usr/src/mxe --update --package \
34
37
# > crosscompile.log 2>&1
39
42
40
43
# default paths, but can be overriden from the command line
41
44
mxe_path=${MXE_PATH-$HOME / usr/ local/ src/ mxe}
45
+ addons_path=${ADDONS_PATH-../ grass-addons}
42
46
freetype_include=${FREETYPE_INCLUDE-/ usr/ include/ freetype2}
43
47
44
48
# process options
@@ -52,6 +56,7 @@ Usage: crosscompile.sh [OPTIONS]
52
56
53
57
-h, --help display this help message
54
58
--mxe-path=PATH MXE path (default: $HOME/usr/local/src/mxe)
59
+ --addons-path=PATH grass-addons path (default: ../grass-addons)
55
60
--freetype-include=PATH FreeType include path
56
61
(default: /usr/include/freetype2)
57
62
--update update the current branch
63
68
--mxe-path=* )
64
69
mxe_path=` echo $opt | sed ' s/^[^=]*=//' `
65
70
;;
71
+ --addons-path=* )
72
+ addons_path=` echo $opt | sed ' s/^[^=]*=//' `
73
+ ;;
66
74
--freetype-include=* )
67
75
freetype_include=` echo $opt | sed ' s/^[^=]*=//' `
68
76
;;
@@ -137,6 +145,18 @@ LDFLAGS="-lcurses" \
137
145
138
146
make clean default
139
147
148
+ if [ -d $addons_path ]; then
149
+ MODULE_TOPDIR=` pwd`
150
+ (
151
+ cd $addons_path
152
+ if [ $update -eq 1 -a -d .git ]; then
153
+ git pull
154
+ fi
155
+ cd src
156
+ make MODULE_TOPDIR=$MODULE_TOPDIR clean default
157
+ )
158
+ fi
159
+
140
160
build_arch=` sed -n ' /^ARCH[ \t]*=/{s/^.*=[ \t]*//; p}' include/Make/Platform.make`
141
161
for i in \
142
162
config.log \
@@ -185,6 +205,17 @@ PKG_CONFIG=$mxe_bin-pkg-config \
185
205
186
206
make clean default
187
207
208
+ if [ -d $addons_path ]; then
209
+ (
210
+ cd $addons_path
211
+ if [ $update -eq 1 -a -d .git ]; then
212
+ git pull
213
+ fi
214
+ cd src
215
+ make MODULE_TOPDIR=$MODULE_TOPDIR clean default
216
+ )
217
+ fi
218
+
188
219
arch=` sed -n ' /^ARCH[ \t]*=/{s/^.*=[ \t]*//; p}' include/Make/Platform.make`
189
220
for i in \
190
221
config.log \
@@ -306,12 +337,14 @@ rem set GRASS_PYTHON=%~d0\Python39\python.exe
306
337
set GISBASE=%~dp0
307
338
set GISBASE=%GISBASE:~0,-1%
308
339
309
- rem If % GRASS_SH% is externally defined, that shell will be used; Otherwise,
310
- rem % GISBASE% \etc\sh.exe will be used if it exists; If not, cmd.exe will be
311
- rem used; This check is mainly for supporting BusyBox for Windows
340
+ rem If GRASS_SH is externally defined, that shell will be used; Otherwise,
341
+ rem GISBASE\etc\sh.exe will be used if it exists; If not, cmd.exe will be used;
342
+ rem This check is mainly for supporting BusyBox for Windows
312
343
rem (https://frippery.org/busybox/)
313
- if not defined GRASS_SH set GRASS_SH=%GISBASE%\etc\sh.exe
314
- if not exist "%GRASS_SH%" set GRASS_SH=
344
+ if not defined GRASS_SH (
345
+ set GRASS_SH=%GISBASE%\etc\sh.exe
346
+ if not exist "!GRASS_SH!" set GRASS_SH=
347
+ )
315
348
316
349
set GRASS_PROJSHARE=%GISBASE%\share\proj
317
350
0 commit comments