From bf237229b6a25603deb00cb1b7807e6d4bd6e3a9 Mon Sep 17 00:00:00 2001 From: Andrew Eikum Date: Wed, 19 Jun 2019 12:23:26 -0500 Subject: [PATCH] makefile: Add downloads target to download packages only once --- Makefile | 2 +- build/makefile_base.mak | 43 +++++++++++++++++++++++++++++++++++++---- 2 files changed, 40 insertions(+), 5 deletions(-) diff --git a/Makefile b/Makefile index a0b79767..e3dcd7eb 100644 --- a/Makefile +++ b/Makefile @@ -80,7 +80,7 @@ clean: vagrant vagrant ssh -c 'rm -rf $(BUILD_DIR)/' configure: vagrant - @vagrant ssh -c 'if [ ! -e $(BUILD_DIR)/Makefile ]; then if ! schroot -i -c dxvk_crosscc >/dev/null 2>&1; then echo !!!! You must run \"vagrant provision\" !!!!; exit 1; fi; mkdir -p $(BUILD_DIR); (cd $(BUILD_DIR) && $(CONFIGURE_CMD)); fi' + @vagrant ssh -c 'if [ ! -e $(BUILD_DIR)/Makefile ]; then if ! schroot -i -c dxvk_crosscc >/dev/null 2>&1; then echo !!!! You must run \"vagrant provision\" !!!!; exit 1; fi; mkdir -p $(BUILD_DIR); (cd $(BUILD_DIR) && $(CONFIGURE_CMD)); fi && make -C $(BUILD_DIR) downloads' proton: configure vagrant ssh -c 'make -C $(BUILD_DIR)/ dist' diff --git a/build/makefile_base.mak b/build/makefile_base.mak index d7fc1eb2..635c6cc2 100644 --- a/build/makefile_base.mak +++ b/build/makefile_base.mak @@ -266,6 +266,41 @@ OBJ_DIRS := $(TOOLS_DIR32) $(TOOLS_DIR64) \ $(OBJ_DIRS): mkdir -p $@ + +## downloads -- Convenience target to download packages used during the build +## process. Places them in subdirs one up from the Proton source dir, so +## they won't be wiped during git-clean, vagrant rsync, etc. + +.PHONY: downloads + +BISON_TARBALL_URL := https://ftpmirror.gnu.org/bison/$(BISON_TARBALL) +GECKO64_MSI_URL := https://dl.winehq.org/wine/wine-gecko/$(GECKO_VER)/$(GECKO64_MSI) +GECKO32_MSI_URL := https://dl.winehq.org/wine/wine-gecko/$(GECKO_VER)/$(GECKO32_MSI) +MONO_TARBALL_URL := https://github.com/madewokherd/wine-mono/releases/download/wine-mono-$(WINEMONO_VER)/$(WINEMONO_TARBALL) + +SHARED_BISON_TARBALL := $(SRCDIR)/../bison/$(BISON_TARBALL) +SHARED_GECKO64_MSI := $(SRCDIR)/../gecko/$(GECKO64_MSI) +SHARED_GECKO32_MSI := $(SRCDIR)/../gecko/$(GECKO32_MSI) +SHARED_MONO_TARBALL := $(SRCDIR)/../mono/$(WINEMONO_TARBALL) + +$(SHARED_BISON_TARBALL): + mkdir -p $(dir $@) + wget -O "$@" "$(BISON_TARBALL_URL)" + +$(SHARED_GECKO64_MSI): + mkdir -p $(dir $@) + wget -O "$@" "$(GECKO64_MSI_URL)" + +$(SHARED_GECKO32_MSI): + mkdir -p $(dir $@) + wget -O "$@" "$(GECKO32_MSI_URL)" + +$(SHARED_MONO_TARBALL): + mkdir -p $(dir $@) + wget -O "$@" "$(MONO_TARBALL_URL)" + +downloads: $(SHARED_BISON_TARBALL) $(SHARED_GECKO64_MSI) $(SHARED_GECKO32_MSI) $(SHARED_MONO_TARBALL) + ## ## dist/install -- steps to finalize the install ## @@ -339,7 +374,7 @@ $(DIST_GECKO64): | $(DIST_GECKO_DIR) mkdir -p $(SRCDIR)/contrib/; \ if [ ! -e "$(SRCDIR)/contrib/$(GECKO64_MSI)" ]; then \ echo ">>>> Downloading wine-gecko. To avoid this in future, put it here: $(SRCDIR)/../gecko/$(GECKO64_MSI)"; \ - wget -O "$(SRCDIR)/contrib/$(GECKO64_MSI)" "https://dl.winehq.org/wine/wine-gecko/$(GECKO_VER)/$(GECKO64_MSI)"; \ + wget -O "$(SRCDIR)/contrib/$(GECKO64_MSI)" "$(GECKO64_MSI_URL)"; \ fi; \ cp "$(SRCDIR)/contrib/$(GECKO64_MSI)" "$@"; \ fi @@ -351,7 +386,7 @@ $(DIST_GECKO32): | $(DIST_GECKO_DIR) mkdir -p $(SRCDIR)/contrib/; \ if [ ! -e "$(SRCDIR)/contrib/$(GECKO32_MSI)" ]; then \ echo ">>>> Downloading wine-gecko. To avoid this in future, put it here: $(SRCDIR)/../gecko/$(GECKO32_MSI)"; \ - wget -O "$(SRCDIR)/contrib/$(GECKO32_MSI)" "https://dl.winehq.org/wine/wine-gecko/$(GECKO_VER)/$(GECKO32_MSI)"; \ + wget -O "$(SRCDIR)/contrib/$(GECKO32_MSI)" "$(GECKO32_MSI_URL)"; \ fi; \ cp "$(SRCDIR)/contrib/$(GECKO32_MSI)" "$@"; \ fi @@ -366,7 +401,7 @@ $(DIST_WINEMONO): | $(DIST_WINEMONO_DIR) mkdir -p $(SRCDIR)/contrib/; \ if [ ! -e "$(SRCDIR)/contrib/$(WINEMONO_TARBALL)" ]; then \ echo ">>>> Downloading wine-mono. To avoid this in future, put it here: $(SRCDIR)/../mono/$(WINEMONO_TARBALL)"; \ - wget -O "$(SRCDIR)/contrib/$(WINEMONO_TARBALL)" "https://github.com/madewokherd/wine-mono/releases/download/wine-mono-$(WINEMONO_VER)/$(WINEMONO_TARBALL)"; \ + wget -O "$(SRCDIR)/contrib/$(WINEMONO_TARBALL)" "$(MONO_TARBALL_URL)"; \ fi; \ tar -xf "$(SRCDIR)/contrib/$(WINEMONO_TARBALL)" -C "$(dir $@)"; \ fi @@ -997,7 +1032,7 @@ $(BISON): mkdir -p $(SRCDIR)/contrib/; \ if [ ! -e "$(SRCDIR)/contrib/$(BISON_TARBALL)" ]; then \ echo ">>>> Downloading bison. To avoid this in future, put it here: $(SRCDIR)/../bison/$(BISON_TARBALL)"; \ - wget -O "$(SRCDIR)/contrib/$(BISON_TARBALL)" "https://ftpmirror.gnu.org/bison/$(BISON_TARBALL)"; \ + wget -O "$(SRCDIR)/contrib/$(BISON_TARBALL)" "$(BISON_TARBALL_URL)"; \ fi; \ tar -xf "$(SRCDIR)/contrib/$(BISON_TARBALL)" -C "$(dir $@)"; \ fi