Skip to content

Commit

Permalink
Download curl from github as tgz, xz is not safe anyway
Browse files Browse the repository at this point in the history
  • Loading branch information
yifeikong committed Apr 18, 2024
1 parent 98447a0 commit 00c2b6b
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions Makefile.in
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ BROTLI_VERSION := 1.0.9
BORING_SSL_COMMIT := d24a38200fef19150eef00cad35b138936c08767
NGHTTP2_VERSION := nghttp2-1.56.0
NGHTTP2_URL := https://github.com/nghttp2/nghttp2/releases/download/v1.56.0/nghttp2-1.56.0.tar.bz2
CURL_VERSION := curl-8.5.0
CURL_VERSION := curl-8_5_0

brotli_install_dir := $(abspath brotli-$(BROTLI_VERSION)/out/installed)
brotli_static_libs := $(brotli_install_dir)/lib/libbrotlicommon-static.a $(brotli_install_dir)/lib/libbrotlidec-static.a
Expand Down Expand Up @@ -111,7 +111,7 @@ clean: ## Remove all build artifacts, including dependencies
rm -Rf brotli-$(BROTLI_VERSION).tar.gz brotli-$(BROTLI_VERSION)
rm -Rf boringssl.zip boringssl
rm -Rf $(NGHTTP2_VERSION).tar.bz2 $(NGHTTP2_VERSION)
rm -Rf $(CURL_VERSION).tar.xz $(CURL_VERSION)
rm -Rf $(CURL_VERSION).tar.gz $(CURL_VERSION)

brotli-$(BROTLI_VERSION).tar.gz:
curl -L "https://github.com/google/brotli/archive/refs/tags/v${BROTLI_VERSION}.tar.gz" \
Expand Down Expand Up @@ -223,22 +223,23 @@ $(nghttp2_static_libs): $(NGHTTP2_VERSION).tar.bz2
$(MAKE) MAKEFLAGS=-j$(SUBJOBS)
$(MAKE) install MAKEFLAGS=

$(CURL_VERSION).tar.xz:
curl -L "https://curl.se/download/$(CURL_VERSION).tar.xz" \
-o "$(CURL_VERSION).tar.xz"
$(CURL_VERSION).tar.gz:
curl -L "https://github.com/curl/curl/archive/$(CURL_VERSION).tar.gz" -o
-o "$(CURL_VERSION).tar.gz"

# Apply the "Chorme version" patches and mark using a dummy file
$(CURL_VERSION)/.patched-chrome: $(srcdir)/chrome/patches/curl-*.patch
rm -Rf $(CURL_VERSION)
tar -xf $(CURL_VERSION).tar.xz
tar -xf $(CURL_VERSION).tar.gz
mv curl-$(CURL_VERSION) $(CURL_VERSION) # fix directory name
cd $(CURL_VERSION)
for p in $^; do patch -p1 < $$p; done
# Re-generate the configure script
autoreconf -fi
touch .patched-chrome

# This is a small hack that flags that curl was patched and configured in the "chrome" version
$(CURL_VERSION)/.chrome: $(chrome_libs) $(CURL_VERSION).tar.xz $(CURL_VERSION)/.patched-chrome
$(CURL_VERSION)/.chrome: $(chrome_libs) $(CURL_VERSION).tar.gz $(CURL_VERSION)/.patched-chrome
cd $(CURL_VERSION)

# Set up the configure flags to curl.
Expand Down

0 comments on commit 00c2b6b

Please sign in to comment.