From a49882b252ed24d572b46c51d28b2fd889a74920 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Kr=C3=B6ning?= Date: Fri, 9 Aug 2024 14:16:43 +0000 Subject: [PATCH] refactor: clone git repos using Docker MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Martin Kröning --- Dockerfile | 12 +++++++++--- toolchain.sh | 27 --------------------------- 2 files changed, 9 insertions(+), 30 deletions(-) diff --git a/Dockerfile b/Dockerfile index 8df7f97..55d21ba 100644 --- a/Dockerfile +++ b/Dockerfile @@ -4,7 +4,6 @@ RUN set -eux; \ apt-get update; \ apt-get install -y --no-install-recommends \ bison \ - git \ flex \ libgmp-dev \ libisl-dev \ @@ -14,8 +13,15 @@ RUN set -eux; \ ; \ rm -rf /var/lib/apt/lists/*; -WORKDIR /root/ -ADD ./toolchain.sh /root/toolchain.sh +WORKDIR /root + +ADD --link https://github.com/hermit-os/binutils.git binutils +ADD --link https://github.com/hermit-os/gcc.git gcc +ADD --link https://github.com/hermit-os/kernel.git kernel +ADD --link https://github.com/hermit-os/newlib.git newlib +ADD --link https://github.com/hermit-os/pthread-embedded.git pte +ADD --link ./toolchain.sh ./toolchain.sh + RUN ./toolchain.sh x86_64-hermit /opt/hermit diff --git a/toolchain.sh b/toolchain.sh index 841d9cd..0251378 100755 --- a/toolchain.sh +++ b/toolchain.sh @@ -8,8 +8,6 @@ # exit when any command fails set -e -BUILDDIR=build -CLONE_DEPTH="--depth=50" PREFIX="$2" TARGET=$1 NJOBS=-j"$(nproc)" @@ -24,29 +22,6 @@ export CXXFLAGS_FOR_TARGET="-fPIE -pie" echo "Build bootstrap toolchain for $TARGET with $NJOBS jobs for $PREFIX" -mkdir -p $BUILDDIR -cd $BUILDDIR - -if [ ! -d "binutils" ]; then -git clone $CLONE_DEPTH https://github.com/hermit-os/binutils.git -fi - -if [ ! -d "gcc" ]; then -git clone $CLONE_DEPTH https://github.com/hermit-os/gcc.git -fi - -if [ ! -d "kernel" ]; then -git clone https://github.com/hermit-os/kernel -fi - -if [ ! -d "newlib" ]; then -git clone $CLONE_DEPTH -b path2rs https://github.com/hermit-os/newlib.git -fi - -if [ ! -d "pte" ]; then -git clone $CLONE_DEPTH -b path2rs https://github.com/hermit-os/pthread-embedded.git pte -fi - if [ ! -d "tmp/binutils" ]; then mkdir -p tmp/binutils cd tmp/binutils @@ -149,5 +124,3 @@ make -O $NJOBS make install cd - fi - -cd ..