diff --git a/platforms/switch/clang-9.0.0/darwin/Dockerfile b/platforms/switch/clang-9.0.0/darwin/Dockerfile new file mode 100644 index 0000000..31fda56 --- /dev/null +++ b/platforms/switch/clang-9.0.0/darwin/Dockerfile @@ -0,0 +1,49 @@ +# NOTE: This file is generated automatically via template.py. Do not edit manually! + + +FROM alpine:3.18 AS base + +RUN mkdir -p /compilers/switch/clang-9.0.0 + +RUN wget -O clang+llvm-9.0.0-x86_64-darwin-apple.tar.xz "https://releases.llvm.org/9.0.0/clang+llvm-9.0.0-x86_64-darwin-apple.tar.xz" +RUN tar xvJf clang+llvm-9.0.0-x86_64-darwin-apple.tar.xz --strip-components=1 -C /compilers/switch/clang-9.0.0 + +# we only need the clang-x.y.z binary +RUN mv /compilers/switch/clang-9.0.0/bin /compilers/switch/clang-9.0.0/_bin +RUN mkdir /compilers/switch/clang-9.0.0/bin +RUN mv /compilers/switch/clang-9.0.0/_bin/clang-9 /compilers/switch/clang-9.0.0/bin +RUN mv /compilers/switch/clang-9.0.0/_bin/clang++ /compilers/switch/clang-9.0.0/bin +RUN mv /compilers/switch/clang-9.0.0/_bin/clang /compilers/switch/clang-9.0.0/bin +RUN rm -rf /compilers/switch/clang-9.0.0/_bin/ + +RUN rm -rf /compilers/switch/clang-9.0.0/libexec +RUN rm -rf /compilers/switch/clang-9.0.0/share + +ARG MUSL_HASH=25ed8669943bee65a650700d340e451eda2a26ba + +RUN wget -O musl.zip https://github.com/open-ead/botw-lib-musl/archive/${MUSL_HASH}.zip +RUN unzip musl.zip +RUN cp -r botw-lib-musl-${MUSL_HASH} /compilers/switch/clang-9.0.0/ + +RUN apk add patch + +ARG PATCH_REPO=https://github.com/GRAnimated/switch-clang-patches +ARG PATCH_BRANCH=main + +RUN wget -O patches.zip "${PATCH_REPO}/archive/refs/heads/${PATCH_BRANCH}.zip" +RUN unzip patches.zip -d /tmp +RUN mv /tmp/switch-clang-patches-${PATCH_BRANCH} /tmp/patches + +# apply patches to clang +RUN patch_dir="/tmp/patches/clang-9.0.0" && \ + find "$patch_dir" -type f -name '*.diff' -print0 | while IFS= read -r -d '' patch; do \ + echo "Applying patch: $patch"; \ + patch -d "/compilers/switch/clang-9.0.0" -p0 < "$patch"; \ + done; + +RUN chown -R root:root /compilers/switch/clang-9.0.0/ + + +FROM scratch AS release + +COPY --from=base /compilers /compilers diff --git a/platforms/switch/clang-9.0.0/linux/Dockerfile b/platforms/switch/clang-9.0.0/linux/Dockerfile new file mode 100644 index 0000000..4d25173 --- /dev/null +++ b/platforms/switch/clang-9.0.0/linux/Dockerfile @@ -0,0 +1,49 @@ +# NOTE: This file is generated automatically via template.py. Do not edit manually! + + +FROM alpine:3.18 AS base + +RUN mkdir -p /compilers/switch/clang-9.0.0 + +RUN wget -O clang+llvm-9.0.0-x86_64-linux-gnu-ubuntu-18.04.tar.xz "https://releases.llvm.org/9.0.0/clang+llvm-9.0.0-x86_64-linux-gnu-ubuntu-18.04.tar.xz" +RUN tar xvJf clang+llvm-9.0.0-x86_64-linux-gnu-ubuntu-18.04.tar.xz --strip-components=1 -C /compilers/switch/clang-9.0.0 + +# we only need the clang-x.y.z binary +RUN mv /compilers/switch/clang-9.0.0/bin /compilers/switch/clang-9.0.0/_bin +RUN mkdir /compilers/switch/clang-9.0.0/bin +RUN mv /compilers/switch/clang-9.0.0/_bin/clang-9 /compilers/switch/clang-9.0.0/bin +RUN mv /compilers/switch/clang-9.0.0/_bin/clang++ /compilers/switch/clang-9.0.0/bin +RUN mv /compilers/switch/clang-9.0.0/_bin/clang /compilers/switch/clang-9.0.0/bin +RUN rm -rf /compilers/switch/clang-9.0.0/_bin/ + +RUN rm -rf /compilers/switch/clang-9.0.0/libexec +RUN rm -rf /compilers/switch/clang-9.0.0/share + +ARG MUSL_HASH=25ed8669943bee65a650700d340e451eda2a26ba + +RUN wget -O musl.zip https://github.com/open-ead/botw-lib-musl/archive/${MUSL_HASH}.zip +RUN unzip musl.zip +RUN cp -r botw-lib-musl-${MUSL_HASH} /compilers/switch/clang-9.0.0/ + +RUN apk add patch + +ARG PATCH_REPO=https://github.com/GRAnimated/switch-clang-patches +ARG PATCH_BRANCH=main + +RUN wget -O patches.zip "${PATCH_REPO}/archive/refs/heads/${PATCH_BRANCH}.zip" +RUN unzip patches.zip -d /tmp +RUN mv /tmp/switch-clang-patches-${PATCH_BRANCH} /tmp/patches + +# apply patches to clang +RUN patch_dir="/tmp/patches/clang-9.0.0" && \ + find "$patch_dir" -type f -name '*.diff' -print0 | while IFS= read -r -d '' patch; do \ + echo "Applying patch: $patch"; \ + patch -d "/compilers/switch/clang-9.0.0" -p0 < "$patch"; \ + done; + +RUN chown -R root:root /compilers/switch/clang-9.0.0/ + + +FROM scratch AS release + +COPY --from=base /compilers /compilers diff --git a/values.yaml b/values.yaml index 4f25151..2cb511e 100644 --- a/values.yaml +++ b/values.yaml @@ -618,7 +618,18 @@ compilers: template: switch/clang file: https://releases.llvm.org/8.0.0/clang+llvm-8.0.0-x86_64-apple-darwin.tar.xz clang_binary: clang-8 - + - id: clang-9.0.0 + arch: linux + platform: switch + template: switch/clang + file: https://releases.llvm.org/9.0.0/clang+llvm-9.0.0-x86_64-linux-gnu-ubuntu-18.04.tar.xz + clang_binary: clang-9 + - id: clang-9.0.0 + arch: darwin + platform: switch + template: switch/clang + file: https://releases.llvm.org/9.0.0/clang+llvm-9.0.0-x86_64-darwin-apple.tar.xz + clang_binary: clang-9 # NDS - id: mwcc_20_56 platform: nds_arm9