annotate Resources/Builders/MinGW64-Python3.12/docker-internal.sh @ 160:a5162d8bd2d4

Added Windows builder for Python 3.12
author Sebastien Jodogne <s.jodogne@gmail.com>
date Thu, 16 May 2024 22:50:11 +0200
parents
children bf43db559950
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 set -ex
a5162d8bd2d4 Added Windows builder for Python 3.12
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3
a5162d8bd2d4 Added Windows builder for Python 3.12
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4 mkdir /tmp/source-writeable
a5162d8bd2d4 Added Windows builder for Python 3.12
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5
a5162d8bd2d4 Added Windows builder for Python 3.12
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6 cp -r /source/CMakeLists.txt /tmp/source-writeable/
a5162d8bd2d4 Added Windows builder for Python 3.12
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7 cp -r /source/Sources /tmp/source-writeable/
a5162d8bd2d4 Added Windows builder for Python 3.12
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8 cp -r /source/Resources /tmp/source-writeable/
a5162d8bd2d4 Added Windows builder for Python 3.12
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
9
a5162d8bd2d4 Added Windows builder for Python 3.12
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
10 mkdir /tmp/build
a5162d8bd2d4 Added Windows builder for Python 3.12
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
11 cd /tmp/build
a5162d8bd2d4 Added Windows builder for Python 3.12
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
12
a5162d8bd2d4 Added Windows builder for Python 3.12
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
13 wget https://orthanc.uclouvain.be/downloads/third-party-downloads/Python/python-3.12.3-win64.zip
a5162d8bd2d4 Added Windows builder for Python 3.12
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
14 unzip python-3.12.3-win64.zip
a5162d8bd2d4 Added Windows builder for Python 3.12
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
15
a5162d8bd2d4 Added Windows builder for Python 3.12
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
16 if [ "$1" == "Release" ]; then
a5162d8bd2d4 Added Windows builder for Python 3.12
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
17 LIBRARY_NAME=python311.lib
a5162d8bd2d4 Added Windows builder for Python 3.12
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
18 else
a5162d8bd2d4 Added Windows builder for Python 3.12
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
19 LIBRARY_NAME=python311_d.lib
a5162d8bd2d4 Added Windows builder for Python 3.12
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
20 fi
a5162d8bd2d4 Added Windows builder for Python 3.12
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
21
a5162d8bd2d4 Added Windows builder for Python 3.12
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
22 cmake /tmp/source-writeable/ \
a5162d8bd2d4 Added Windows builder for Python 3.12
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
23 -DCMAKE_BUILD_TYPE=$1 \
a5162d8bd2d4 Added Windows builder for Python 3.12
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
24 -DSTATIC_BUILD=ON \
a5162d8bd2d4 Added Windows builder for Python 3.12
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
25 -DPYTHON_VERSION=3.11 \
a5162d8bd2d4 Added Windows builder for Python 3.12
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
26 -DPYTHON_LIBRARY_NAME=${LIBRARY_NAME} \
a5162d8bd2d4 Added Windows builder for Python 3.12
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
27 -DPYTHON_WINDOWS_ROOT=/tmp/build/python-3.12.3-win64 \
a5162d8bd2d4 Added Windows builder for Python 3.12
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
28 -DCMAKE_TOOLCHAIN_FILE=/source/Resources/Orthanc/Toolchains/MinGW-W64-Toolchain64.cmake \
a5162d8bd2d4 Added Windows builder for Python 3.12
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
29 -DCMAKE_INSTALL_PREFIX=/target
a5162d8bd2d4 Added Windows builder for Python 3.12
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
30
a5162d8bd2d4 Added Windows builder for Python 3.12
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
31 make -j`nproc`
a5162d8bd2d4 Added Windows builder for Python 3.12
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
32
a5162d8bd2d4 Added Windows builder for Python 3.12
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
33 if [ "$1" == "Release" ]; then
a5162d8bd2d4 Added Windows builder for Python 3.12
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
34 x86_64-w64-mingw32-strip ./libOrthancPython.dll
a5162d8bd2d4 Added Windows builder for Python 3.12
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
35 fi
a5162d8bd2d4 Added Windows builder for Python 3.12
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
36
a5162d8bd2d4 Added Windows builder for Python 3.12
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
37 make install