annotate Aws/holy-build-box-internal.sh @ 197:df0b6998fd27

integration 2.3.0: back to mainline
author Sebastien Jodogne <s.jodogne@gmail.com>
date Tue, 25 Jun 2024 12:38:31 +0200
parents 3c7e0374f28e
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
58
37185ec1cf49 holy build box for S3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1 #!/bin/bash
37185ec1cf49 holy build box for S3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2
37185ec1cf49 holy build box for S3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3 # Cloud storage plugins for Orthanc
145
3c7e0374f28e updated copyright, as Orthanc Team now replaces Osimis
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 141
diff changeset
4 # Copyright (C) 2020-2023 Osimis S.A., Belgium
3c7e0374f28e updated copyright, as Orthanc Team now replaces Osimis
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 141
diff changeset
5 # Copyright (C) 2024-2024 Orthanc Team SRL, Belgium
3c7e0374f28e updated copyright, as Orthanc Team now replaces Osimis
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 141
diff changeset
6 # Copyright (C) 2021-2024 Sebastien Jodogne, ICTEAM UCLouvain, Belgium
58
37185ec1cf49 holy build box for S3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7 #
37185ec1cf49 holy build box for S3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8 # This program is free software: you can redistribute it and/or
37185ec1cf49 holy build box for S3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
9 # modify it under the terms of the GNU Affero General Public License
37185ec1cf49 holy build box for S3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
10 # as published by the Free Software Foundation, either version 3 of
37185ec1cf49 holy build box for S3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
11 # the License, or (at your option) any later version.
37185ec1cf49 holy build box for S3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
12 #
37185ec1cf49 holy build box for S3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
13 # This program is distributed in the hope that it will be useful, but
37185ec1cf49 holy build box for S3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
14 # WITHOUT ANY WARRANTY; without even the implied warranty of
37185ec1cf49 holy build box for S3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
15 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
37185ec1cf49 holy build box for S3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
16 # Affero General Public License for more details.
37185ec1cf49 holy build box for S3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
17 #
37185ec1cf49 holy build box for S3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
18 # You should have received a copy of the GNU Affero General Public License
37185ec1cf49 holy build box for S3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
19 # along with this program. If not, see <http://www.gnu.org/licenses/>.
37185ec1cf49 holy build box for S3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
20
37185ec1cf49 holy build box for S3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
21
37185ec1cf49 holy build box for S3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
22 set -e
37185ec1cf49 holy build box for S3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
23
37185ec1cf49 holy build box for S3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
24 # Activate Holy Build Box environment.
37185ec1cf49 holy build box for S3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
25 source /hbb_exe/activate
37185ec1cf49 holy build box for S3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
26
37185ec1cf49 holy build box for S3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
27 set -ex
37185ec1cf49 holy build box for S3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
28
37185ec1cf49 holy build box for S3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
29 mkdir /tmp/build
37185ec1cf49 holy build box for S3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
30 cd /tmp/build
37185ec1cf49 holy build box for S3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
31
37185ec1cf49 holy build box for S3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
32 # Holy Build Box defines LDFLAGS as "-L/hbb_exe/lib
37185ec1cf49 holy build box for S3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
33 # -static-libstdc++". The "-L/hbb_exe/lib" option results in linking
37185ec1cf49 holy build box for S3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
34 # errors "undefined reference" to `std::__once_callable',
37185ec1cf49 holy build box for S3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
35 # 'std::__once_call' and '__once_proxy'.
37185ec1cf49 holy build box for S3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
36 export LDFLAGS=-static-libstdc++
37185ec1cf49 holy build box for S3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
37 unset LDPATHFLAGS
37185ec1cf49 holy build box for S3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
38 unset SHLIB_LDFLAGS
37185ec1cf49 holy build box for S3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
39 unset LD_LIBRARY_PATH
37185ec1cf49 holy build box for S3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
40 unset LIBRARY_PATH
37185ec1cf49 holy build box for S3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
41
37185ec1cf49 holy build box for S3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
42 mkdir -p /tmp/source-writeable/Aws
37185ec1cf49 holy build box for S3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
43
37185ec1cf49 holy build box for S3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
44 cp -r /source/Common /tmp/source-writeable/
37185ec1cf49 holy build box for S3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
45 cp -r /source/UnitTestsSources /tmp/source-writeable/
37185ec1cf49 holy build box for S3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
46 cp /source/Aws/* /tmp/source-writeable/Aws/ || true # Ignore error about omitting directories
37185ec1cf49 holy build box for S3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
47
37185ec1cf49 holy build box for S3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
48 cmake /tmp/source-writeable/Aws/ \
140
40efe821932a fix LSB build
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 63
diff changeset
49 -DORTHANC_FRAMEWORK_VERSION=1.12.3 \
58
37185ec1cf49 holy build box for S3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
50 -DORTHANC_FRAMEWORK_SOURCE=web \
37185ec1cf49 holy build box for S3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
51 -DCMAKE_BUILD_TYPE=$1 -DSTATIC_BUILD=ON
37185ec1cf49 holy build box for S3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
52
37185ec1cf49 holy build box for S3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
53 # Use only 2 processes (not `nproc`), as this is a very heavy compilation
141
3e9cced85a5b fix build for MSVC 2015
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 140
diff changeset
54 # make -j2
3e9cced85a5b fix build for MSVC 2015
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 140
diff changeset
55
3e9cced85a5b fix build for MSVC 2015
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 140
diff changeset
56 make -j`nproc --all`
58
37185ec1cf49 holy build box for S3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
57
37185ec1cf49 holy build box for S3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
58 ./UnitTests
37185ec1cf49 holy build box for S3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
59
37185ec1cf49 holy build box for S3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
60 if [ "$1" == "Release" ]; then
37185ec1cf49 holy build box for S3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
61 strip ./libOrthancAwsS3Storage.so
37185ec1cf49 holy build box for S3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
62 fi
37185ec1cf49 holy build box for S3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
63
37185ec1cf49 holy build box for S3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
64 cp ./libOrthancAwsS3Storage.so /target/
37185ec1cf49 holy build box for S3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
65 cp ./UnitTests /target/