forked from jcmvbkbc/crosstool-NG
-
Notifications
You must be signed in to change notification settings - Fork 63
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
10 changed files
with
428 additions
and
73 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
# syntax = edrevo/dockerfile-plus | ||
ARG FROM_IMAGE="debian:stretch" | ||
|
||
INCLUDE+ ./common/Dockerfile.base | ||
|
||
# | ||
# For basic dependencies see | ||
# http://crosstool-ng.github.io/docs/os-setup/ | ||
# https://github.com/crosstool-ng/crosstool-ng/blob/master/.travis.yml | ||
# | ||
# Crossbuild environment is made based on | ||
# https://github.com/multiarch/crossbuild | ||
# | ||
|
||
RUN apt-get -o Acquire::Check-Valid-Until=false update \ | ||
&& apt-get install --allow-unauthenticated -y -q --no-install-recommends \ | ||
binutils-multiarch \ | ||
binutils-multiarch-dev \ | ||
build-essential \ | ||
crossbuild-essential-arm64 \ | ||
crossbuild-essential-armel \ | ||
crossbuild-essential-armhf \ | ||
multistrap \ | ||
libc6-dev \ | ||
linux-libc-dev \ | ||
libncurses5-dev \ | ||
&& rm -rf /var/lib/apt/lists/* | ||
|
||
INCLUDE+ ./common/Dockerfile.picolibc-dependencies | ||
|
||
ARG RUST_TARGET_TRIPLETS="arm-unknown-linux-gnueabi arm-unknown-linux-gnueabihf aarch64-unknown-linux-gnu" | ||
INCLUDE+ ./common/Dockerfile.binwrappers-dependencies |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
# syntax = edrevo/dockerfile-plus | ||
|
||
ARG FROM_IMAGE="debian:jessie" | ||
|
||
INCLUDE+ ./common/Dockerfile.base | ||
INCLUDE+ ./common/Dockerfile.picolibc-dependencies | ||
|
||
ARG RUST_TARGET_TRIPLETS="x86_64-unknown-linux-gnu" | ||
INCLUDE+ ./common/Dockerfile.binwrappers-dependencies |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,82 @@ | ||
# syntax = edrevo/dockerfile-plus | ||
|
||
ARG FROM_IMAGE="debian:stretch" | ||
|
||
INCLUDE+ ./common/Dockerfile.base | ||
|
||
# Based on https://github.com/andrew-d/docker-osxcross | ||
# and https://github.com/multiarch/crossbuild | ||
|
||
RUN set -ex; \ | ||
apt-get update && apt-get install -y -q --no-install-recommends \ | ||
build-essential \ | ||
clang-11 \ | ||
libgmp-dev \ | ||
libmpc-dev \ | ||
libmpfr-dev \ | ||
libncurses5-dev \ | ||
libxml2-dev \ | ||
llvm-11 \ | ||
llvm-11-dev \ | ||
&& rm -rf /var/lib/apt/lists/* | ||
|
||
ENV OSXCROSS_SDK_VERSION=12.0 | ||
|
||
ARG SDK_VERSION=${OSXCROSS_SDK_VERSION} | ||
ARG OSX_VERSION_MIN=${SDK_VERSION} | ||
ARG SDK_TAR=MacOSX${SDK_VERSION}.sdk.tar.xz | ||
ARG SDK_SHA256=cae67d142880ce67a3eca5dfd742f875f286d838abf3f2b6af8259c76b2e6c72 | ||
|
||
ARG OSXCROSS_COMMIT=56d8ec4ec9875f560e93aee738a631a35cfd6be9 | ||
|
||
ARG CLANG_VERSION=11 | ||
|
||
# Install clang/llvm alternative to use specific version | ||
RUN for file in /usr/bin/*-$CLANG_VERSION; do \ | ||
newfile="$(echo "$file" | sed 's/-'$CLANG_VERSION'$//')"; \ | ||
update-alternatives --install "$newfile" "$(basename "$newfile")" "$file" 1; \ | ||
done; | ||
|
||
RUN OSXCROSS_SRCS=/opt/osxcross \ | ||
&& OSXCROSS_TMP=/tmp/osxcross \ | ||
&& cd $(dirname ${OSXCROSS_SRCS}) \ | ||
&& git clone https://github.com/tpoechtrager/osxcross.git \ | ||
&& cd ${OSXCROSS_SRCS} \ | ||
&& git reset --hard ${OSXCROSS_COMMIT} \ | ||
&& cd tarballs/ && wget --no-verbose "https://dl.espressif.com/dl/toolchains/${SDK_TAR}" \ | ||
&& echo "${SDK_SHA256} *${SDK_TAR}" | sha256sum --check --strict - \ | ||
&& cd - \ | ||
&& export PORTABLE=1 \ | ||
&& export UNATTENDED=1 \ | ||
&& export GCC_VERSION=8.3.0 \ | ||
&& ./build.sh \ | ||
&& sed -i "s|https://git.llvm.org/git/compiler-rt.git|https://github.com/llvm-mirror/compiler-rt.git|g" build_compiler_rt.sh \ | ||
&& ./build_compiler_rt.sh \ | ||
&& ./build_gcc.sh \ | ||
&& ./build_binutils.sh \ | ||
####################### fix issue when trying to download already downloaded ###################### \ | ||
&& rm ${OSXCROSS_SRCS}/tarballs/binutils-2.32.tar.gz && rm ${OSXCROSS_SRCS}/tarballs/gdb-8.3.tar.gz \ | ||
&& TARGET_ARCH=aarch64 ./build_binutils.sh \ | ||
&& mkdir -p ${OSXCROSS_TMP} \ | ||
&& mv target ${OSXCROSS_TMP}/ \ | ||
&& mv tools ${OSXCROSS_TMP}/ \ | ||
&& rm -rf "${OSXCROSS_TMP}/target/SDK/MacOSX${SDK_VERSION}.sdk/usr/share/man" \ | ||
&& rm -rf "${OSXCROSS_SRCS}" \ | ||
&& mv ${OSXCROSS_TMP} /opt/ | ||
|
||
ENV PATH $PATH:/opt/osxcross/target/bin | ||
ENV PATH $PATH:/opt/osxcross/target/binutils/bin | ||
ENV MACOSX_DEPLOYMENT_TARGET=10.8 | ||
|
||
RUN for TARGET_HOST in "aarch64-apple-darwin21.1" "x86_64-apple-darwin21.1"; do \ | ||
which $TARGET_HOST-gcc || \ | ||
(set +H && \ | ||
echo -e "#!/bin/bash\n$TARGET_HOST-clang++ \"\$@\"" > /opt/osxcross/target/bin/$TARGET_HOST-g++ && \ | ||
echo -e "#!/bin/bash\n$TARGET_HOST-clang \"\$@\"" > /opt/osxcross/target/bin/$TARGET_HOST-gcc && \ | ||
chmod 755 /opt/osxcross/target/bin/$TARGET_HOST-g++ /opt/osxcross/target/bin/$TARGET_HOST-gcc) \ | ||
done | ||
|
||
INCLUDE+ ./common/Dockerfile.picolibc-dependencies | ||
|
||
ARG RUST_TARGET_TRIPLETS="x86_64-apple-darwin aarch64-apple-darwin" | ||
INCLUDE+ ./common/Dockerfile.binwrappers-dependencies |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
# syntax = edrevo/dockerfile-plus | ||
|
||
ARG FROM_IMAGE="debian:stretch" | ||
|
||
INCLUDE+ ./common/Dockerfile.base | ||
|
||
ARG WIN_CROSSTOOL=g++-mingw-w64-x86-64 | ||
RUN apt-get -o Acquire::Check-Valid-Until=false update && \ | ||
apt-get install --allow-unauthenticated -y -q ${WIN_CROSSTOOL} \ | ||
&& rm -rf /var/lib/apt/lists/* | ||
|
||
INCLUDE+ ./common/Dockerfile.picolibc-dependencies | ||
|
||
ARG RUST_TARGET_TRIPLETS=x86_64-pc-windows-gnu | ||
INCLUDE+ ./common/Dockerfile.binwrappers-dependencies |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,101 @@ | ||
FROM ${FROM_IMAGE} | ||
|
||
ARG DEBIAN_FRONTEND=noninteractive | ||
|
||
RUN if grep -q jessie /etc/apt/sources.list; then \ | ||
find /etc/apt/ -name "*.list" -exec rm {} + && \ | ||
echo "deb http://archive.debian.org/debian/ jessie main contrib non-free" > /etc/apt/sources.list && \ | ||
echo "deb-src http://archive.debian.org/debian/ jessie main contrib non-free" >> /etc/apt/sources.list && \ | ||
echo "deb http://archive.debian.org/debian-security jessie/updates main contrib non-free" >> /etc/apt/sources.list && \ | ||
echo "deb-src http://archive.debian.org/debian-security jessie/updates main contrib non-free" >> /etc/apt/sources.list && \ | ||
echo "deb http://archive.debian.org/debian/ jessie-backports main contrib non-free" >> /etc/apt/sources.list && \ | ||
echo "deb-src http://archive.debian.org/debian/ jessie-backports main contrib non-free" >> /etc/apt/sources.list; \ | ||
elif grep -q stretch /etc/apt/sources.list; then \ | ||
find /etc/apt/ -name "*.list" -exec rm {} + && \ | ||
echo "deb http://archive.debian.org/debian/ stretch main contrib non-free" > /etc/apt/sources.list && \ | ||
echo "deb-src http://archive.debian.org/debian/ stretch main contrib non-free" >> /etc/apt/sources.list && \ | ||
echo "deb http://archive.debian.org/debian/ stretch-proposed-updates main contrib non-free" >> /etc/apt/sources.list && \ | ||
echo "deb-src http://archive.debian.org/debian/ stretch-proposed-updates main contrib non-free" >> /etc/apt/sources.list && \ | ||
echo "deb http://archive.debian.org/debian-security stretch/updates main contrib non-free" >> /etc/apt/sources.list && \ | ||
echo "deb-src http://archive.debian.org/debian-security stretch/updates main contrib non-free" >> /etc/apt/sources.list; \ | ||
else \ | ||
echo "Error: /etc/apt/sources.list does not contain 'jessie' or 'stretch' or does not exist." && \ | ||
exit 1; \ | ||
fi | ||
|
||
RUN apt-get -o Acquire::Check-Valid-Until=false update && \ | ||
apt-get install --allow-unauthenticated -y -q --no-install-recommends \ | ||
apt-utils \ | ||
ca-certificates \ | ||
curl \ | ||
wget \ | ||
&& apt-get -o Acquire::Check-Valid-Until=false update \ | ||
&& apt-get build-dep --allow-unauthenticated -y -q binutils \ | ||
&& rm -rf /var/lib/apt/lists/* | ||
|
||
# Remove expired DST Root CA X3 certificate | ||
# https://letsencrypt.org/docs/dst-root-ca-x3-expiration-september-2021/ | ||
RUN sed -i '/DST_Root_CA_X3.crt/d' /etc/ca-certificates.conf && update-ca-certificates | ||
|
||
RUN rm /bin/sh && ln -s /bin/bash /bin/sh | ||
|
||
RUN apt-get -o Acquire::Check-Valid-Until=false update && \ | ||
apt-get install --allow-unauthenticated -y -q \ | ||
autoconf \ | ||
automake \ | ||
autotools-dev \ | ||
bc \ | ||
binfmt-support \ | ||
bison \ | ||
cpio \ | ||
devscripts \ | ||
file \ | ||
flex \ | ||
g++ \ | ||
gawk \ | ||
gcc \ | ||
gettext \ | ||
git \ | ||
gperf \ | ||
grep \ | ||
gzip \ | ||
help2man \ | ||
libc6-dev \ | ||
libffi-dev \ | ||
libncurses-dev \ | ||
libtool \ | ||
libtool-bin \ | ||
make \ | ||
openssh-client \ | ||
patch \ | ||
pkg-config \ | ||
rsync \ | ||
tar \ | ||
texinfo \ | ||
unzip \ | ||
uuid-dev \ | ||
vim \ | ||
wget \ | ||
xz-utils \ | ||
zip \ | ||
zlib1g-dev \ | ||
&& apt-get build-dep --allow-unauthenticated -y -q binutils \ | ||
&& rm -rf /var/lib/apt/lists/* | ||
|
||
ARG OPENSSL_VERSION=OpenSSL_1_1_1w | ||
RUN git clone https://github.com/openssl/openssl.git --depth=1 -b ${OPENSSL_VERSION} \ | ||
&& cd openssl \ | ||
&& _ARCH=$(gcc -dumpmachine) && setarch ${_ARCH%%-*} ./config \ | ||
&& make -j$(nproc) \ | ||
&& make install \ | ||
&& cd .. \ | ||
&& rm -fr openssl | ||
|
||
ARG CMAKE_VERSION=v3.28.6 | ||
RUN git clone https://github.com/Kitware/CMake.git --depth=1 -b ${CMAKE_VERSION} \ | ||
&& cd CMake \ | ||
&& ./configure \ | ||
&& make -j$(nproc) \ | ||
&& make install \ | ||
&& cd .. \ | ||
&& rm -fr CMake |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
RUN apt-get -o Acquire::Check-Valid-Until=false update \ | ||
&& apt-get install -y -q libc6-dev \ | ||
&& rm -rf /var/lib/apt/lists/* | ||
|
||
ARG RUST_VERSION=1.69.0 | ||
# Can not use rust version > 1.69.0 because of https://github.com/rust-lang/rust/issues/112368 | ||
RUN export _ARCH=$(gcc -dumpmachine) \ | ||
&& curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | setarch ${_ARCH%%-*} sh -s -- -y --default-toolchain ${RUST_VERSION} \ | ||
&& source "$HOME/.cargo/env" \ | ||
&& for RUST_TARGET_TRIPLET in ${RUST_TARGET_TRIPLETS}; do \ | ||
rustup target add $RUST_TARGET_TRIPLET; \ | ||
done | ||
|
||
ENV PATH /root/.cargo/bin:$PATH |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
ARG PYTHON_VERSION="3.10.13" | ||
ARG OPENSSL_VERSION="3.3.1" | ||
ARG LIBB2_VERSION="0.98.1" | ||
ARG MESON_VERSION="1.5.1" | ||
ARG NINJA_VERSION="1.11.1.1" | ||
|
||
# install picolibc build dependencies | ||
RUN apt-get remove -y python3 \ | ||
&& apt-get -y autoremove \ | ||
&& rm -rf /var/lib/apt/lists/* \ | ||
&& git clone https://github.com/BLAKE2/libb2.git --depth=1 -b v${LIBB2_VERSION} \ | ||
&& cd libb2 \ | ||
&& ./autogen.sh > /dev/null \ | ||
&& ./configure > /dev/null \ | ||
&& make -j$(nproc) > /dev/null \ | ||
&& make install > /dev/null \ | ||
&& cd .. \ | ||
&& rm -fr ./libb2 \ | ||
&& git clone https://github.com/python/cpython.git --depth=1 -b v$PYTHON_VERSION \ | ||
&& cd cpython \ | ||
&& ./configure LDFLAGS=-L/usr/lib > /dev/null \ | ||
&& make -j$(nproc) > /dev/null \ | ||
&& make install > /dev/null \ | ||
&& cd .. \ | ||
&& rm -fr ./cpython \ | ||
&& pip3 install --upgrade pip \ | ||
&& pip3 install meson==${MESON_VERSION} ninja==${NINJA_VERSION} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
#!/bin/sh | ||
# This script is workaround for bug https://github.com/edrevo/dockerfile-plus/issues/13 | ||
# You DO NOT need to run this script if you build only one image at a time | ||
set -e | ||
|
||
FILE_TO_OVERRIDE=$1 | ||
TMP_FILE="$1-copy" | ||
|
||
echo "Overriding ${FILE_TO_OVERRIDE} to replace \"INCLUDE+\" strings with specified files content" | ||
|
||
cp $FILE_TO_OVERRIDE $TMP_FILE | ||
|
||
echo -n "" > ${FILE_TO_OVERRIDE} | ||
while IFS= read -r line | ||
do | ||
if [ $(expr match "${line}" ".*edrevo/dockerfile-plus.*") != 0 ]; then | ||
continue | ||
fi | ||
|
||
if [ $(expr match "${line}" "INCLUDE+") != 0 ]; then | ||
cat ${line##INCLUDE+} >> ${FILE_TO_OVERRIDE} | ||
continue | ||
fi | ||
echo "${line}" >> ${FILE_TO_OVERRIDE} | ||
done < "${TMP_FILE}" | ||
|
||
rm $TMP_FILE |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
.build_image: &build_image | ||
stage: images | ||
image: espressif/dind:1 | ||
tags: [ "dind", "internet", "amd64" ] | ||
before_script: [] | ||
rules: | ||
- if: $BUILD_IMAGES | ||
- changes: | ||
- .gitlab/docker/**/* | ||
variables: | ||
EXTRA_BUILD_ARGS: "" | ||
artifacts: | ||
expire_in: 1 week | ||
when: on_failure | ||
paths: | ||
- ${CI_PROJECT_DIR}/build.log | ||
script: | ||
- cd .gitlab/docker | ||
# This is workaround for https://github.com/edrevo/dockerfile-plus/issues/13 | ||
# After the bug is fixed, please remove the line below. | ||
- ./dockerfile-plus_workaround.sh ${DOCKERFILE_NAME} && cat ${DOCKERFILE_NAME} | ||
- echo -n $CI_REGISTRY_PASSWORD | docker login -u $CI_REGISTRY_USER --password-stdin $CI_REGISTRY | ||
- docker pull $CI_REGISTRY_IMAGE/$IMAGE_NAME:latest || true | ||
- docker build | ||
--cache-from $CI_REGISTRY_IMAGE/$IMAGE_NAME:latest | ||
--file $DOCKERFILE_NAME | ||
${EXTRA_BUILD_ARGS} | ||
--tag $CI_REGISTRY_IMAGE/$IMAGE_NAME:$CI_COMMIT_SHA | ||
--tag $CI_REGISTRY_IMAGE/$IMAGE_NAME:latest . | ||
> ${CI_PROJECT_DIR}/build.log | ||
- docker push $CI_REGISTRY_IMAGE/$IMAGE_NAME:$CI_COMMIT_SHA | ||
- docker push $CI_REGISTRY_IMAGE/$IMAGE_NAME:latest | ||
|
||
image_linux_x86: | ||
variables: | ||
DOCKERFILE_NAME: Dockerfile.linux-x86_64 | ||
EXTRA_BUILD_ARGS: "--build-arg FROM_IMAGE=i386/debian:jessie --build-arg RUST_TARGET_TRIPLETS=i586-unknown-linux-gnu" | ||
IMAGE_NAME: build-linux-x86 | ||
extends: .build_image | ||
|
||
image_linux_x86_64: | ||
variables: | ||
DOCKERFILE_NAME: Dockerfile.linux-x86_64 | ||
IMAGE_NAME: build-linux-x86_64 | ||
extends: .build_image | ||
|
||
image_linux_arm: | ||
variables: | ||
DOCKERFILE_NAME: Dockerfile.linux-arm | ||
IMAGE_NAME: build-linux-arm | ||
extends: .build_image | ||
|
||
image_win_x86: | ||
variables: | ||
DOCKERFILE_NAME: Dockerfile.win | ||
EXTRA_BUILD_ARGS: "--build-arg WIN_CROSSTOOL=g++-mingw-w64-i686 --build-arg RUST_TARGET_TRIPLETS=i686-pc-windows-gnu" | ||
IMAGE_NAME: build-win-x86 | ||
extends: .build_image | ||
|
||
image_win_x86_64: | ||
variables: | ||
DOCKERFILE_NAME: Dockerfile.win | ||
IMAGE_NAME: build-win-x86_64 | ||
extends: .build_image | ||
|
||
image_macos: | ||
variables: | ||
DOCKERFILE_NAME: Dockerfile.macos | ||
IMAGE_NAME: build-macos | ||
extends: .build_image |