# HG changeset patch # User Sebastien Jodogne # Date 1680017226 -7200 # Node ID 6ad5da29f26064723628b2747e860b82442d3ce8 # Parent 80f3a034d47f12e5d6ecff8967cf0e5e6c3d04bd added Windows builders for Python 3.9, 3.10 and 3.11 diff -r 80f3a034d47f -r 6ad5da29f260 Resources/Builders/BuildAllWindows.sh --- a/Resources/Builders/BuildAllWindows.sh Wed Feb 23 18:42:08 2022 +0100 +++ b/Resources/Builders/BuildAllWindows.sh Tue Mar 28 17:27:06 2023 +0200 @@ -18,8 +18,10 @@ VERSION=`grep "set(PLUGIN_VERSION" ${DIR}/../../CMakeLists.txt | cut -d '"' -f 2` echo "Version of the Python plugin: ${VERSION}" +set -x -set -x + +## Windows 32 bash ${DIR}/MinGW32-Python2.7/docker-compile.sh Release cp ${DIR}/../../docker-build/lib/libOrthancPython.dll ${TARGET}/OrthancPython-Win32-Python2.7-${VERSION}.dll @@ -30,6 +32,18 @@ bash ${DIR}/MinGW32-Python3.8/docker-compile.sh Release cp ${DIR}/../../docker-build/lib/libOrthancPython.dll ${TARGET}/OrthancPython-Win32-Python3.8-${VERSION}.dll +bash ${DIR}/MinGW32-Python3.9/docker-compile.sh Release +cp ${DIR}/../../docker-build/lib/libOrthancPython.dll ${TARGET}/OrthancPython-Win32-Python3.9-${VERSION}.dll + +bash ${DIR}/MinGW32-Python3.10/docker-compile.sh Release +cp ${DIR}/../../docker-build/lib/libOrthancPython.dll ${TARGET}/OrthancPython-Win32-Python3.10-${VERSION}.dll + +bash ${DIR}/MinGW32-Python3.11/docker-compile.sh Release +cp ${DIR}/../../docker-build/lib/libOrthancPython.dll ${TARGET}/OrthancPython-Win32-Python3.11-${VERSION}.dll + + +## Windows 64 + bash ${DIR}/MinGW64-Python2.7/docker-compile.sh Release cp ${DIR}/../../docker-build/lib/libOrthancPython.dll ${TARGET}/OrthancPython-Win64-Python2.7-${VERSION}.dll @@ -38,3 +52,12 @@ bash ${DIR}/MinGW64-Python3.8/docker-compile.sh Release cp ${DIR}/../../docker-build/lib/libOrthancPython.dll ${TARGET}/OrthancPython-Win64-Python3.8-${VERSION}.dll + +bash ${DIR}/MinGW64-Python3.9/docker-compile.sh Release +cp ${DIR}/../../docker-build/lib/libOrthancPython.dll ${TARGET}/OrthancPython-Win64-Python3.9-${VERSION}.dll + +bash ${DIR}/MinGW64-Python3.10/docker-compile.sh Release +cp ${DIR}/../../docker-build/lib/libOrthancPython.dll ${TARGET}/OrthancPython-Win64-Python3.10-${VERSION}.dll + +bash ${DIR}/MinGW64-Python3.11/docker-compile.sh Release +cp ${DIR}/../../docker-build/lib/libOrthancPython.dll ${TARGET}/OrthancPython-Win64-Python3.11-${VERSION}.dll diff -r 80f3a034d47f -r 6ad5da29f260 Resources/Builders/MinGW32-Python2.7/docker-internal.sh --- a/Resources/Builders/MinGW32-Python2.7/docker-internal.sh Wed Feb 23 18:42:08 2022 +0100 +++ b/Resources/Builders/MinGW32-Python2.7/docker-internal.sh Tue Mar 28 17:27:06 2023 +0200 @@ -10,7 +10,7 @@ mkdir /tmp/build cd /tmp/build -wget https://orthanc.osimis.io/ThirdPartyDownloads/Python/python-2.7.17-win32.tar.bz2 +wget https://orthanc.uclouvain.be/third-party-downloads/Python/python-2.7.17-win32.tar.bz2 tar xfj python-2.7.17-win32.tar.bz2 cmake /tmp/source-writeable/ \ diff -r 80f3a034d47f -r 6ad5da29f260 Resources/Builders/MinGW32-Python3.10/docker-compile.sh --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/Resources/Builders/MinGW32-Python3.10/docker-compile.sh Tue Mar 28 17:27:06 2023 +0200 @@ -0,0 +1,31 @@ +#!/bin/bash + +set -ex + +if [ "$1" != "Debug" -a "$1" != "Release" ]; then + echo "Please provide build type: Debug or Release" + exit -1 +fi + +if [ -t 1 ]; then + # TTY is available => use interactive mode + DOCKER_FLAGS='-i' +fi + +ROOT_DIR=`dirname $(readlink -f $0)`/../../.. + +mkdir -p ${ROOT_DIR}/docker-build/ + +( cd ${ROOT_DIR}/Resources/Builders/ && \ + docker build \ + -f ./Dockerfile-MinGW-BuildEnvironment \ + -t mingw-python-build . ) + +docker run -t ${DOCKER_FLAGS} --rm \ + --user $(id -u):$(id -g) \ + -v ${ROOT_DIR}:/source:ro \ + -v ${ROOT_DIR}/docker-build:/target:rw \ + mingw-python-build \ + bash /source/Resources/Builders/MinGW32-Python3.10/docker-internal.sh $1 + +ls -lR ${ROOT_DIR}/docker-build/ diff -r 80f3a034d47f -r 6ad5da29f260 Resources/Builders/MinGW32-Python3.10/docker-internal.sh --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/Resources/Builders/MinGW32-Python3.10/docker-internal.sh Tue Mar 28 17:27:06 2023 +0200 @@ -0,0 +1,37 @@ +#!/bin/bash +set -ex + +mkdir /tmp/source-writeable + +cp -r /source/CMakeLists.txt /tmp/source-writeable/ +cp -r /source/Sources /tmp/source-writeable/ +cp -r /source/Resources /tmp/source-writeable/ + +mkdir /tmp/build +cd /tmp/build + +wget https://orthanc.uclouvain.be/third-party-downloads/Python/python-3.10.10-win32.zip +unzip python-3.10.10-win32.zip + +if [ "$1" == "Release" ]; then + LIBRARY_NAME=python310.lib +else + LIBRARY_NAME=python310_d.lib +fi + +cmake /tmp/source-writeable/ \ + -DCMAKE_BUILD_TYPE=$1 \ + -DSTATIC_BUILD=ON \ + -DPYTHON_VERSION=3.10 \ + -DPYTHON_LIBRARY_NAME=${LIBRARY_NAME} \ + -DPYTHON_WINDOWS_ROOT=/tmp/build/python-3.10.10-win32/ \ + -DCMAKE_TOOLCHAIN_FILE=/source/Resources/Orthanc/Toolchains/MinGW-W64-Toolchain32.cmake \ + -DCMAKE_INSTALL_PREFIX=/target + +make -j`nproc` + +if [ "$1" == "Release" ]; then + i686-w64-mingw32-strip ./libOrthancPython.dll +fi + +make install diff -r 80f3a034d47f -r 6ad5da29f260 Resources/Builders/MinGW32-Python3.11/docker-compile.sh --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/Resources/Builders/MinGW32-Python3.11/docker-compile.sh Tue Mar 28 17:27:06 2023 +0200 @@ -0,0 +1,31 @@ +#!/bin/bash + +set -ex + +if [ "$1" != "Debug" -a "$1" != "Release" ]; then + echo "Please provide build type: Debug or Release" + exit -1 +fi + +if [ -t 1 ]; then + # TTY is available => use interactive mode + DOCKER_FLAGS='-i' +fi + +ROOT_DIR=`dirname $(readlink -f $0)`/../../.. + +mkdir -p ${ROOT_DIR}/docker-build/ + +( cd ${ROOT_DIR}/Resources/Builders/ && \ + docker build \ + -f ./Dockerfile-MinGW-BuildEnvironment \ + -t mingw-python-build . ) + +docker run -t ${DOCKER_FLAGS} --rm \ + --user $(id -u):$(id -g) \ + -v ${ROOT_DIR}:/source:ro \ + -v ${ROOT_DIR}/docker-build:/target:rw \ + mingw-python-build \ + bash /source/Resources/Builders/MinGW32-Python3.11/docker-internal.sh $1 + +ls -lR ${ROOT_DIR}/docker-build/ diff -r 80f3a034d47f -r 6ad5da29f260 Resources/Builders/MinGW32-Python3.11/docker-internal.sh --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/Resources/Builders/MinGW32-Python3.11/docker-internal.sh Tue Mar 28 17:27:06 2023 +0200 @@ -0,0 +1,37 @@ +#!/bin/bash +set -ex + +mkdir /tmp/source-writeable + +cp -r /source/CMakeLists.txt /tmp/source-writeable/ +cp -r /source/Sources /tmp/source-writeable/ +cp -r /source/Resources /tmp/source-writeable/ + +mkdir /tmp/build +cd /tmp/build + +wget https://orthanc.uclouvain.be/third-party-downloads/Python/python-3.11.2-win32.zip +unzip python-3.11.2-win32.zip + +if [ "$1" == "Release" ]; then + LIBRARY_NAME=python311.lib +else + LIBRARY_NAME=python311_d.lib +fi + +cmake /tmp/source-writeable/ \ + -DCMAKE_BUILD_TYPE=$1 \ + -DSTATIC_BUILD=ON \ + -DPYTHON_VERSION=3.11 \ + -DPYTHON_LIBRARY_NAME=${LIBRARY_NAME} \ + -DPYTHON_WINDOWS_ROOT=/tmp/build/python-3.11.2-win32/ \ + -DCMAKE_TOOLCHAIN_FILE=/source/Resources/Orthanc/Toolchains/MinGW-W64-Toolchain32.cmake \ + -DCMAKE_INSTALL_PREFIX=/target + +make -j`nproc` + +if [ "$1" == "Release" ]; then + i686-w64-mingw32-strip ./libOrthancPython.dll +fi + +make install diff -r 80f3a034d47f -r 6ad5da29f260 Resources/Builders/MinGW32-Python3.7/docker-internal.sh --- a/Resources/Builders/MinGW32-Python3.7/docker-internal.sh Wed Feb 23 18:42:08 2022 +0100 +++ b/Resources/Builders/MinGW32-Python3.7/docker-internal.sh Tue Mar 28 17:27:06 2023 +0200 @@ -10,7 +10,7 @@ mkdir /tmp/build cd /tmp/build -wget https://orthanc.osimis.io/ThirdPartyDownloads/Python/python-3.7.7-win32.zip +wget https://orthanc.uclouvain.be/third-party-downloads/Python/python-3.7.7-win32.zip unzip python-3.7.7-win32.zip cmake /tmp/source-writeable/ \ diff -r 80f3a034d47f -r 6ad5da29f260 Resources/Builders/MinGW32-Python3.8/docker-internal.sh --- a/Resources/Builders/MinGW32-Python3.8/docker-internal.sh Wed Feb 23 18:42:08 2022 +0100 +++ b/Resources/Builders/MinGW32-Python3.8/docker-internal.sh Tue Mar 28 17:27:06 2023 +0200 @@ -10,7 +10,7 @@ mkdir /tmp/build cd /tmp/build -wget https://orthanc.osimis.io/ThirdPartyDownloads/Python/python-3.8.3-win32.zip +wget https://orthanc.uclouvain.be/third-party-downloads/Python/python-3.8.3-win32.zip unzip python-3.8.3-win32.zip if [ "$1" == "Release" ]; then diff -r 80f3a034d47f -r 6ad5da29f260 Resources/Builders/MinGW32-Python3.9/docker-compile.sh --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/Resources/Builders/MinGW32-Python3.9/docker-compile.sh Tue Mar 28 17:27:06 2023 +0200 @@ -0,0 +1,31 @@ +#!/bin/bash + +set -ex + +if [ "$1" != "Debug" -a "$1" != "Release" ]; then + echo "Please provide build type: Debug or Release" + exit -1 +fi + +if [ -t 1 ]; then + # TTY is available => use interactive mode + DOCKER_FLAGS='-i' +fi + +ROOT_DIR=`dirname $(readlink -f $0)`/../../.. + +mkdir -p ${ROOT_DIR}/docker-build/ + +( cd ${ROOT_DIR}/Resources/Builders/ && \ + docker build \ + -f ./Dockerfile-MinGW-BuildEnvironment \ + -t mingw-python-build . ) + +docker run -t ${DOCKER_FLAGS} --rm \ + --user $(id -u):$(id -g) \ + -v ${ROOT_DIR}:/source:ro \ + -v ${ROOT_DIR}/docker-build:/target:rw \ + mingw-python-build \ + bash /source/Resources/Builders/MinGW32-Python3.9/docker-internal.sh $1 + +ls -lR ${ROOT_DIR}/docker-build/ diff -r 80f3a034d47f -r 6ad5da29f260 Resources/Builders/MinGW32-Python3.9/docker-internal.sh --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/Resources/Builders/MinGW32-Python3.9/docker-internal.sh Tue Mar 28 17:27:06 2023 +0200 @@ -0,0 +1,37 @@ +#!/bin/bash +set -ex + +mkdir /tmp/source-writeable + +cp -r /source/CMakeLists.txt /tmp/source-writeable/ +cp -r /source/Sources /tmp/source-writeable/ +cp -r /source/Resources /tmp/source-writeable/ + +mkdir /tmp/build +cd /tmp/build + +wget https://orthanc.uclouvain.be/third-party-downloads/Python/python-3.9.13-win32.zip +unzip python-3.9.13-win32.zip + +if [ "$1" == "Release" ]; then + LIBRARY_NAME=python39.lib +else + LIBRARY_NAME=python39_d.lib +fi + +cmake /tmp/source-writeable/ \ + -DCMAKE_BUILD_TYPE=$1 \ + -DSTATIC_BUILD=ON \ + -DPYTHON_VERSION=3.9 \ + -DPYTHON_LIBRARY_NAME=${LIBRARY_NAME} \ + -DPYTHON_WINDOWS_ROOT=/tmp/build/python-3.9.13-win32/ \ + -DCMAKE_TOOLCHAIN_FILE=/source/Resources/Orthanc/Toolchains/MinGW-W64-Toolchain32.cmake \ + -DCMAKE_INSTALL_PREFIX=/target + +make -j`nproc` + +if [ "$1" == "Release" ]; then + i686-w64-mingw32-strip ./libOrthancPython.dll +fi + +make install diff -r 80f3a034d47f -r 6ad5da29f260 Resources/Builders/MinGW64-Python2.7/docker-internal.sh --- a/Resources/Builders/MinGW64-Python2.7/docker-internal.sh Wed Feb 23 18:42:08 2022 +0100 +++ b/Resources/Builders/MinGW64-Python2.7/docker-internal.sh Tue Mar 28 17:27:06 2023 +0200 @@ -10,7 +10,7 @@ mkdir /tmp/build cd /tmp/build -wget https://orthanc.osimis.io/ThirdPartyDownloads/Python/python-2.7.17-win64.zip +wget https://orthanc.uclouvain.be/third-party-downloads/Python/python-2.7.17-win64.zip unzip python-2.7.17-win64.zip cmake /tmp/source-writeable/ \ diff -r 80f3a034d47f -r 6ad5da29f260 Resources/Builders/MinGW64-Python3.10/docker-compile.sh --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/Resources/Builders/MinGW64-Python3.10/docker-compile.sh Tue Mar 28 17:27:06 2023 +0200 @@ -0,0 +1,31 @@ +#!/bin/bash + +set -ex + +if [ "$1" != "Debug" -a "$1" != "Release" ]; then + echo "Please provide build type: Debug or Release" + exit -1 +fi + +if [ -t 1 ]; then + # TTY is available => use interactive mode + DOCKER_FLAGS='-i' +fi + +ROOT_DIR=`dirname $(readlink -f $0)`/../../.. + +mkdir -p ${ROOT_DIR}/docker-build/ + +( cd ${ROOT_DIR}/Resources/Builders/ && \ + docker build \ + -f ./Dockerfile-MinGW-BuildEnvironment \ + -t mingw-python-build . ) + +docker run -t ${DOCKER_FLAGS} --rm \ + --user $(id -u):$(id -g) \ + -v ${ROOT_DIR}:/source:ro \ + -v ${ROOT_DIR}/docker-build:/target:rw \ + mingw-python-build \ + bash /source/Resources/Builders/MinGW64-Python3.10/docker-internal.sh $1 + +ls -lR ${ROOT_DIR}/docker-build/ diff -r 80f3a034d47f -r 6ad5da29f260 Resources/Builders/MinGW64-Python3.10/docker-internal.sh --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/Resources/Builders/MinGW64-Python3.10/docker-internal.sh Tue Mar 28 17:27:06 2023 +0200 @@ -0,0 +1,37 @@ +#!/bin/bash +set -ex + +mkdir /tmp/source-writeable + +cp -r /source/CMakeLists.txt /tmp/source-writeable/ +cp -r /source/Sources /tmp/source-writeable/ +cp -r /source/Resources /tmp/source-writeable/ + +mkdir /tmp/build +cd /tmp/build + +wget https://orthanc.uclouvain.be/third-party-downloads/Python/python-3.10.10-win64.zip +unzip python-3.10.10-win64.zip + +if [ "$1" == "Release" ]; then + LIBRARY_NAME=python310.lib +else + LIBRARY_NAME=python310_d.lib +fi + +cmake /tmp/source-writeable/ \ + -DCMAKE_BUILD_TYPE=$1 \ + -DSTATIC_BUILD=ON \ + -DPYTHON_VERSION=3.10 \ + -DPYTHON_LIBRARY_NAME=${LIBRARY_NAME} \ + -DPYTHON_WINDOWS_ROOT=/tmp/build/python-3.10.10-win64 \ + -DCMAKE_TOOLCHAIN_FILE=/source/Resources/Orthanc/Toolchains/MinGW-W64-Toolchain64.cmake \ + -DCMAKE_INSTALL_PREFIX=/target + +make -j`nproc` + +if [ "$1" == "Release" ]; then + x86_64-w64-mingw32-strip ./libOrthancPython.dll +fi + +make install diff -r 80f3a034d47f -r 6ad5da29f260 Resources/Builders/MinGW64-Python3.11/docker-compile.sh --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/Resources/Builders/MinGW64-Python3.11/docker-compile.sh Tue Mar 28 17:27:06 2023 +0200 @@ -0,0 +1,31 @@ +#!/bin/bash + +set -ex + +if [ "$1" != "Debug" -a "$1" != "Release" ]; then + echo "Please provide build type: Debug or Release" + exit -1 +fi + +if [ -t 1 ]; then + # TTY is available => use interactive mode + DOCKER_FLAGS='-i' +fi + +ROOT_DIR=`dirname $(readlink -f $0)`/../../.. + +mkdir -p ${ROOT_DIR}/docker-build/ + +( cd ${ROOT_DIR}/Resources/Builders/ && \ + docker build \ + -f ./Dockerfile-MinGW-BuildEnvironment \ + -t mingw-python-build . ) + +docker run -t ${DOCKER_FLAGS} --rm \ + --user $(id -u):$(id -g) \ + -v ${ROOT_DIR}:/source:ro \ + -v ${ROOT_DIR}/docker-build:/target:rw \ + mingw-python-build \ + bash /source/Resources/Builders/MinGW64-Python3.11/docker-internal.sh $1 + +ls -lR ${ROOT_DIR}/docker-build/ diff -r 80f3a034d47f -r 6ad5da29f260 Resources/Builders/MinGW64-Python3.11/docker-internal.sh --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/Resources/Builders/MinGW64-Python3.11/docker-internal.sh Tue Mar 28 17:27:06 2023 +0200 @@ -0,0 +1,37 @@ +#!/bin/bash +set -ex + +mkdir /tmp/source-writeable + +cp -r /source/CMakeLists.txt /tmp/source-writeable/ +cp -r /source/Sources /tmp/source-writeable/ +cp -r /source/Resources /tmp/source-writeable/ + +mkdir /tmp/build +cd /tmp/build + +wget https://orthanc.uclouvain.be/third-party-downloads/Python/python-3.11.2-win64.zip +unzip python-3.11.2-win64.zip + +if [ "$1" == "Release" ]; then + LIBRARY_NAME=python311.lib +else + LIBRARY_NAME=python311_d.lib +fi + +cmake /tmp/source-writeable/ \ + -DCMAKE_BUILD_TYPE=$1 \ + -DSTATIC_BUILD=ON \ + -DPYTHON_VERSION=3.11 \ + -DPYTHON_LIBRARY_NAME=${LIBRARY_NAME} \ + -DPYTHON_WINDOWS_ROOT=/tmp/build/python-3.11.2-win64 \ + -DCMAKE_TOOLCHAIN_FILE=/source/Resources/Orthanc/Toolchains/MinGW-W64-Toolchain64.cmake \ + -DCMAKE_INSTALL_PREFIX=/target + +make -j`nproc` + +if [ "$1" == "Release" ]; then + x86_64-w64-mingw32-strip ./libOrthancPython.dll +fi + +make install diff -r 80f3a034d47f -r 6ad5da29f260 Resources/Builders/MinGW64-Python3.7/docker-internal.sh --- a/Resources/Builders/MinGW64-Python3.7/docker-internal.sh Wed Feb 23 18:42:08 2022 +0100 +++ b/Resources/Builders/MinGW64-Python3.7/docker-internal.sh Tue Mar 28 17:27:06 2023 +0200 @@ -10,7 +10,7 @@ mkdir /tmp/build cd /tmp/build -wget https://orthanc.osimis.io/ThirdPartyDownloads/Python/python-3.7.7-win64.zip +wget https://orthanc.uclouvain.be/third-party-downloads/Python/python-3.7.7-win64.zip unzip python-3.7.7-win64.zip cmake /tmp/source-writeable/ \ diff -r 80f3a034d47f -r 6ad5da29f260 Resources/Builders/MinGW64-Python3.8/docker-internal.sh --- a/Resources/Builders/MinGW64-Python3.8/docker-internal.sh Wed Feb 23 18:42:08 2022 +0100 +++ b/Resources/Builders/MinGW64-Python3.8/docker-internal.sh Tue Mar 28 17:27:06 2023 +0200 @@ -10,7 +10,7 @@ mkdir /tmp/build cd /tmp/build -wget https://orthanc.osimis.io/ThirdPartyDownloads/Python/python-3.8.3-win64.zip +wget https://orthanc.uclouvain.be/third-party-downloads/Python/python-3.8.3-win64.zip unzip python-3.8.3-win64.zip if [ "$1" == "Release" ]; then diff -r 80f3a034d47f -r 6ad5da29f260 Resources/Builders/MinGW64-Python3.9/docker-compile.sh --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/Resources/Builders/MinGW64-Python3.9/docker-compile.sh Tue Mar 28 17:27:06 2023 +0200 @@ -0,0 +1,31 @@ +#!/bin/bash + +set -ex + +if [ "$1" != "Debug" -a "$1" != "Release" ]; then + echo "Please provide build type: Debug or Release" + exit -1 +fi + +if [ -t 1 ]; then + # TTY is available => use interactive mode + DOCKER_FLAGS='-i' +fi + +ROOT_DIR=`dirname $(readlink -f $0)`/../../.. + +mkdir -p ${ROOT_DIR}/docker-build/ + +( cd ${ROOT_DIR}/Resources/Builders/ && \ + docker build \ + -f ./Dockerfile-MinGW-BuildEnvironment \ + -t mingw-python-build . ) + +docker run -t ${DOCKER_FLAGS} --rm \ + --user $(id -u):$(id -g) \ + -v ${ROOT_DIR}:/source:ro \ + -v ${ROOT_DIR}/docker-build:/target:rw \ + mingw-python-build \ + bash /source/Resources/Builders/MinGW64-Python3.9/docker-internal.sh $1 + +ls -lR ${ROOT_DIR}/docker-build/ diff -r 80f3a034d47f -r 6ad5da29f260 Resources/Builders/MinGW64-Python3.9/docker-internal.sh --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/Resources/Builders/MinGW64-Python3.9/docker-internal.sh Tue Mar 28 17:27:06 2023 +0200 @@ -0,0 +1,37 @@ +#!/bin/bash +set -ex + +mkdir /tmp/source-writeable + +cp -r /source/CMakeLists.txt /tmp/source-writeable/ +cp -r /source/Sources /tmp/source-writeable/ +cp -r /source/Resources /tmp/source-writeable/ + +mkdir /tmp/build +cd /tmp/build + +wget https://orthanc.uclouvain.be/third-party-downloads/Python/python-3.9.13-win64.zip +unzip python-3.9.13-win64.zip + +if [ "$1" == "Release" ]; then + LIBRARY_NAME=python39.lib +else + LIBRARY_NAME=python39_d.lib +fi + +cmake /tmp/source-writeable/ \ + -DCMAKE_BUILD_TYPE=$1 \ + -DSTATIC_BUILD=ON \ + -DPYTHON_VERSION=3.9 \ + -DPYTHON_LIBRARY_NAME=${LIBRARY_NAME} \ + -DPYTHON_WINDOWS_ROOT=/tmp/build/python-3.9.13-win64 \ + -DCMAKE_TOOLCHAIN_FILE=/source/Resources/Orthanc/Toolchains/MinGW-W64-Toolchain64.cmake \ + -DCMAKE_INSTALL_PREFIX=/target + +make -j`nproc` + +if [ "$1" == "Release" ]; then + x86_64-w64-mingw32-strip ./libOrthancPython.dll +fi + +make install