changeset 2:39bdff8f0247

user management in holy-build-box
author Sebastien Jodogne <s.jodogne@gmail.com>
date Thu, 13 Jun 2019 15:32:35 +0200
parents 179203abadc5
children cd1231292eb6
files Resources/holy-build-box-compile.sh Resources/holy-build-box-internal.sh
diffstat 2 files changed, 22 insertions(+), 8 deletions(-) [+]
line wrap: on
line diff
--- a/Resources/holy-build-box-compile.sh	Thu Jun 13 15:02:06 2019 +0200
+++ b/Resources/holy-build-box-compile.sh	Thu Jun 13 15:32:35 2019 +0200
@@ -1,12 +1,26 @@
 #!/bin/bash
+
+##
+## This script compiles cross-distribution Linux binaries thanks to
+## Holy Build Box: https://github.com/phusion/holy-build-box
+##
+## The ideal solution would be to use Linux Standard Base
+## (LSB). Unfortunately, the LSB C++ compiler is a pre-4.8 gcc that
+## does not feature full C++11 capabilities, which prevents compiling
+## the google-cloud-cpp project.
+##
+
 set -ex
 
 ROOT_DIR=`dirname $(readlink -f $0)`/..
 
+mkdir -p ${ROOT_DIR}/holy-build-box
+
 docker run -t -i --rm \
-       -v ${ROOT_DIR}:/source:ro \
-       -v ${ROOT_DIR}/holy-build-box:/target:rw \
-       phusion/holy-build-box-64:2.0.1 \
-       bash /source/Resources/holy-build-box-internal.sh
+    --user $(id -u):$(id -g) \
+    -v ${ROOT_DIR}:/source:ro \
+    -v ${ROOT_DIR}/holy-build-box:/target:rw \
+    phusion/holy-build-box-64:2.0.1 \
+    bash /source/Resources/holy-build-box-internal.sh
 
 ls -l ${ROOT_DIR}/holy-build-box/
--- a/Resources/holy-build-box-internal.sh	Thu Jun 13 15:02:06 2019 +0200
+++ b/Resources/holy-build-box-internal.sh	Thu Jun 13 15:32:35 2019 +0200
@@ -6,8 +6,8 @@
 
 set -x
 
-mkdir /build
-cd /build
+mkdir /tmp/build
+cd /tmp/build
 
 # Holy Build Box defines LDFLAGS as "-L/hbb_exe/lib
 # -static-libstdc++". The "-L/hbb_exe/lib" option results in linking
@@ -19,8 +19,8 @@
 unset LD_LIBRARY_PATH
 unset LIBRARY_PATH
 
-cp -r /source /source-writeable
-cmake /source-writeable \
+cp -r /source /tmp/source-writeable
+cmake /tmp/source-writeable \
     -DCMAKE_BUILD_TYPE=Release -DSTATIC_BUILD=ON \
     -DORTHANC_FRAMEWORK_SOURCE=web \
     -DCMAKE_INSTALL_PREFIX=/target