Mercurial > hg > orthanc-python
annotate Resources/Builders/Debian/docker-internal.sh @ 108:2389ec6ec803
preparing for release
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Wed, 23 Feb 2022 18:40:20 +0100 |
parents | 53f3920af4c3 |
children | 3678a028f1f6 |
rev | line source |
---|---|
0 | 1 #!/bin/bash |
2 set -ex | |
3 | |
88
81a0975a2479
distinguishing Debian docker-based builds between buster and bullseye
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
9
diff
changeset
|
4 BUILD_TYPE=$1 |
81a0975a2479
distinguishing Debian docker-based builds between buster and bullseye
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
9
diff
changeset
|
5 PYTHON_VERSION=$2 |
81a0975a2479
distinguishing Debian docker-based builds between buster and bullseye
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
9
diff
changeset
|
6 USER_ID=$3 |
81a0975a2479
distinguishing Debian docker-based builds between buster and bullseye
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
9
diff
changeset
|
7 GROUP_ID=$4 |
81a0975a2479
distinguishing Debian docker-based builds between buster and bullseye
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
9
diff
changeset
|
8 |
81a0975a2479
distinguishing Debian docker-based builds between buster and bullseye
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
9
diff
changeset
|
9 # Create the same user and group than the one who is running the |
81a0975a2479
distinguishing Debian docker-based builds between buster and bullseye
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
9
diff
changeset
|
10 # "./docker-{distro}-compile.sh" script on the hosting system (*) |
81a0975a2479
distinguishing Debian docker-based builds between buster and bullseye
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
9
diff
changeset
|
11 groupadd -g ${GROUP_ID} -r orthanc |
81a0975a2479
distinguishing Debian docker-based builds between buster and bullseye
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
9
diff
changeset
|
12 useradd -u ${USER_ID} -r -g orthanc orthanc |
81a0975a2479
distinguishing Debian docker-based builds between buster and bullseye
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
9
diff
changeset
|
13 |
81a0975a2479
distinguishing Debian docker-based builds between buster and bullseye
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
9
diff
changeset
|
14 apt-get update |
90
53f3920af4c3
install Mercurial from sources in Docker for Debian
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
89
diff
changeset
|
15 DEBIAN_FRONTEND=noninteractive apt-get -y install nano build-essential unzip cmake pkg-config python libpython3-dev curl |
89
74a51200a134
fix error in Docker with debconf
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
88
diff
changeset
|
16 apt-get -y clean |
88
81a0975a2479
distinguishing Debian docker-based builds between buster and bullseye
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
9
diff
changeset
|
17 rm -rf /var/lib/apt/lists/* |
81a0975a2479
distinguishing Debian docker-based builds between buster and bullseye
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
9
diff
changeset
|
18 |
90
53f3920af4c3
install Mercurial from sources in Docker for Debian
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
89
diff
changeset
|
19 |
53f3920af4c3
install Mercurial from sources in Docker for Debian
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
89
diff
changeset
|
20 # On Bullseye, we get "stat: cannot statx |
53f3920af4c3
install Mercurial from sources in Docker for Debian
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
89
diff
changeset
|
21 # '/usr/share/mercurial/hgext.rc': Operation not permitted" if |
53f3920af4c3
install Mercurial from sources in Docker for Debian
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
89
diff
changeset
|
22 # installing the "mercurial" package using apt-get. As a consequence, |
53f3920af4c3
install Mercurial from sources in Docker for Debian
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
89
diff
changeset
|
23 # we manually install Mercurial from sources. |
53f3920af4c3
install Mercurial from sources in Docker for Debian
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
89
diff
changeset
|
24 MERCURIAL=mercurial-5.4.1 |
53f3920af4c3
install Mercurial from sources in Docker for Debian
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
89
diff
changeset
|
25 cd /tmp |
53f3920af4c3
install Mercurial from sources in Docker for Debian
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
89
diff
changeset
|
26 curl https://www.mercurial-scm.org/release/${MERCURIAL}.tar.gz > ${MERCURIAL}.tar.gz |
53f3920af4c3
install Mercurial from sources in Docker for Debian
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
89
diff
changeset
|
27 tar xvf ${MERCURIAL}.tar.gz |
53f3920af4c3
install Mercurial from sources in Docker for Debian
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
89
diff
changeset
|
28 export PATH=${PATH}:/tmp/${MERCURIAL}/ |
53f3920af4c3
install Mercurial from sources in Docker for Debian
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
89
diff
changeset
|
29 |
53f3920af4c3
install Mercurial from sources in Docker for Debian
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
89
diff
changeset
|
30 |
9 | 31 mkdir /tmp/source-writeable |
32 | |
33 cp -r /source/CMakeLists.txt /tmp/source-writeable/ | |
34 cp -r /source/Sources /tmp/source-writeable/ | |
35 cp -r /source/Resources /tmp/source-writeable/ | |
36 | |
0 | 37 mkdir /tmp/build |
38 cd /tmp/build | |
39 | |
9 | 40 cmake /tmp/source-writeable/ \ |
88
81a0975a2479
distinguishing Debian docker-based builds between buster and bullseye
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
9
diff
changeset
|
41 -DCMAKE_BUILD_TYPE=${BUILD_TYPE} \ |
81a0975a2479
distinguishing Debian docker-based builds between buster and bullseye
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
9
diff
changeset
|
42 -DPYTHON_VERSION=${PYTHON_VERSION} \ |
0 | 43 -DSTATIC_BUILD=ON \ |
44 -DCMAKE_INSTALL_PREFIX=/target | |
45 | |
46 make -j`nproc` | |
47 | |
48 if [ "$1" == "Release" ]; then | |
49 strip ./libOrthancPython.so | |
50 fi | |
51 | |
88
81a0975a2479
distinguishing Debian docker-based builds between buster and bullseye
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
9
diff
changeset
|
52 # Copy the installation to the host filesystem, using the |
81a0975a2479
distinguishing Debian docker-based builds between buster and bullseye
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
9
diff
changeset
|
53 # newly-created user "orthanc" (*) that corresponds to the user who is |
81a0975a2479
distinguishing Debian docker-based builds between buster and bullseye
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
9
diff
changeset
|
54 # running "./debian-{distro}-compile.sh" script. This allows to avoid |
81a0975a2479
distinguishing Debian docker-based builds between buster and bullseye
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
9
diff
changeset
|
55 # files owned by the "root" user on the host filesystem. |
81a0975a2479
distinguishing Debian docker-based builds between buster and bullseye
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
9
diff
changeset
|
56 su -c "cp /tmp/build/libOrthancPython.so /target" orthanc |