-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathrefresh-wcb
More file actions
executable file
·115 lines (101 loc) · 2.32 KB
/
refresh-wcb
File metadata and controls
executable file
·115 lines (101 loc) · 2.32 KB
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
#!/bin/bash
# This script will recreate the "wcb" Waf script used to build the
# Wire Cell Toolkit. Normally only developers exercise it.
output="$(pwd)/wcb"
wafurl="https://gitlab.com/ita1024/waf.git"
wafdir="$(pwd)/waf"
waftag="waf-2.0.20"
toolsurl="https://github.com/WireCell/waf-tools.git"
tooldir="$(pwd)"
# initial defaults from waf
tools="doxygen boost bjam"
# add any in cwd, assuming we are sitting in waf-tools
tools="$tools $(echo *.py| sed 's/.py//g')"
usage () {
echo "refresh-wcb [options] [tools]"
echo "Default tools: $tools"
echo "Likely call:"
echo "./refresh-wcb -o /path/to/wire-cell-toolkit/wcb"
exit 1;
}
while getopts "v:w:t:o:W:T:" opt; do
case "$opt" in
v)
waftag="waf-$OPTARG"
;;
w)
wafdir="$(readlink -f $OPTARG)"
;;
t)
tooldir="$(readlink -f $OPTARG)"
;;
o)
output=$OPTARG
;;
W)
wafurl=$OPTARG
;;
T)
toolsurl=$OPTARG
;;
*)
usage
;;
esac
done
shift $((OPTIND-1))
[ "$1" = "--" ] && shift
if [ -n "$1" ] ; then
tools="$@"
fi
if [ -d "$wafdir" ] ; then
pushd $wafdir
git fetch
git checkout $waftag
popd
else
git clone "$wafurl" "$wafdir"
pushd $wafdir
git checkout $waftag
popd
fi
if [ ! -d "$tooldir" ] ; then
git clone "$toolsurl" "$tooldir"
fi
if [ ! -f "$tooldir/smplpkgs.py" ] ; then
echo "Tooldir does not look correct: $tooldir"
exit 1
fi
#toolflags="compat15"
toolflags=""
for tool in $tools ;
do
maybe="$tooldir/${tool}.py"
if [ -f $maybe ] ; then
toolflags="$toolflags,$maybe"
continue
fi
maybe="$wafdir/waflib/Tools/${tool}.py"
if [ -f $maybe ] ; then
toolflags="$toolflags,$tool"
continue
fi
maybe="$wafdir/waflib/extras/${tool}.py"
if [ -f $maybe ] ; then
toolflags="$toolflags,$tool"
continue
fi
echo "Failed to find tool $tool"
exit 1
done
pushd "$wafdir" > /dev/null
#python waf-light --python=python2 --tools=$toolflags
#python2 ./waf-light configure build --tools=$toolflags
## python2 is dead, get over it
python ./waf-light configure build --tools=$toolflags
popd > /dev/null
echo "built waf with tools: $toolflags"
# echo 'WARNING: forcing python2. See GitHub Issue #8'
# sed -i -e 's,/usr/bin/env python$,/usr/bin/env python2,' "$wafdir/waf"
mv "$wafdir/waf" $output
echo "$output"