Mercurial > hg > orthanc-gcp
annotate Resources/holy-build-box-compile.sh @ 19:a722ca0ad867
back to mainline
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Wed, 26 Jun 2019 15:30:28 +0200 |
parents | 58a9a644bd15 |
children | 4b5362d154f5 |
rev | line source |
---|---|
0 | 1 #!/bin/bash |
2
39bdff8f0247
user management in holy-build-box
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1
diff
changeset
|
2 |
39bdff8f0247
user management in holy-build-box
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1
diff
changeset
|
3 ## |
39bdff8f0247
user management in holy-build-box
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1
diff
changeset
|
4 ## This script compiles cross-distribution Linux binaries thanks to |
39bdff8f0247
user management in holy-build-box
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1
diff
changeset
|
5 ## Holy Build Box: https://github.com/phusion/holy-build-box |
39bdff8f0247
user management in holy-build-box
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1
diff
changeset
|
6 ## |
39bdff8f0247
user management in holy-build-box
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1
diff
changeset
|
7 ## The ideal solution would be to use Linux Standard Base |
39bdff8f0247
user management in holy-build-box
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1
diff
changeset
|
8 ## (LSB). Unfortunately, the LSB C++ compiler is a pre-4.8 gcc that |
39bdff8f0247
user management in holy-build-box
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1
diff
changeset
|
9 ## does not feature full C++11 capabilities, which prevents compiling |
39bdff8f0247
user management in holy-build-box
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1
diff
changeset
|
10 ## the google-cloud-cpp project. |
39bdff8f0247
user management in holy-build-box
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1
diff
changeset
|
11 ## |
39bdff8f0247
user management in holy-build-box
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1
diff
changeset
|
12 |
0 | 13 set -ex |
14 | |
3
cd1231292eb6
build type in holy build box
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2
diff
changeset
|
15 if [ "$1" != "Debug" -a "$1" != "Release" ]; then |
cd1231292eb6
build type in holy build box
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2
diff
changeset
|
16 echo "Please provide build type: Debug or Release" |
cd1231292eb6
build type in holy build box
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2
diff
changeset
|
17 exit -1 |
cd1231292eb6
build type in holy build box
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2
diff
changeset
|
18 fi |
cd1231292eb6
build type in holy build box
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2
diff
changeset
|
19 |
4 | 20 if [ -t 1 ]; then |
21 # TTY is available => use interactive mode | |
22 DOCKER_FLAGS='-i' | |
23 fi | |
24 | |
0 | 25 ROOT_DIR=`dirname $(readlink -f $0)`/.. |
26 | |
2
39bdff8f0247
user management in holy-build-box
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1
diff
changeset
|
27 mkdir -p ${ROOT_DIR}/holy-build-box |
39bdff8f0247
user management in holy-build-box
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1
diff
changeset
|
28 |
4 | 29 docker run -t ${DOCKER_FLAGS} --rm \ |
2
39bdff8f0247
user management in holy-build-box
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1
diff
changeset
|
30 --user $(id -u):$(id -g) \ |
39bdff8f0247
user management in holy-build-box
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1
diff
changeset
|
31 -v ${ROOT_DIR}:/source:ro \ |
39bdff8f0247
user management in holy-build-box
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1
diff
changeset
|
32 -v ${ROOT_DIR}/holy-build-box:/target:rw \ |
39bdff8f0247
user management in holy-build-box
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1
diff
changeset
|
33 phusion/holy-build-box-64:2.0.1 \ |
3
cd1231292eb6
build type in holy build box
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2
diff
changeset
|
34 bash /source/Resources/holy-build-box-internal.sh $1 |
0 | 35 |
36 ls -l ${ROOT_DIR}/holy-build-box/ |