From 00aaeb8297638f94a90a82e9c22f550a53d3afc8 Mon Sep 17 00:00:00 2001 From: Tester Date: Mon, 22 Jan 2024 15:07:09 +0330 Subject: [PATCH 1/5] Improve Makefile --- .gitignore | 2 -- Makefile | 19 ++++++------------- {preprocess => scripts}/generate_consts.py | 0 3 files changed, 6 insertions(+), 15 deletions(-) rename {preprocess => scripts}/generate_consts.py (100%) diff --git a/.gitignore b/.gitignore index ff463fc4..9b81e7e3 100644 --- a/.gitignore +++ b/.gitignore @@ -18,6 +18,4 @@ curl-*/ *.tar.xz *.tar.gz .patched -.preprocessed -.so_downloaded include/ diff --git a/Makefile b/Makefile index 0d62a6db..e6ecd2ce 100644 --- a/Makefile +++ b/Makefile @@ -3,24 +3,17 @@ SHELL := bash VERSION := 0.6.0b9 CURL_VERSION := curl-8.1.1 -.preprocessed: curl_cffi/include/curl/curl.h - touch .preprocessed - -curl_cffi/const.py: curl_cffi/include - python preprocess/generate_consts.py $(CURL_VERSION) - -$(CURL_VERSION): +curl_artifacts: curl -L "https://curl.se/download/$(CURL_VERSION).tar.xz" \ -o "$(CURL_VERSION).tar.xz" tar -xf $(CURL_VERSION).tar.xz -curl-impersonate-$(VERSION)/chrome/patches: $(CURL_VERSION) curl -L "https://github.com/yifeikong/curl-impersonate/archive/refs/tags/v$(VERSION).tar.gz" \ -o "curl-impersonate-$(VERSION).tar.gz" tar -xf curl-impersonate-$(VERSION).tar.gz # TODO add the headers to sdist package -curl_cffi/include/curl/curl.h: curl-impersonate-$(VERSION)/chrome/patches +curl_cffi/include/curl/curl.h: curl_artifacts cd $(CURL_VERSION) for p in $ Date: Thu, 1 Feb 2024 13:50:29 +0800 Subject: [PATCH 2/5] Move files --- bump_version.sh => scripts/bump_version.sh | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename bump_version.sh => scripts/bump_version.sh (100%) diff --git a/bump_version.sh b/scripts/bump_version.sh similarity index 100% rename from bump_version.sh rename to scripts/bump_version.sh From 02f1d69aeb34c72219b0a844d48b5081309241c0 Mon Sep 17 00:00:00 2001 From: Yifei Kong Date: Thu, 1 Feb 2024 14:02:50 +0800 Subject: [PATCH 3/5] Polish makefile --- Makefile | 25 ++++++++++--------------- 1 file changed, 10 insertions(+), 15 deletions(-) diff --git a/Makefile b/Makefile index e6ecd2ce..eda0a7f6 100644 --- a/Makefile +++ b/Makefile @@ -3,7 +3,7 @@ SHELL := bash VERSION := 0.6.0b9 CURL_VERSION := curl-8.1.1 -curl_artifacts: +$(CURL_VERSION): curl -L "https://curl.se/download/$(CURL_VERSION).tar.xz" \ -o "$(CURL_VERSION).tar.xz" tar -xf $(CURL_VERSION).tar.xz @@ -12,8 +12,7 @@ curl_artifacts: -o "curl-impersonate-$(VERSION).tar.gz" tar -xf curl-impersonate-$(VERSION).tar.gz -# TODO add the headers to sdist package -curl_cffi/include/curl/curl.h: curl_artifacts +curl_cffi/include/curl/curl.h: $(CURL_VERSION) cd $(CURL_VERSION) for p in $ Date: Thu, 1 Feb 2024 14:14:42 +0800 Subject: [PATCH 4/5] Polish makefile, again --- .gitignore | 2 +- Makefile | 16 +++++++++++----- 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/.gitignore b/.gitignore index 9b81e7e3..ddfeb5ca 100644 --- a/.gitignore +++ b/.gitignore @@ -17,5 +17,5 @@ curl_cffi.egg-info/ curl-*/ *.tar.xz *.tar.gz -.patched +.preprocessed include/ diff --git a/Makefile b/Makefile index eda0a7f6..096ec293 100644 --- a/Makefile +++ b/Makefile @@ -8,25 +8,31 @@ $(CURL_VERSION): -o "$(CURL_VERSION).tar.xz" tar -xf $(CURL_VERSION).tar.xz +curl-impersonate-$(VERSION)/chrome/patches: $(CURL_VERSION) curl -L "https://github.com/yifeikong/curl-impersonate/archive/refs/tags/v$(VERSION).tar.gz" \ -o "curl-impersonate-$(VERSION).tar.gz" tar -xf curl-impersonate-$(VERSION).tar.gz -curl_cffi/include/curl/curl.h: $(CURL_VERSION) +.preprocessed: curl-impersonate-$(VERSION)/chrome/patches cd $(CURL_VERSION) for p in $ Date: Thu, 1 Feb 2024 14:21:27 +0800 Subject: [PATCH 5/5] Fix make clean --- .gitignore | 1 + Makefile | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index ddfeb5ca..3c7aa4e7 100644 --- a/.gitignore +++ b/.gitignore @@ -19,3 +19,4 @@ curl-*/ *.tar.gz .preprocessed include/ +.DS_Store diff --git a/Makefile b/Makefile index 096ec293..ad8f4c58 100644 --- a/Makefile +++ b/Makefile @@ -43,7 +43,7 @@ test: clean: rm -rf build/ dist/ curl_cffi.egg-info/ $(CURL_VERSION)/ curl-impersonate-$(VERSION)/ rm -rf curl_cffi/*.o curl_cffi/*.so curl_cffi/_wrapper.c - rm -rf $(CURL_VERSION).tar.xz curl-impersonate-$(VERSION).tar.gz + rm -rf .preprocessed $(CURL_VERSION).tar.xz curl-impersonate-$(VERSION).tar.gz rm -rf curl_cffi/include/ .PHONY: clean build test install-editable preprocess gen-const