From: Thomas Lamprecht Date: Wed, 24 May 2023 16:44:30 +0000 (+0200) Subject: buildsys: rework downloading and vendoring upstream X-Git-Url: https://git.proxmox.com/?p=pve-eslint.git;a=commitdiff_plain;h=99671ec811e0a447ecbc44c0c967b411b3dd40b4 buildsys: rework downloading and vendoring upstream try to ensure that a clean dependency/prerequisites chain exists Signed-off-by: Thomas Lamprecht --- diff --git a/Makefile b/Makefile index 5183a28..f73103f 100644 --- a/Makefile +++ b/Makefile @@ -11,7 +11,7 @@ DSC=$(PACKAGE)_$(DEB_VERSION_UPSTREAM_REVISION).dsc SRCDIR=src UPSTREAM=eslint UPSTREAMTAG=v8.41.0 -BUILDSRC=$(UPSTREAM)-$(UPSTREAMTAG) +UPSTREAMSRC=$(UPSTREAM)-$(UPSTREAMTAG) all: $(DEB) @echo $(DEB) @@ -41,27 +41,37 @@ $(DEB): builddir .PHONY: download download: + rm -rf $(UPSTREAM) + $(MAKE) $(UPSTREAM) + +$(UPSTREAM): rm -rf $(UPSTREAM).tmp $(UPSTREAM) git clone -b $(UPSTREAMTAG) --depth 1 https://github.com/eslint/eslint $(UPSTREAM).tmp rm -rf $(UPSTREAM).tmp/.git find $(UPSTREAM).tmp/ -type f -name '.gitignore' -delete mv $(UPSTREAM).tmp $(UPSTREAM) +.PHONY: vendor-upstream +vendor-upstream: + rm -rf $(UPSTREAMSRC) src/lib/eslint.js + $(MAKE) src/lib/eslint.js + +src/lib/eslint.js: $(UPSTREAMSRC)/build/eslint.js + cp $(UPSTREAMSRC)/build/eslint.js src/lib/eslint.js + +$(UPSTREAMSRC)/build/eslint.js: $(UPSTREAMSRC) # NOTE: needs npm installed, downloads packages from npm -.PHONY: buildupstream -buildupstream: $(BUILDSRC) - cp $(BUILDSRC)/build/eslint.js $(SRCDIR)/lib/eslint.js + cd $(UPSTREAMSRC); npm install + cd $(UPSTREAMSRC); npm run build:webpack -$(BUILDSRC): $(UPSTREAM) patches - rm -rf $@ +$(UPSTREAMSRC): $(UPSTREAM) patches + rm -rf $@ $@.tmp mkdir $@.tmp rsync -ra $(UPSTREAM)/ $@.tmp cd $@.tmp; ln -s ../patches patches cd $@.tmp; quilt push -a cd $@.tmp; rm -rf .pc ./patches mv $@.tmp $@ - cd $@; npm install - cd $@; npm run build:webpack .PHONY: upload upload: UPLOAD_DIST ?= $(DEB_DISTRIBUTION)