build: bootstrap: Fix versions of external dependencies
diff --git a/.gitignore b/.gitignore
index 5775ffde..c72efeef 100644
--- a/.gitignore
+++ b/.gitignore
@@ -7,6 +7,7 @@
/common/flanterm
/common/stb/stb_image.h*
/decompressor/tinf
+/tinf
/ovmf*
*.o
*.d
diff --git a/GNUmakefile.in b/GNUmakefile.in
index 6c296b62..1b65e02a 100644
--- a/GNUmakefile.in
+++ b/GNUmakefile.in
@@ -309,6 +309,7 @@ dist:
done
rm -rf '$(call SHESCAPE,$(BUILDDIR))'/"limine-$(LIMINE_VERSION)/limine-efi/.git"
rm -rf '$(call SHESCAPE,$(BUILDDIR))'/"limine-$(LIMINE_VERSION)/limine-efi/.gitignore"
+ rm -rf '$(call SHESCAPE,$(BUILDDIR))'/"limine-$(LIMINE_VERSION)/tinf"
rm -rf '$(call SHESCAPE,$(BUILDDIR))'/"limine-$(LIMINE_VERSION)/.git"
rm -rf '$(call SHESCAPE,$(BUILDDIR))'/"limine-$(LIMINE_VERSION)/.gitignore"
rm -rf '$(call SHESCAPE,$(BUILDDIR))'/"limine-$(LIMINE_VERSION)/.github"
@@ -328,7 +329,7 @@ distclean: clean
.PHONY: maintainer-clean
maintainer-clean: distclean
- cd '$(call SHESCAPE,$(SRCDIR))' && rm -rf common/flanterm common/stb/stb_image.h* decompressor/tinf freestanding-headers libgcc-binaries limine-efi freestanding-toolchain configure build-aux *'~' autom4te.cache aclocal.m4 *.tar.xz *.tar.gz
+ cd '$(call SHESCAPE,$(SRCDIR))' && rm -rf common/flanterm common/stb/stb_image.h* decompressor/tinf tinf freestanding-headers libgcc-binaries limine-efi freestanding-toolchain configure build-aux *'~' autom4te.cache aclocal.m4 *.tar.xz *.tar.gz
.PHONY: common-uefi-x86-64
common-uefi-x86-64:
diff --git a/bootstrap b/bootstrap
index f953724e..50e98647 100755
--- a/bootstrap
+++ b/bootstrap
@@ -7,29 +7,85 @@ test -z "$srcdir" && srcdir=.
cd "$srcdir"
-if [ -z "$BOOTSTRAP_NO_SHALLOW_CLONES" ]; then
- SHALLOW_CLONE_FLAG="--depth=1"
-fi
+STB_COMMIT_HASH=f4a71b13373436a2866c5d68f8f80ac6f0bc1ffe
+STB_IMAGE_H_HASH=9053a86ea3fab378ad42c740bbc5003c7c2038a466da1446e1d9b943178d131c9add2d41fca23149cc55381a94ba32c4d29f5ce09d80e19809e067bac2ee7b92
-[ -d common/flanterm ] || git clone https://github.com/mintsuki/flanterm.git common/flanterm $SHALLOW_CLONE_FLAG
+FREESTANDING_TOOLCHAIN_COMMIT_HASH=2ab7a489652291d430a7b693430c97ea9cb7bcbf
+FREESTANDING_TOOLCHAIN_HASH=558c0a1f4e10aeb32e1331e0139a571cde648fe281b85a2163e1f4b5fe639cec1ba87906d24dcfe52b62540290beac71a2ba3e3c20686933c969b60f122826a5
+
+FLANTERM_COMMIT_HASH=68ace922418c1aa974380ce01477f31ee9cd5d38
+
+FREESTANDING_HEADERS_COMMIT_HASH=dd3abd2d7147efc4170dff478d3b7730bed14147
+
+LIBGCC_BINARIES_COMMIT_HASH=7e1775311640070f3157a332c6ad5bce1c47ad56
+
+LIMINE_EFI_COMMIT_HASH=c7d42cae902fc7e3f0b20b428186e8d9b1e9f5b5
+
+TINF_COMMIT_HASH=57ffa1f1d5e3dde19011b2127bd26d01689b694b
+
+clone_repo_commit() {
+ [ -d $2 ] && (
+ set -e
+ git -C $2 checkout $3 || (
+ set -e
+ rm -rf $2
+ )
+ )
+ [ -d $2 ] || (
+ set -e
+ git clone $1 $2
+ git -C $2 checkout $3
+ )
+}
+
+clone_repo_commit https://github.com/mintsuki/flanterm.git common/flanterm $FLANTERM_COMMIT_HASH
+clone_repo_commit https://github.com/mintsuki/freestanding-headers.git freestanding-headers $FREESTANDING_HEADERS_COMMIT_HASH
+clone_repo_commit https://github.com/mintsuki/libgcc-binaries.git libgcc-binaries $LIBGCC_BINARIES_COMMIT_HASH
+clone_repo_commit https://github.com/limine-bootloader/limine-efi.git limine-efi $LIMINE_EFI_COMMIT_HASH
+clone_repo_commit https://github.com/jibsen/tinf.git tinf $TINF_COMMIT_HASH
+
+########################################################
+########################################################
+
+[ -f common/stb/stb_image.h ] && (
+ set -e
+ b2sum common/stb/stb_image.h | grep $STB_IMAGE_H_HASH >/dev/null 2>&1 || (
+ set -e
+ rm -f common/stb/stb_image.h
+ )
+)
[ -f common/stb/stb_image.h ] || (
set -e
- curl -Lo common/stb/stb_image.h https://github.com/nothings/stb/raw/master/stb_image.h
+ curl -Lo common/stb/stb_image.h https://github.com/nothings/stb/raw/$STB_COMMIT_HASH/stb_image.h
patch -p0 < common/stb_image.patch
rm -f common/stb/stb_image.h.orig
)
-[ -d decompressor/tinf ] || (
+
+########################################################
+########################################################
+
+mkdir -p decompressor/tinf
+cp tinf/src/tinf.h tinf/src/tinflate.c tinf/src/tinfgzip.c decompressor/tinf/
+patch -p0 < decompressor/tinf.patch
+
+########################################################
+########################################################
+
+[ -f freestanding-toolchain ] && (
+ set -e
+ b2sum freestanding-toolchain | grep $FREESTANDING_TOOLCHAIN_HASH >/dev/null 2>&1 || (
+ set -e
+ rm -f freestanding-toolchain
+ )
+)
+[ -f freestanding-toolchain ] || (
set -e
- mkdir -p decompressor/tinf
- curl -Lo decompressor/tinf/tinf.h https://github.com/jibsen/tinf/raw/master/src/tinf.h
- curl -Lo decompressor/tinf/tinflate.c https://github.com/jibsen/tinf/raw/master/src/tinflate.c
- curl -Lo decompressor/tinf/tinfgzip.c https://github.com/jibsen/tinf/raw/master/src/tinfgzip.c
- patch -p0 < decompressor/tinf.patch
+ curl -Lo freestanding-toolchain https://github.com/mintsuki/freestanding-toolchain/raw/$FREESTANDING_TOOLCHAIN_COMMIT_HASH/freestanding-toolchain
+ chmod +x freestanding-toolchain
)
-[ -f freestanding-toolchain ] || ( curl -Lo freestanding-toolchain https://github.com/mintsuki/freestanding-toolchain/raw/trunk/freestanding-toolchain && chmod +x freestanding-toolchain )
-[ -d freestanding-headers ] || git clone https://github.com/mintsuki/freestanding-headers.git $SHALLOW_CLONE_FLAG
-[ -d limine-efi ] || git clone https://github.com/limine-bootloader/limine-efi.git $SHALLOW_CLONE_FLAG
-[ -d libgcc-binaries ] || git clone https://github.com/mintsuki/libgcc-binaries.git $SHALLOW_CLONE_FLAG
+
+########################################################
+########################################################
autoreconf -fvi -Wall
