-
Notifications
You must be signed in to change notification settings - Fork 0
/
build32.sh
executable file
·66 lines (58 loc) · 1.66 KB
/
build32.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
#!/bin/sh -ex
IM=ns-`date +%Y-%m-%d`.32
IMAGE=$IM.image
CHANGES=$IM.changes
IMAGEPATH="./out"
ZIP=$IM.zip
HEADLESS=-headless
USAGE="usage: `basename $0` -[h?] [-v vm] [-p path] [-u]"
NSVM=
NOZIP=
TEST=
while getopts 'v:p:uth?' opt "$@"; do
case "$opt" in
v) NSVM="$OPTARG";;
h) HEADLESS="";;
p) IMAGEPATH="$OPTARG";;
u) NOZIP="1";;
t) TEST="1";;
\?|*) echo $USAGE
echo ' boot newspeak'
echo ' -h: run headful, not headless'
echo ' -v vm: use the supplied VM instead of the default'
echo ' -p path: where you want the generated image to be placed (default: $IMAGEPATH)'
echo ' -u: unpacked - do not zip (package) the image. Just generate the .image and .changes file.'
echo ' -t: run tests'
echo ' -?: display this help'
test "$opt" = "\?" && exit 0;
exit 1;;
esac
done
if [ -z "$NSVM" ]; then
case `uname -s` in
Linux) NSVM=/usr/lib/nsvm/nsvm;;
Darwin) NSVM="/Applications/Newspeak Spur Virtual Machine.app/Contents/MacOS/Newspeak Virtual Machine"
HEADLESS="";;
*) NSVM=../nsvm/nsvm;;
esac
fi
cp Squeak5.1/Squeak5.1-16548-32bit.image $IMAGE
cp Squeak5.1/Squeak5.1-16548-32bit.changes $CHANGES
cp Squeak5.1/SqueakV50.sources .
"$NSVM" $HEADLESS $COG_FLAGS $IMAGE NewspeakBootstrap.st
if [ ! -z "$TEST" ]; then
"$NSVM" $HEADLESS $COG_FLAGS $IMAGE NewspeakTests.st
fi
if [ -z "$NOZIP" ]; then
git -C ../newspeak log -1 > newspeaktip
git -C ../nsboot log -1 > nsboottip
zip $ZIP $IMAGE $CHANGES newspeaktip nsboottip
mkdir -p $IMAGEPATH || true
mv $ZIP $IMAGEPATH
else
mkdir -p $IMAGEPATH || true
cp -f $IMAGE "$IMAGEPATH/$IMAGE"
cp -f $CHANGES "$IMAGEPATH/$CHANGES"
echo "\n"
echo "`pwd`/$IMAGEPATH/$IMAGE"
fi