annotate Resources/Builders/MinGW32-Python3.12/docker-compile.sh @ 227:9574f06d8588 default tip

todo
author Alain Mazy <am@orthanc.team>
date Tue, 24 Sep 2024 08:54:11 +0200
parents 3678a028f1f6
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
160
a5162d8bd2d4 Added Windows builder for Python 3.12
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1 #!/bin/bash
a5162d8bd2d4 Added Windows builder for Python 3.12
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2
219
3678a028f1f6 making the project REUSE-compliant
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 160
diff changeset
3 # SPDX-FileCopyrightText: 2020-2023 Osimis S.A., 2024-2024 Orthanc Team SRL, 2021-2024 Sebastien Jodogne, ICTEAM UCLouvain
3678a028f1f6 making the project REUSE-compliant
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 160
diff changeset
4 # SPDX-License-Identifier: AGPL-3.0-or-later
3678a028f1f6 making the project REUSE-compliant
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 160
diff changeset
5
3678a028f1f6 making the project REUSE-compliant
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 160
diff changeset
6 ##
3678a028f1f6 making the project REUSE-compliant
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 160
diff changeset
7 ## Python plugin for Orthanc
3678a028f1f6 making the project REUSE-compliant
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 160
diff changeset
8 ## Copyright (C) 2020-2023 Osimis S.A., Belgium
3678a028f1f6 making the project REUSE-compliant
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 160
diff changeset
9 ## Copyright (C) 2024-2024 Orthanc Team SRL, Belgium
3678a028f1f6 making the project REUSE-compliant
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 160
diff changeset
10 ## Copyright (C) 2021-2024 Sebastien Jodogne, ICTEAM UCLouvain, Belgium
3678a028f1f6 making the project REUSE-compliant
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 160
diff changeset
11 ##
3678a028f1f6 making the project REUSE-compliant
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 160
diff changeset
12 ## This program is free software: you can redistribute it and/or
3678a028f1f6 making the project REUSE-compliant
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 160
diff changeset
13 ## modify it under the terms of the GNU Affero General Public License
3678a028f1f6 making the project REUSE-compliant
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 160
diff changeset
14 ## as published by the Free Software Foundation, either version 3 of
3678a028f1f6 making the project REUSE-compliant
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 160
diff changeset
15 ## the License, or (at your option) any later version.
3678a028f1f6 making the project REUSE-compliant
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 160
diff changeset
16 ##
3678a028f1f6 making the project REUSE-compliant
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 160
diff changeset
17 ## This program is distributed in the hope that it will be useful, but
3678a028f1f6 making the project REUSE-compliant
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 160
diff changeset
18 ## WITHOUT ANY WARRANTY; without even the implied warranty of
3678a028f1f6 making the project REUSE-compliant
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 160
diff changeset
19 ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
3678a028f1f6 making the project REUSE-compliant
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 160
diff changeset
20 ## Affero General Public License for more details.
3678a028f1f6 making the project REUSE-compliant
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 160
diff changeset
21 ##
3678a028f1f6 making the project REUSE-compliant
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 160
diff changeset
22 ## You should have received a copy of the GNU Affero General Public License
3678a028f1f6 making the project REUSE-compliant
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 160
diff changeset
23 ## along with this program. If not, see <http://www.gnu.org/licenses/>.
3678a028f1f6 making the project REUSE-compliant
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 160
diff changeset
24 ##
3678a028f1f6 making the project REUSE-compliant
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 160
diff changeset
25
3678a028f1f6 making the project REUSE-compliant
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 160
diff changeset
26
160
a5162d8bd2d4 Added Windows builder for Python 3.12
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
27 set -ex
a5162d8bd2d4 Added Windows builder for Python 3.12
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
28
a5162d8bd2d4 Added Windows builder for Python 3.12
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
29 if [ "$1" != "Debug" -a "$1" != "Release" ]; then
a5162d8bd2d4 Added Windows builder for Python 3.12
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
30 echo "Please provide build type: Debug or Release"
a5162d8bd2d4 Added Windows builder for Python 3.12
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
31 exit -1
a5162d8bd2d4 Added Windows builder for Python 3.12
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
32 fi
a5162d8bd2d4 Added Windows builder for Python 3.12
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
33
a5162d8bd2d4 Added Windows builder for Python 3.12
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
34 if [ -t 1 ]; then
a5162d8bd2d4 Added Windows builder for Python 3.12
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
35 # TTY is available => use interactive mode
a5162d8bd2d4 Added Windows builder for Python 3.12
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
36 DOCKER_FLAGS='-i'
a5162d8bd2d4 Added Windows builder for Python 3.12
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
37 fi
a5162d8bd2d4 Added Windows builder for Python 3.12
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
38
a5162d8bd2d4 Added Windows builder for Python 3.12
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
39 ROOT_DIR=`dirname $(readlink -f $0)`/../../..
a5162d8bd2d4 Added Windows builder for Python 3.12
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
40
a5162d8bd2d4 Added Windows builder for Python 3.12
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
41 mkdir -p ${ROOT_DIR}/docker-build/
a5162d8bd2d4 Added Windows builder for Python 3.12
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
42
a5162d8bd2d4 Added Windows builder for Python 3.12
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
43 ( cd ${ROOT_DIR}/Resources/Builders/ && \
a5162d8bd2d4 Added Windows builder for Python 3.12
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
44 docker build \
a5162d8bd2d4 Added Windows builder for Python 3.12
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
45 -f ./Dockerfile-MinGW-BuildEnvironment \
a5162d8bd2d4 Added Windows builder for Python 3.12
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
46 -t mingw-python-build . )
a5162d8bd2d4 Added Windows builder for Python 3.12
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
47
a5162d8bd2d4 Added Windows builder for Python 3.12
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
48 docker run -t ${DOCKER_FLAGS} --rm \
a5162d8bd2d4 Added Windows builder for Python 3.12
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
49 --user $(id -u):$(id -g) \
a5162d8bd2d4 Added Windows builder for Python 3.12
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
50 -v ${ROOT_DIR}:/source:ro \
a5162d8bd2d4 Added Windows builder for Python 3.12
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
51 -v ${ROOT_DIR}/docker-build:/target:rw \
a5162d8bd2d4 Added Windows builder for Python 3.12
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
52 mingw-python-build \
a5162d8bd2d4 Added Windows builder for Python 3.12
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
53 bash /source/Resources/Builders/MinGW32-Python3.12/docker-internal.sh $1
a5162d8bd2d4 Added Windows builder for Python 3.12
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
54
a5162d8bd2d4 Added Windows builder for Python 3.12
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
55 ls -lR ${ROOT_DIR}/docker-build/