Feature #1193 » 0045-emsstetup.sh-Add.patch
platforms/Makefile.am | ||
---|---|---|
EXTRA_DIST = \
|
||
appimage/build_appimages.sh \
|
||
emscripten/emsbuild.sh \
|
||
emscripten/emssetup.sh \
|
||
emscripten/setups/cross-ems.tmpl \
|
||
flatpak/build_flatpak.sh \
|
||
flatpak/org.freeciv.gtk322.yml \
|
platforms/emscripten/emssetup.sh | ||
---|---|---|
#!/bin/sh
|
||
# emssetup.sh: Setup emscripten environment for freeciv build
|
||
#
|
||
# (c) 2024 Freeciv team
|
||
#
|
||
# This script is licensed under Gnu General Public License version 2 or later.
|
||
# See COPYING available from the same location you got this script.
|
||
# https://github.com/emscripten-core/emscripten/blob/main/ChangeLog.md
|
||
EMSDK_VER=3.1.67
|
||
if test "$1" = "" || test "$1" = "-h" || test "$1" = "--help" ; then
|
||
echo "Usage: $0 <target directory>"
|
||
exit 1
|
||
fi
|
||
if test -e "$1" ; then
|
||
echo "$1 exist already!" >&2
|
||
exit 1
|
||
fi
|
||
if ! git clone https://github.com/emscripten-core/emsdk "$1" ; then
|
||
echo "Failed to clone https://github.com/emscripten-core/emsdk" >&2
|
||
exit 1
|
||
fi
|
||
if ! cd "$1" ||
|
||
! ./emsdk install "${EMSDK_VER}" ||
|
||
! ./emsdk activate "${EMSDK_VER}"
|
||
then
|
||
echo "emsdk setup failed!" >&2
|
||
exit 1
|
||
fi
|
scripts/ci-build.sh | ||
---|---|---|
;;
|
||
emsdk)
|
||
# https://github.com/emscripten-core/emscripten/blob/main/ChangeLog.md
|
||
EMSDK_VER=3.1.67
|
||
(
|
||
SRCROOT=$(pwd)
|
||
# Outside source tree
|
||
cd ..
|
||
git clone https://github.com/emscripten-core/emsdk
|
||
cd emsdk
|
||
./emsdk install "${EMSDK_VER}"
|
||
./emsdk activate "${EMSDK_VER}"
|
||
if ! ${SRCROOT}/platforms/emscripten/emssetup.sh emsdk ; then
|
||
exit 1
|
||
fi
|
||
)
|
||
EMSDKDIR="$(cd ../emsdk && pwd)"
|