-
Notifications
You must be signed in to change notification settings - Fork 1
/
grass_compile.sh
55 lines (45 loc) · 1.26 KB
/
grass_compile.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
#!/bin/sh
# Compile GRASS versions (update source code from Git repository)
#
# Options:
# - src postfix, eg. '_trunk'
# - pkg postfix, eg. '-daily'
SRC_DIR=/usr/src
PACKAGEDIR=mswindows/osgeo4w/package
PATH=/usr/bin:/mingw64/bin:/c/osgeo4w/bin:/c/windows/syswow64:${PATH}
LC_ALL=C
function rm_package_7 {
for f in `find $PACKAGEDIR/grass*.tar.bz2 -mtime +7 2>/dev/null`; do
rm -rfv $f
done
}
function compile {
GRASS_DIR=$1
PACKAGE_POSTFIX=$2
cd $SRC_DIR/$GRASS_DIR
git pull
rm -f d*.o # remove obj dumps
rm_package_7
curr=`ls -t $PACKAGEDIR/ 2>/dev/null | head -n1 | cut -d'-' -f5 | cut -d'.' -f1`
if [ $? -eq 0 ]; then
num=$(($curr+1))
else
num=1
fi
rev=`git rev-parse --short HEAD`
package="$rev-$num"
echo "Compiling $GRASS_DIR ($package)..."
rm -f mswindows/osgeo4w/configure-stamp
PACKAGE_PATCH=$package PACKAGE_POSTFIX=$PACKAGE_POSTFIX \
OSGEO4W_ROOT_MSYS=/c/osgeo4w \
VCPATH="C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.29.30133\bin\Hostx86\x64" \
./mswindows/osgeo4w/package.sh
}
if test -z $1 ; then
while read version; do
compile grass$version -daily
done < dev_packages.csv
else
compile grass$1
fi
exit 0