Mercurial > hg > orthanc-python
annotate Resources/Builders/MinGW32-Python3.8/docker-internal.sh @ 227:9574f06d8588 default tip
todo
author | Alain Mazy <am@orthanc.team> |
---|---|
date | Tue, 24 Sep 2024 08:54:11 +0200 |
parents | 3678a028f1f6 |
children |
rev | line source |
---|---|
33
ce5b6116e6cd
New builders for Windows: Supporting 32 / 64bit with Python 2.7 / 3.7 / 3.8
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1 #!/bin/bash |
219
3678a028f1f6
making the project REUSE-compliant
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
163
diff
changeset
|
2 |
3678a028f1f6
making the project REUSE-compliant
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
163
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:
163
diff
changeset
|
4 # SPDX-License-Identifier: AGPL-3.0-or-later |
3678a028f1f6
making the project REUSE-compliant
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
163
diff
changeset
|
5 |
3678a028f1f6
making the project REUSE-compliant
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
163
diff
changeset
|
6 ## |
3678a028f1f6
making the project REUSE-compliant
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
163
diff
changeset
|
7 ## Python plugin for Orthanc |
3678a028f1f6
making the project REUSE-compliant
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
163
diff
changeset
|
8 ## Copyright (C) 2020-2023 Osimis S.A., Belgium |
3678a028f1f6
making the project REUSE-compliant
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
163
diff
changeset
|
9 ## Copyright (C) 2024-2024 Orthanc Team SRL, Belgium |
3678a028f1f6
making the project REUSE-compliant
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
163
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:
163
diff
changeset
|
11 ## |
3678a028f1f6
making the project REUSE-compliant
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
163
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:
163
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:
163
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:
163
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:
163
diff
changeset
|
16 ## |
3678a028f1f6
making the project REUSE-compliant
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
163
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:
163
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:
163
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:
163
diff
changeset
|
20 ## Affero General Public License for more details. |
3678a028f1f6
making the project REUSE-compliant
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
163
diff
changeset
|
21 ## |
3678a028f1f6
making the project REUSE-compliant
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
163
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:
163
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:
163
diff
changeset
|
24 ## |
3678a028f1f6
making the project REUSE-compliant
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
163
diff
changeset
|
25 |
3678a028f1f6
making the project REUSE-compliant
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
163
diff
changeset
|
26 |
33
ce5b6116e6cd
New builders for Windows: Supporting 32 / 64bit with Python 2.7 / 3.7 / 3.8
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
27 set -ex |
ce5b6116e6cd
New builders for Windows: Supporting 32 / 64bit with Python 2.7 / 3.7 / 3.8
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
28 |
ce5b6116e6cd
New builders for Windows: Supporting 32 / 64bit with Python 2.7 / 3.7 / 3.8
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
29 mkdir /tmp/source-writeable |
ce5b6116e6cd
New builders for Windows: Supporting 32 / 64bit with Python 2.7 / 3.7 / 3.8
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
30 |
ce5b6116e6cd
New builders for Windows: Supporting 32 / 64bit with Python 2.7 / 3.7 / 3.8
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
31 cp -r /source/CMakeLists.txt /tmp/source-writeable/ |
ce5b6116e6cd
New builders for Windows: Supporting 32 / 64bit with Python 2.7 / 3.7 / 3.8
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
32 cp -r /source/Sources /tmp/source-writeable/ |
ce5b6116e6cd
New builders for Windows: Supporting 32 / 64bit with Python 2.7 / 3.7 / 3.8
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
33 cp -r /source/Resources /tmp/source-writeable/ |
ce5b6116e6cd
New builders for Windows: Supporting 32 / 64bit with Python 2.7 / 3.7 / 3.8
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
34 |
ce5b6116e6cd
New builders for Windows: Supporting 32 / 64bit with Python 2.7 / 3.7 / 3.8
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
35 mkdir /tmp/build |
ce5b6116e6cd
New builders for Windows: Supporting 32 / 64bit with Python 2.7 / 3.7 / 3.8
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
36 cd /tmp/build |
ce5b6116e6cd
New builders for Windows: Supporting 32 / 64bit with Python 2.7 / 3.7 / 3.8
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
37 |
148
8335b42be9fc
migration to UCLouvain servers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
111
diff
changeset
|
38 wget https://orthanc.uclouvain.be/downloads/third-party-downloads/Python/python-3.8.3-win32.zip |
33
ce5b6116e6cd
New builders for Windows: Supporting 32 / 64bit with Python 2.7 / 3.7 / 3.8
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
39 unzip python-3.8.3-win32.zip |
ce5b6116e6cd
New builders for Windows: Supporting 32 / 64bit with Python 2.7 / 3.7 / 3.8
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
40 |
ce5b6116e6cd
New builders for Windows: Supporting 32 / 64bit with Python 2.7 / 3.7 / 3.8
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
41 if [ "$1" == "Release" ]; then |
ce5b6116e6cd
New builders for Windows: Supporting 32 / 64bit with Python 2.7 / 3.7 / 3.8
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
42 LIBRARY_NAME=python38.lib |
ce5b6116e6cd
New builders for Windows: Supporting 32 / 64bit with Python 2.7 / 3.7 / 3.8
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
43 else |
ce5b6116e6cd
New builders for Windows: Supporting 32 / 64bit with Python 2.7 / 3.7 / 3.8
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
44 LIBRARY_NAME=python38_d.lib |
ce5b6116e6cd
New builders for Windows: Supporting 32 / 64bit with Python 2.7 / 3.7 / 3.8
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
45 fi |
ce5b6116e6cd
New builders for Windows: Supporting 32 / 64bit with Python 2.7 / 3.7 / 3.8
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
46 |
ce5b6116e6cd
New builders for Windows: Supporting 32 / 64bit with Python 2.7 / 3.7 / 3.8
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
47 cmake /tmp/source-writeable/ \ |
ce5b6116e6cd
New builders for Windows: Supporting 32 / 64bit with Python 2.7 / 3.7 / 3.8
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
48 -DCMAKE_BUILD_TYPE=$1 \ |
ce5b6116e6cd
New builders for Windows: Supporting 32 / 64bit with Python 2.7 / 3.7 / 3.8
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
49 -DSTATIC_BUILD=ON \ |
163
54991a36af1d
fix mingw builds that are not compatible with boost 1.85.0 in the Docker image
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
148
diff
changeset
|
50 -DUSE_LEGACY_BOOST=ON \ |
33
ce5b6116e6cd
New builders for Windows: Supporting 32 / 64bit with Python 2.7 / 3.7 / 3.8
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
51 -DPYTHON_VERSION=3.8 \ |
ce5b6116e6cd
New builders for Windows: Supporting 32 / 64bit with Python 2.7 / 3.7 / 3.8
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
52 -DPYTHON_LIBRARY_NAME=${LIBRARY_NAME} \ |
ce5b6116e6cd
New builders for Windows: Supporting 32 / 64bit with Python 2.7 / 3.7 / 3.8
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
53 -DPYTHON_WINDOWS_ROOT=/tmp/build/Python-3.8.3-win32/ \ |
36
fd58eb5749ed
CMake simplification using DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
33
diff
changeset
|
54 -DCMAKE_TOOLCHAIN_FILE=/source/Resources/Orthanc/Toolchains/MinGW-W64-Toolchain32.cmake \ |
33
ce5b6116e6cd
New builders for Windows: Supporting 32 / 64bit with Python 2.7 / 3.7 / 3.8
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
55 -DCMAKE_INSTALL_PREFIX=/target |
ce5b6116e6cd
New builders for Windows: Supporting 32 / 64bit with Python 2.7 / 3.7 / 3.8
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
56 |
ce5b6116e6cd
New builders for Windows: Supporting 32 / 64bit with Python 2.7 / 3.7 / 3.8
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
57 make -j`nproc` |
ce5b6116e6cd
New builders for Windows: Supporting 32 / 64bit with Python 2.7 / 3.7 / 3.8
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
58 |
ce5b6116e6cd
New builders for Windows: Supporting 32 / 64bit with Python 2.7 / 3.7 / 3.8
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
59 if [ "$1" == "Release" ]; then |
ce5b6116e6cd
New builders for Windows: Supporting 32 / 64bit with Python 2.7 / 3.7 / 3.8
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
60 i686-w64-mingw32-strip ./libOrthancPython.dll |
ce5b6116e6cd
New builders for Windows: Supporting 32 / 64bit with Python 2.7 / 3.7 / 3.8
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
61 fi |
ce5b6116e6cd
New builders for Windows: Supporting 32 / 64bit with Python 2.7 / 3.7 / 3.8
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
62 |
ce5b6116e6cd
New builders for Windows: Supporting 32 / 64bit with Python 2.7 / 3.7 / 3.8
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
63 make install |