Skip to content

Commit

Permalink
Fixing MacOS build
Browse files Browse the repository at this point in the history
  • Loading branch information
drunkbatya committed Feb 6, 2024
1 parent e12110f commit 8145afd
Showing 1 changed file with 80 additions and 81 deletions.
161 changes: 80 additions & 81 deletions darwin/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,90 +1,89 @@
#FROM MacOSVenturaWithBrew AS flipperzero-toolchain-binutils
#RUN brew update-reset
#RUN brew install gettext texinfo coreutils bison flex m4 xz || true
#RUN brew link bison --force
#ADD https://developer.arm.com/-/media/Files/downloads/gnu/12.3.rel1/srcrel/arm-gnu-toolchain-src-snapshot-12.3.rel1.tar.xz /toolchain/src/src/archives/
#RUN tar -xvf /toolchain/src/src/archives/arm-gnu-toolchain-src-snapshot-12.3.rel1.tar.xz -C /toolchain/src/src/
#ADD scripts/build-mac-build-libs.sh /toolchain/src/
#RUN bash /toolchain/src/build-mac-build-libs.sh
#ADD scripts/build-mac-binutils.sh /toolchain/src/
#RUN bash /toolchain/src/build-mac-binutils.sh
FROM MacOSVenturaWithBrew AS flipperzero-toolchain-binutils
RUN brew update-reset
RUN brew install gettext texinfo coreutils bison flex m4 xz || true
RUN brew link bison --force
ADD https://developer.arm.com/-/media/Files/downloads/gnu/12.3.rel1/srcrel/arm-gnu-toolchain-src-snapshot-12.3.rel1.tar.xz /toolchain/src/src/archives/
RUN tar -xvf /toolchain/src/src/archives/arm-gnu-toolchain-src-snapshot-12.3.rel1.tar.xz -C /toolchain/src/src/
ADD scripts/build-mac-build-libs.sh /toolchain/src/
RUN bash /toolchain/src/build-mac-build-libs.sh
ADD scripts/build-mac-binutils.sh /toolchain/src/
RUN bash /toolchain/src/build-mac-binutils.sh

#FROM MacOSVenturaWithBrew
#RUN brew install coreutils
#ADD https://www.python.org/ftp/python/3.11.2/Python-3.11.2.tgz /toolchain/src/src/archives/
#RUN tar -xvf /toolchain/src/src/archives/Python-3.11.2.tgz -C /toolchain/src/src/
#RUN mv /toolchain/src/src/Python-3.11.2 /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
#ADD scripts/build-mac-python-libs.sh /toolchain/src/
#ADD scripts/build-mac-python.sh /toolchain/src/
#ADD scripts/relink.sh /usr/bin
#RUN bash /toolchain/src/build-mac-python-libs.sh
#RUN bash /toolchain/src/build-mac-python.sh
#RUN relink.sh /toolchain/mac-x86_64-output-root
#RUN relink.sh /toolchain/mac-arm64-output-root
FROM MacOSVenturaWithBrew AS flipperzero-toolchain-python
RUN brew install coreutils
ADD https://www.python.org/ftp/python/3.11.2/Python-3.11.2.tgz /toolchain/src/src/archives/
RUN tar -xvf /toolchain/src/src/archives/Python-3.11.2.tgz -C /toolchain/src/src/
RUN mv /toolchain/src/src/Python-3.11.2 /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
ADD scripts/build-mac-python-libs.sh /toolchain/src/
ADD scripts/build-mac-python.sh /toolchain/src/
ADD scripts/relink.sh /usr/bin
RUN bash /toolchain/src/build-mac-python-libs.sh
RUN bash /toolchain/src/build-mac-python.sh
RUN relink.sh /toolchain/mac-x86_64-output-root
RUN relink.sh /toolchain/mac-arm64-output-root

#FROM flipperzero-toolchain-binutils AS flipperzero-toolchain-gdb
#COPY --from=flipperzero-toolchain-python /toolchain/mac-x86_64-output-root /toolchain/mac-x86_64-output-root
#COPY --from=flipperzero-toolchain-python /toolchain/mac-arm64-output-root /toolchain/mac-arm64-output-root
#ADD scripts/build-mac-gdb.sh /toolchain/src/
#ADD scripts/build-mac-gdb-py.sh /toolchain/src/
#ADD scripts/python3-config-x86_64.sh /toolchain/src/
#ADD scripts/python3-config-arm64.sh /toolchain/src/
#ADD scripts/relink.sh /usr/bin
#RUN bash /toolchain/src/build-mac-gdb-py.sh
#RUN bash /toolchain/src/build-mac-gdb.sh
#RUN relink.sh /toolchain/mac-x86_64-output-root
#RUN relink.sh /toolchain/mac-arm64-output-root
FROM flipperzero-toolchain-binutils AS flipperzero-toolchain-gdb
COPY --from=flipperzero-toolchain-python /toolchain/mac-x86_64-output-root /toolchain/mac-x86_64-output-root
COPY --from=flipperzero-toolchain-python /toolchain/mac-arm64-output-root /toolchain/mac-arm64-output-root
ADD scripts/build-mac-gdb.sh /toolchain/src/
ADD scripts/python3-config-x86_64.sh /toolchain/src/
ADD scripts/python3-config-arm64.sh /toolchain/src/
ADD scripts/relink.sh /usr/bin
RUN bash /toolchain/src/build-mac-gdb.sh
RUN relink.sh /toolchain/mac-x86_64-output-root
RUN relink.sh /toolchain/mac-arm64-output-root

#FROM flipperzero-toolchain-binutils AS flipperzero-toolchain-gcc-first
#ADD scripts/build-mac-gcc-first.sh /toolchain/src/
#RUN bash /toolchain/src/build-mac-gcc-first.sh
FROM flipperzero-toolchain-binutils AS flipperzero-toolchain-gcc-first
ADD scripts/build-mac-gcc-first.sh /toolchain/src/
RUN bash /toolchain/src/build-mac-gcc-first.sh

#FROM flipperzero-toolchain-gcc-first AS flipperzero-toolchain-newlib
#ADD scripts/build-mac-newlib.sh /toolchain/src/
#RUN bash /toolchain/src/build-mac-newlib.sh
FROM flipperzero-toolchain-gcc-first AS flipperzero-toolchain-newlib
ADD scripts/build-mac-newlib.sh /toolchain/src/
RUN bash /toolchain/src/build-mac-newlib.sh

#FROM flipperzero-toolchain-newlib AS flipperzero-toolchain-gcc
#ADD scripts/build-mac-gcc.sh /toolchain/src/
#ADD scripts/move_newlib_to_nano.sh /toolchain/src/
#RUN bash /toolchain/src/move_newlib_to_nano.sh
FROM flipperzero-toolchain-newlib AS flipperzero-toolchain-gcc
ADD scripts/build-mac-gcc.sh /toolchain/src/
ADD scripts/move_newlib_to_nano.sh /toolchain/src/
RUN bash /toolchain/src/build-mac-gcc.sh
RUN bash /toolchain/src/move_newlib_to_nano.sh

#FROM flipperzero-toolchain-binutils AS flipperzero-toolchain-tools
#RUN brew install cmake automake autoconf
#ADD https://github.com/protocolbuffers/protobuf/releases/download/v21.7/protobuf-cpp-3.21.7.tar.gz /toolchain/src/src/archives/
#RUN tar -xvf /toolchain/src/src/archives/protobuf-cpp-3.21.7.tar.gz -C /toolchain/src/src/
#RUN mv /toolchain/src/src/protobuf-3.21.7 /toolchain/src/src/protobuf
#ADD https://github.com/llvm/llvm-project/releases/download/llvmorg-17.0.6/llvm-17.0.6.src.tar.xz /toolchain/src/src/archives/
#RUN mkdir -p /toolchain/src/src/clang-format
#RUN tar -xvf /toolchain/src/src/archives/llvm-17.0.6.src.tar.xz -C /toolchain/src/src/clang-format
#ADD https://github.com/llvm/llvm-project/releases/download/llvmorg-17.0.6/clang-17.0.6.src.tar.xz /toolchain/src/src/archives/
#RUN tar -xvf /toolchain/src/src/archives/clang-17.0.6.src.tar.xz -C /toolchain/src/src/clang-format/llvm-17.0.6.src/tools/
#RUN mv /toolchain/src/src/clang-format/llvm-17.0.6.src/tools/clang-17.0.6.src /toolchain/src/src/clang-format/llvm-17.0.6.src/tools/clang
#ADD https://github.com/llvm/llvm-project/releases/download/llvmorg-17.0.6/cmake-17.0.6.src.tar.xz /toolchain/src/src/archives/
#RUN tar -xvf /toolchain/src/src/archives/cmake-17.0.6.src.tar.xz -C /toolchain/src/src/clang-format/
#RUN mv /toolchain/src/src/clang-format/cmake-17.0.6.src /toolchain/src/src/clang-format/cmake
#ADD https://github.com/llvm/llvm-project/releases/download/llvmorg-17.0.6/third-party-17.0.6.src.tar.xz /toolchain/src/src/archives/
#RUN tar -xvf /toolchain/src/src/archives/third-party-17.0.6.src.tar.xz -C /toolchain/src/src/clang-format/
#RUN mv /toolchain/src/src/clang-format/third-party-17.0.6.src /toolchain/src/src/clang-format/third-party
#ADD scripts/build-mac-flipper-tools.sh /toolchain/src/
#RUN bash /toolchain/src/build-mac-flipper-tools.sh
#ADD https://github.com/xpack-dev-tools/openocd-xpack/releases/download/v0.12.0-2/xpack-openocd-0.12.0-2-darwin-arm64.tar.gz /toolchain/src/src/archives/
#ADD https://github.com/xpack-dev-tools/openocd-xpack/releases/download/v0.12.0-2/xpack-openocd-0.12.0-2-darwin-x64.tar.gz /toolchain/src/src/archives/
#RUN tar -xvf /toolchain/src/src/archives/xpack-openocd-0.12.0-2-darwin-arm64.tar.gz -C /toolchain/src/src/
#RUN mv /toolchain/src/src/xpack-openocd-0.12.0-2 /toolchain/src/src/xpack-openocd-0.12.0-2-arm64
#RUN tar -xvf /toolchain/src/src/archives/xpack-openocd-0.12.0-2-darwin-x64.tar.gz -C /toolchain/src/src/
#RUN mv /toolchain/src/src/xpack-openocd-0.12.0-2 /toolchain/src/src/xpack-openocd-0.12.0-2-x86_64
#RUN rm -rf /toolchain/src/src/xpack-openocd-0.12.0-2-arm64/distro-info
#RUN rm -rf /toolchain/src/src/xpack-openocd-0.12.0-2-x86_64/distro-info
#RUN rm -rf /toolchain/src/src/xpack-openocd-0.12.0-2-arm64/README.md
#RUN rm -rf /toolchain/src/src/xpack-openocd-0.12.0-2-x86_64/README.md
#RUN rsync -av /toolchain/src/src/xpack-openocd-0.12.0-2-arm64/ /toolchain/mac-arm64-output-root
#RUN rsync -av /toolchain/src/src/xpack-openocd-0.12.0-2-x86_64/ /toolchain/mac-x86_64-output-root
#ADD scripts/relink.sh /usr/bin/
#RUN relink.sh /toolchain/mac-x86_64-output-root
#RUN relink.sh /toolchain/mac-arm64-output-root
FROM flipperzero-toolchain-binutils AS flipperzero-toolchain-tools
RUN brew install cmake automake autoconf
ADD https://github.com/protocolbuffers/protobuf/releases/download/v21.7/protobuf-cpp-3.21.7.tar.gz /toolchain/src/src/archives/
RUN tar -xvf /toolchain/src/src/archives/protobuf-cpp-3.21.7.tar.gz -C /toolchain/src/src/
RUN mv /toolchain/src/src/protobuf-3.21.7 /toolchain/src/src/protobuf
ADD https://github.com/llvm/llvm-project/releases/download/llvmorg-17.0.6/llvm-17.0.6.src.tar.xz /toolchain/src/src/archives/
RUN mkdir -p /toolchain/src/src/clang-format
RUN tar -xvf /toolchain/src/src/archives/llvm-17.0.6.src.tar.xz -C /toolchain/src/src/clang-format
ADD https://github.com/llvm/llvm-project/releases/download/llvmorg-17.0.6/clang-17.0.6.src.tar.xz /toolchain/src/src/archives/
RUN tar -xvf /toolchain/src/src/archives/clang-17.0.6.src.tar.xz -C /toolchain/src/src/clang-format/llvm-17.0.6.src/tools/
RUN mv /toolchain/src/src/clang-format/llvm-17.0.6.src/tools/clang-17.0.6.src /toolchain/src/src/clang-format/llvm-17.0.6.src/tools/clang
ADD https://github.com/llvm/llvm-project/releases/download/llvmorg-17.0.6/cmake-17.0.6.src.tar.xz /toolchain/src/src/archives/
RUN tar -xvf /toolchain/src/src/archives/cmake-17.0.6.src.tar.xz -C /toolchain/src/src/clang-format/
RUN mv /toolchain/src/src/clang-format/cmake-17.0.6.src /toolchain/src/src/clang-format/cmake
ADD https://github.com/llvm/llvm-project/releases/download/llvmorg-17.0.6/third-party-17.0.6.src.tar.xz /toolchain/src/src/archives/
RUN tar -xvf /toolchain/src/src/archives/third-party-17.0.6.src.tar.xz -C /toolchain/src/src/clang-format/
RUN mv /toolchain/src/src/clang-format/third-party-17.0.6.src /toolchain/src/src/clang-format/third-party
ADD scripts/build-mac-flipper-tools.sh /toolchain/src/
RUN bash /toolchain/src/build-mac-flipper-tools.sh
ADD https://github.com/xpack-dev-tools/openocd-xpack/releases/download/v0.12.0-2/xpack-openocd-0.12.0-2-darwin-arm64.tar.gz /toolchain/src/src/archives/
ADD https://github.com/xpack-dev-tools/openocd-xpack/releases/download/v0.12.0-2/xpack-openocd-0.12.0-2-darwin-x64.tar.gz /toolchain/src/src/archives/
RUN tar -xvf /toolchain/src/src/archives/xpack-openocd-0.12.0-2-darwin-arm64.tar.gz -C /toolchain/src/src/
RUN mv /toolchain/src/src/xpack-openocd-0.12.0-2 /toolchain/src/src/xpack-openocd-0.12.0-2-arm64
RUN tar -xvf /toolchain/src/src/archives/xpack-openocd-0.12.0-2-darwin-x64.tar.gz -C /toolchain/src/src/
RUN mv /toolchain/src/src/xpack-openocd-0.12.0-2 /toolchain/src/src/xpack-openocd-0.12.0-2-x86_64
RUN rm -rf /toolchain/src/src/xpack-openocd-0.12.0-2-arm64/distro-info
RUN rm -rf /toolchain/src/src/xpack-openocd-0.12.0-2-x86_64/distro-info
RUN rm -rf /toolchain/src/src/xpack-openocd-0.12.0-2-arm64/README.md
RUN rm -rf /toolchain/src/src/xpack-openocd-0.12.0-2-x86_64/README.md
RUN rsync -av /toolchain/src/src/xpack-openocd-0.12.0-2-arm64/ /toolchain/mac-arm64-output-root
RUN rsync -av /toolchain/src/src/xpack-openocd-0.12.0-2-x86_64/ /toolchain/mac-x86_64-output-root
ADD scripts/relink.sh /usr/bin/
RUN relink.sh /toolchain/mac-x86_64-output-root
RUN relink.sh /toolchain/mac-arm64-output-root

FROM MacOSVenturaWithBrew AS flipperzero-toolchain-mac
RUN brew install coreutils bison
Expand Down

0 comments on commit 8145afd

Please sign in to comment.