makefile: Add downloads target to download packages only once

This commit is contained in:
Andrew Eikum 2019-06-19 12:23:26 -05:00
parent d7819c7bc5
commit bf237229b6
2 changed files with 40 additions and 5 deletions

View file

@ -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'

View file

@ -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