annotate OrthancStone/Samples/WebAssembly/docker-internal.sh @ 1518:433cf964838d

prevents random config. names + typofix + doc
author Benjamin Golinvaux <bgo@osimis.io>
date Fri, 31 Jul 2020 12:47:27 +0200
parents 244ad1e4e76a
children 3eca4f9c2827
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
1492
4b5ec9ea268e Building WebAssembly samples using Docker
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1 #!/bin/bash
4b5ec9ea268e Building WebAssembly samples using Docker
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2 set -ex
4b5ec9ea268e Building WebAssembly samples using Docker
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3
4b5ec9ea268e Building WebAssembly samples using Docker
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4 source /opt/emsdk/emsdk_env.sh
4b5ec9ea268e Building WebAssembly samples using Docker
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5
4b5ec9ea268e Building WebAssembly samples using Docker
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6 # Use a folder that is writeable by non-root users for the Emscripten cache
4b5ec9ea268e Building WebAssembly samples using Docker
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7 export EM_CACHE=/tmp/emscripten-cache
4b5ec9ea268e Building WebAssembly samples using Docker
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8
4b5ec9ea268e Building WebAssembly samples using Docker
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
9 # Get the Orthanc framework
4b5ec9ea268e Building WebAssembly samples using Docker
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
10 cd /tmp/
4b5ec9ea268e Building WebAssembly samples using Docker
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
11 hg clone https://hg.orthanc-server.com/orthanc/
4b5ec9ea268e Building WebAssembly samples using Docker
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
12
1494
5a3ef478deb6 reverted useless change
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1493
diff changeset
13 # Make a copy of the read-only folder containing the source code into
5a3ef478deb6 reverted useless change
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1493
diff changeset
14 # a writeable folder, because of "DownloadPackage.cmake" that writes
5a3ef478deb6 reverted useless change
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1493
diff changeset
15 # to the "ThirdPartyDownloads" folder next to the "CMakeLists.txt"
1492
4b5ec9ea268e Building WebAssembly samples using Docker
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
16 cd /source
1493
c9bdf73a8817 fix docker-internal.sh for CIS
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1492
diff changeset
17 hg clone /source /tmp/source-writeable
1492
4b5ec9ea268e Building WebAssembly samples using Docker
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
18
4b5ec9ea268e Building WebAssembly samples using Docker
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
19 mkdir /tmp/build
4b5ec9ea268e Building WebAssembly samples using Docker
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
20 cd /tmp/build
4b5ec9ea268e Building WebAssembly samples using Docker
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
21
1512
244ad1e4e76a reorganization of folders
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1505
diff changeset
22 cmake /tmp/source-writeable/OrthancStone/Samples/WebAssembly \
1492
4b5ec9ea268e Building WebAssembly samples using Docker
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
23 -DCMAKE_BUILD_TYPE=$1 \
4b5ec9ea268e Building WebAssembly samples using Docker
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
24 -DCMAKE_INSTALL_PREFIX=/target \
4b5ec9ea268e Building WebAssembly samples using Docker
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
25 -DCMAKE_TOOLCHAIN_FILE=${EMSDK}/upstream/emscripten/cmake/Modules/Platform/Emscripten.cmake \
1505
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1494
diff changeset
26 -DORTHANC_FRAMEWORK_ROOT=/tmp/orthanc/OrthancFramework \
1492
4b5ec9ea268e Building WebAssembly samples using Docker
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
27 -DSTATIC_BUILD=ON \
4b5ec9ea268e Building WebAssembly samples using Docker
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
28 -G Ninja
4b5ec9ea268e Building WebAssembly samples using Docker
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
29
4b5ec9ea268e Building WebAssembly samples using Docker
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
30 ninja -j2 install