Skip to content

Commit

Permalink
Fallback to Python3.11
Browse files Browse the repository at this point in the history
  • Loading branch information
drunkbatya committed Jul 3, 2024
1 parent 1de4cab commit e5ac823
Show file tree
Hide file tree
Showing 9 changed files with 18 additions and 18 deletions.
6 changes: 3 additions & 3 deletions darwin/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@ RUN bash /toolchain/src/build-mac-binutils.sh

FROM MacOSVenturaWithBrew AS flipperzero-toolchain-python
RUN brew install coreutils
ADD https://www.python.org/ftp/python/3.12.4/Python-3.12.4.tgz /toolchain/src/src/archives/
RUN tar -xvf /toolchain/src/src/archives/Python-3.12.4.tgz -C /toolchain/src/src/
RUN mv /toolchain/src/src/Python-3.12.4 /toolchain/src/src/python
ADD https://www.python.org/ftp/python/3.11.9/Python-3.11.9.tgz /toolchain/src/src/archives/
RUN tar -xvf /toolchain/src/src/archives/Python-3.11.9.tgz -C /toolchain/src/src/
RUN mv /toolchain/src/src/Python-3.11.9 /toolchain/src/src/python
ADD https://www.openssl.org/source/openssl-1.1.1w.tar.gz /toolchain/src/src/archives/
RUN tar -xvf /toolchain/src/src/archives/openssl-1.1.1w.tar.gz -C /toolchain/src/src/
RUN mv /toolchain/src/src/openssl-1.1.1w /toolchain/src/src/openssl
Expand Down
4 changes: 2 additions & 2 deletions darwin/scripts/python3-config-arm64.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ while [ $# -ge 1 ]; do
OP="$1"
case $OP in
--libs|--ldflags)
echo "$("$MAC_ARM64_OUTPUT_ROOT/bin/python3.12-config" "$OP" --embed) -L$MAC_ARM64_OUTPUT_ROOT/lib";;
echo "$("$MAC_ARM64_OUTPUT_ROOT/bin/python3.11-config" "$OP" --embed) -L$MAC_ARM64_OUTPUT_ROOT/lib";;
--*)
echo "$("$MAC_ARM64_OUTPUT_ROOT/bin/python3.12-config" "$OP")";;
echo "$("$MAC_ARM64_OUTPUT_ROOT/bin/python3.11-config" "$OP")";;
*)
;;
esac
Expand Down
4 changes: 2 additions & 2 deletions darwin/scripts/python3-config-x86_64.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ while [ $# -ge 1 ]; do
OP="$1"
case $OP in
--libs|--ldflags)
echo "$("$MAC_X86_64_OUTPUT_ROOT/bin/python3.12-config" "$OP" --embed) -L$MAC_X86_64_OUTPUT_ROOT/lib";;
echo "$("$MAC_X86_64_OUTPUT_ROOT/bin/python3.11-config" "$OP" --embed) -L$MAC_X86_64_OUTPUT_ROOT/lib";;
--*)
echo "$("$MAC_X86_64_OUTPUT_ROOT/bin/python3.12-config" "$OP")";;
echo "$("$MAC_X86_64_OUTPUT_ROOT/bin/python3.11-config" "$OP")";;
*)
;;
esac
Expand Down
6 changes: 3 additions & 3 deletions linux/Dockerfile-aarch64
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@ ADD scripts/build-linux-gcc-build-libs.sh /toolchain/src/
RUN bash /toolchain/src/build-linux-gcc-build-libs.sh

FROM flipperzero-toolchain-linux-build-deps AS flipperzero-toolchain-linux-python-build-libs
ADD https://www.python.org/ftp/python/3.12.4/Python-3.12.4.tgz /toolchain/src/src/archives/
RUN tar -xvf /toolchain/src/src/archives/Python-3.12.4.tgz -C /toolchain/src/src/
RUN mv /toolchain/src/src/Python-3.12.4 /toolchain/src/src/python
ADD https://www.python.org/ftp/python/3.11.9/Python-3.11.9.tgz /toolchain/src/src/archives/
RUN tar -xvf /toolchain/src/src/archives/Python-3.11.9.tgz -C /toolchain/src/src/
RUN mv /toolchain/src/src/Python-3.11.9 /toolchain/src/src/python
ADD https://www.openssl.org/source/openssl-1.1.1w.tar.gz /toolchain/src/src/archives/
RUN tar -xvf /toolchain/src/src/archives/openssl-1.1.1w.tar.gz -C /toolchain/src/src/
RUN mv /toolchain/src/src/openssl-1.1.1w /toolchain/src/src/openssl
Expand Down
6 changes: 3 additions & 3 deletions linux/Dockerfile-x86_64
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@ ADD scripts/build-linux-gcc-build-libs.sh /toolchain/src/
RUN bash /toolchain/src/build-linux-gcc-build-libs.sh

FROM flipperzero-toolchain-linux-build-deps AS flipperzero-toolchain-linux-python-build-libs
ADD https://www.python.org/ftp/python/3.12.4/Python-3.12.4.tgz /toolchain/src/src/archives/
RUN tar -xvf /toolchain/src/src/archives/Python-3.12.4.tgz -C /toolchain/src/src/
RUN mv /toolchain/src/src/Python-3.12.4 /toolchain/src/src/python
ADD https://www.python.org/ftp/python/3.11.9/Python-3.11.9.tgz /toolchain/src/src/archives/
RUN tar -xvf /toolchain/src/src/archives/Python-3.11.9.tgz -C /toolchain/src/src/
RUN mv /toolchain/src/src/Python-3.11.9 /toolchain/src/src/python
ADD https://www.openssl.org/source/openssl-1.1.1w.tar.gz /toolchain/src/src/archives/
RUN tar -xvf /toolchain/src/src/archives/openssl-1.1.1w.tar.gz -C /toolchain/src/src/
RUN mv /toolchain/src/src/openssl-1.1.1w /toolchain/src/src/openssl
Expand Down
6 changes: 3 additions & 3 deletions windows/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ RUN bash /toolchain/src/build-windows-gcc.sh

FROM flipperzero-toolchain-windows-build-deps AS flipperzero-toolchain-windows-python
RUN DEBIAN_FRONTEND=noninteractive dpkg --add-architecture i386 && apt update && apt -y install xvfb wine wine32 wine64 unzip
ADD https://www.python.org/ftp/python/3.12.4/python-3.12.4-amd64.exe /toolchain/src/src/archives
ADD https://www.python.org/ftp/python/3.11.9/python-3.11.9-amd64.exe /toolchain/src/src/archives
ADD scripts/unpack-windows-python-wine.sh /toolchain/src/
RUN bash /toolchain/src/unpack-windows-python-wine.sh

Expand Down Expand Up @@ -95,5 +95,5 @@ ADD scripts/bundle_upload.sh /usr/bin/
RUN strip.sh
COPY --from=flipperzero-toolchain-windows-src /usr/x86_64-w64-mingw32/lib /tmp/lib/
RUN cp /tmp/lib/*.dll /toolchain/windows-output-root/bin/
RUN cp /toolchain/windows-output-root/python/python312.dll /toolchain/windows-output-root/bin/
ADD patch/python312._pth /toolchain/windows-output-root/bin/
RUN cp /toolchain/windows-output-root/python/python311.dll /toolchain/windows-output-root/bin/
ADD patch/python311._pth /toolchain/windows-output-root/bin/
File renamed without changes.
2 changes: 1 addition & 1 deletion windows/scripts/python3-config-windows-x86_64.sh
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ while [ $# -ge 1 ]; do
fi
echo "$CF";;
--libs|--ldflags)
echo "-L$PYTHON_PATH/libs -lpython312";;
echo "-L$PYTHON_PATH/libs -lpython311";;
--*)
echo "Unknown option: $OP" >&2
exit 1;;
Expand Down
2 changes: 1 addition & 1 deletion windows/scripts/unpack-windows-python-wine.sh
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ function setup_wine() {
}
function unpack_python() {
pushd /toolchain/src/src/archives;
DISPLAY=:0.0 WINEARCH=win64 wine cmd /c python-3.12.4-amd64.exe /quiet PrependPath=1 InstallAllUsers=1 TargetDir=C:\\Python
DISPLAY=:0.0 WINEARCH=win64 wine cmd /c python-3.11.9-amd64.exe /quiet PrependPath=1 InstallAllUsers=1 TargetDir=C:\\Python
popd;
}
function move_python_files() {
Expand Down

0 comments on commit e5ac823

Please sign in to comment.