extras/buildbot-emscripten.sh
author Ryan C. Gordon <icculus@icculus.org>
Sun, 17 May 2020 00:58:55 -0400
branchstable-3.0
changeset 1688 62804a972e79
parent 1677 f17e8358de41
permissions -rwxr-xr-x
Move buildbot script changes to stable-3.0 branch.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
1418
7fb71bb9c811 Added buildbot-emscripten.sh, fixed up some minor things in buildbot-os2.sh.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
     1
#!/bin/bash
7fb71bb9c811 Added buildbot-emscripten.sh, fixed up some minor things in buildbot-os2.sh.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
     2
7fb71bb9c811 Added buildbot-emscripten.sh, fixed up some minor things in buildbot-os2.sh.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
     3
if [ -z "$SDKDIR" ]; then
1688
62804a972e79 Move buildbot script changes to stable-3.0 branch.
Ryan C. Gordon <icculus@icculus.org>
parents: 1677
diff changeset
     4
    SDKDIR="/emsdk"
1418
7fb71bb9c811 Added buildbot-emscripten.sh, fixed up some minor things in buildbot-os2.sh.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
     5
fi
7fb71bb9c811 Added buildbot-emscripten.sh, fixed up some minor things in buildbot-os2.sh.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
     6
7fb71bb9c811 Added buildbot-emscripten.sh, fixed up some minor things in buildbot-os2.sh.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
     7
ENVSCRIPT="$SDKDIR/emsdk_env.sh"
7fb71bb9c811 Added buildbot-emscripten.sh, fixed up some minor things in buildbot-os2.sh.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
     8
if [ ! -f "$ENVSCRIPT" ]; then
7fb71bb9c811 Added buildbot-emscripten.sh, fixed up some minor things in buildbot-os2.sh.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
     9
   echo "ERROR: This script expects the Emscripten SDK to be in '$SDKDIR'." 1>&2
7fb71bb9c811 Added buildbot-emscripten.sh, fixed up some minor things in buildbot-os2.sh.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    10
   echo "ERROR: Set the \$SDKDIR environment variable to override this." 1>&2
7fb71bb9c811 Added buildbot-emscripten.sh, fixed up some minor things in buildbot-os2.sh.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    11
   exit 1
7fb71bb9c811 Added buildbot-emscripten.sh, fixed up some minor things in buildbot-os2.sh.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    12
fi
7fb71bb9c811 Added buildbot-emscripten.sh, fixed up some minor things in buildbot-os2.sh.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    13
7fb71bb9c811 Added buildbot-emscripten.sh, fixed up some minor things in buildbot-os2.sh.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    14
TARBALL="$1"
7fb71bb9c811 Added buildbot-emscripten.sh, fixed up some minor things in buildbot-os2.sh.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    15
if [ -z $1 ]; then
7fb71bb9c811 Added buildbot-emscripten.sh, fixed up some minor things in buildbot-os2.sh.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    16
    TARBALL=physfs-emscripten.tar.xz
7fb71bb9c811 Added buildbot-emscripten.sh, fixed up some minor things in buildbot-os2.sh.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    17
fi
7fb71bb9c811 Added buildbot-emscripten.sh, fixed up some minor things in buildbot-os2.sh.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    18
7fb71bb9c811 Added buildbot-emscripten.sh, fixed up some minor things in buildbot-os2.sh.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    19
cd `dirname "$0"`
7fb71bb9c811 Added buildbot-emscripten.sh, fixed up some minor things in buildbot-os2.sh.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    20
cd ..
7fb71bb9c811 Added buildbot-emscripten.sh, fixed up some minor things in buildbot-os2.sh.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    21
PHYSFSBASE=`pwd`
7fb71bb9c811 Added buildbot-emscripten.sh, fixed up some minor things in buildbot-os2.sh.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    22
7fb71bb9c811 Added buildbot-emscripten.sh, fixed up some minor things in buildbot-os2.sh.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    23
echo "Setting up Emscripten SDK environment..."
7fb71bb9c811 Added buildbot-emscripten.sh, fixed up some minor things in buildbot-os2.sh.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    24
source "$ENVSCRIPT"
7fb71bb9c811 Added buildbot-emscripten.sh, fixed up some minor things in buildbot-os2.sh.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    25
7fb71bb9c811 Added buildbot-emscripten.sh, fixed up some minor things in buildbot-os2.sh.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    26
echo "Setting up..."
7fb71bb9c811 Added buildbot-emscripten.sh, fixed up some minor things in buildbot-os2.sh.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    27
cd "$PHYSFSBASE"
7fb71bb9c811 Added buildbot-emscripten.sh, fixed up some minor things in buildbot-os2.sh.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    28
rm -rf buildbot
7fb71bb9c811 Added buildbot-emscripten.sh, fixed up some minor things in buildbot-os2.sh.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    29
mkdir buildbot
7fb71bb9c811 Added buildbot-emscripten.sh, fixed up some minor things in buildbot-os2.sh.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    30
cd buildbot
7fb71bb9c811 Added buildbot-emscripten.sh, fixed up some minor things in buildbot-os2.sh.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    31
7fb71bb9c811 Added buildbot-emscripten.sh, fixed up some minor things in buildbot-os2.sh.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    32
echo "Configuring..."
1677
f17e8358de41 extras: Cleaning up some scripts to work with the newly-recreated buildbot.
Ryan C. Gordon <icculus@icculus.org>
parents: 1426
diff changeset
    33
emcmake cmake -G "Ninja" -DPHYSFS_BUILD_SHARED=False -DCMAKE_BUILD_TYPE=MinSizeRel .. || exit $?
1418
7fb71bb9c811 Added buildbot-emscripten.sh, fixed up some minor things in buildbot-os2.sh.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    34
7fb71bb9c811 Added buildbot-emscripten.sh, fixed up some minor things in buildbot-os2.sh.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    35
echo "Building..."
1688
62804a972e79 Move buildbot script changes to stable-3.0 branch.
Ryan C. Gordon <icculus@icculus.org>
parents: 1677
diff changeset
    36
emmake cmake --build . --config MinSizeRel || exit $?
1418
7fb71bb9c811 Added buildbot-emscripten.sh, fixed up some minor things in buildbot-os2.sh.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    37
1419
e6f3a0fc1701 Added buildbot-raspberrypi.sh and fixed some other buildbot script things.
Ryan C. Gordon <icculus@icculus.org>
parents: 1418
diff changeset
    38
set -e
1418
7fb71bb9c811 Added buildbot-emscripten.sh, fixed up some minor things in buildbot-os2.sh.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    39
rm -rf "$TARBALL" physfs-emscripten
7fb71bb9c811 Added buildbot-emscripten.sh, fixed up some minor things in buildbot-os2.sh.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    40
mkdir -p physfs-emscripten
7fb71bb9c811 Added buildbot-emscripten.sh, fixed up some minor things in buildbot-os2.sh.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    41
echo "Archiving to '$TARBALL' ..."
1419
e6f3a0fc1701 Added buildbot-raspberrypi.sh and fixed some other buildbot script things.
Ryan C. Gordon <icculus@icculus.org>
parents: 1418
diff changeset
    42
cp ../src/physfs.h libphysfs.a physfs-emscripten
e6f3a0fc1701 Added buildbot-raspberrypi.sh and fixed some other buildbot script things.
Ryan C. Gordon <icculus@icculus.org>
parents: 1418
diff changeset
    43
chmod -R a+r physfs-emscripten
e6f3a0fc1701 Added buildbot-raspberrypi.sh and fixed some other buildbot script things.
Ryan C. Gordon <icculus@icculus.org>
parents: 1418
diff changeset
    44
chmod a+x physfs-emscripten
e6f3a0fc1701 Added buildbot-raspberrypi.sh and fixed some other buildbot script things.
Ryan C. Gordon <icculus@icculus.org>
parents: 1418
diff changeset
    45
chmod -R go-w physfs-emscripten
e6f3a0fc1701 Added buildbot-raspberrypi.sh and fixed some other buildbot script things.
Ryan C. Gordon <icculus@icculus.org>
parents: 1418
diff changeset
    46
tar -cJvvf "$TARBALL" physfs-emscripten
1418
7fb71bb9c811 Added buildbot-emscripten.sh, fixed up some minor things in buildbot-os2.sh.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    47
echo "Done."
7fb71bb9c811 Added buildbot-emscripten.sh, fixed up some minor things in buildbot-os2.sh.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    48
7fb71bb9c811 Added buildbot-emscripten.sh, fixed up some minor things in buildbot-os2.sh.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    49
exit 0
7fb71bb9c811 Added buildbot-emscripten.sh, fixed up some minor things in buildbot-os2.sh.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    50
7fb71bb9c811 Added buildbot-emscripten.sh, fixed up some minor things in buildbot-os2.sh.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    51
# end of emscripten-buildbot.sh ...
7fb71bb9c811 Added buildbot-emscripten.sh, fixed up some minor things in buildbot-os2.sh.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    52