Skip to content

Commit dfc3310

Browse files
authored
Merge pull request #1844 from wilzbach/use-dub-from-binary
Use dub from the release binary
2 parents 6476dd2 + 758c173 commit dfc3310

File tree

1 file changed

+10
-15
lines changed

1 file changed

+10
-15
lines changed

posix.mak

Lines changed: 10 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -24,13 +24,11 @@ PHOBOS_DIR=../phobos
2424
DRUNTIME_DIR=../druntime
2525
TOOLS_DIR=../tools
2626
INSTALLER_DIR=../installer
27-
DUB_DIR=../dub-${DUB_VER}
2827

2928
include $(DMD_DIR)/src/osmodel.mak
3029

3130
# External binaries
3231
DMD=$(DMD_DIR)/generated/$(OS)/release/$(MODEL)/dmd
33-
DUB=${DUB_DIR}/bin/dub
3432

3533
# External directories
3634
DOC_OUTPUT_DIR:=$(PWD)/web
@@ -65,14 +63,14 @@ PHOBOS_STABLE_FILES_GENERATED := $(subst $(PHOBOS_STABLE_DIR), $(PHOBOS_STABLE_D
6563
################################################################################
6664

6765
# stable dub and dmd versions used to build dpl-docs
68-
DUB_VER=1.1.0
6966
STABLE_DMD_VER=2.072.2
7067
STABLE_DMD_ROOT=$(GENERATED)/stable_dmd-$(STABLE_DMD_VER)
7168
STABLE_DMD_URL=http://downloads.dlang.org/releases/2.x/$(STABLE_DMD_VER)/dmd.$(STABLE_DMD_VER).$(OS).zip
72-
STABLE_DMD=$(STABLE_DMD_ROOT)/dmd2/$(OS)/$(if $(filter $(OS),osx),bin,bin$(MODEL))/dmd
69+
STABLE_DMD_BIN_ROOT=$(STABLE_DMD_ROOT)/dmd2/$(OS)/$(if $(filter $(OS),osx),bin,bin$(MODEL))
70+
STABLE_DMD=$(STABLE_DMD_BIN_ROOT)/dmd
7371
STABLE_DMD_CONF=$(STABLE_DMD).conf
74-
STABLE_RDMD=$(STABLE_DMD_ROOT)/dmd2/$(OS)/$(if $(filter $(OS),osx),bin,bin$(MODEL))/rdmd \
75-
--compiler=$(STABLE_DMD) -conf=$(STABLE_DMD_CONF)
72+
STABLE_RDMD=$(STABLE_DMD_BIN_ROOT)/rdmd --compiler=$(STABLE_DMD) -conf=$(STABLE_DMD_CONF)
73+
DUB=$(STABLE_DMD_BIN_ROOT)/dub
7674

7775
# exclude lists
7876
MOD_EXCLUDES_PRERELEASE=$(addprefix --ex=, gc. rt. core.internal. core.stdc.config core.sys. \
@@ -277,7 +275,7 @@ clean:
277275
rm -rf $(DOC_OUTPUT_DIR) ${GENERATED} dpl-docs/.dub
278276
rm -rf auto dlangspec-consolidated.d $(addprefix dlangspec,.aux .d .dvi .fdb_latexmk .fls .log .out .pdf .tex .txt .verbatim.txt)
279277
rm -f docs.json docs-prerelease.json dpl-docs/dpl-docs
280-
@echo You should issue manually: rm -rf ${DMD_STABLE_DIR} ${DRUNTIME_STABLE_DIR} ${PHOBOS_STABLE_DIR} ${STABLE_DMD_ROOT} ${DUB_DIR}
278+
@echo You should issue manually: rm -rf ${DMD_STABLE_DIR} ${DRUNTIME_STABLE_DIR} ${PHOBOS_STABLE_DIR} ${STABLE_DMD_ROOT}
281279

282280
RSYNC_FILTER=-f 'P /Usage' -f 'P /.dpl_rewrite*' -f 'P /install.sh*'
283281

@@ -409,9 +407,6 @@ $G/twid_latest.ddoc:
409407
../%-${LATEST} :
410408
git clone -b v${LATEST} --depth=1 ${GIT_HOME}/$(notdir $*) $@
411409

412-
../%-${DUB_VER} :
413-
git clone --depth=1 -b v${DUB_VER} ${GIT_HOME}/$(notdir $*) $@
414-
415410
${DMD_DIR} ${DRUNTIME_DIR} ${PHOBOS_DIR} ${TOOLS_DIR} ${INSTALLER_DIR}:
416411
git clone --depth=1 ${GIT_HOME}/$(notdir $(@F)) $@
417412

@@ -579,13 +574,13 @@ dpl-docs: ${DUB} ${STABLE_DMD}
579574
DFLAGS="$(DPL_DOCS_DFLAGS)" ${DUB} build --root=${DPL_DOCS_PATH} \
580575
--compiler=${STABLE_DMD}
581576

582-
${STABLE_DMD}:
577+
${STABLE_DMD_ROOT}/.downloaded:
583578
mkdir -p ${STABLE_DMD_ROOT}
584-
TMPFILE=$$(mktemp deleteme.XXXXXXXX) && curl -fsSL ${STABLE_DMD_URL} > ${TMP}/$${TMPFILE}.zip && \
585-
unzip -qd ${STABLE_DMD_ROOT} ${TMP}/$${TMPFILE}.zip && rm ${TMP}/$${TMPFILE}.zip
579+
TMPFILE=$$(mktemp ${TMP}/dmd-download-deleteme.XXXXXXXX) && curl -fsSL ${STABLE_DMD_URL} > $${TMPFILE}.zip && \
580+
unzip -qd ${STABLE_DMD_ROOT} $${TMPFILE}.zip && rm $${TMPFILE}.zip
581+
touch $@
586582

587-
${DUB}: | ${DUB_DIR} ${STABLE_DMD}
588-
cd ${DUB_DIR} && DMD="$(abspath ${STABLE_DMD})" ./build.sh
583+
${STABLE_DMD} ${STABLE_RDMD} ${DUB}: ${STABLE_DMD_ROOT}/.downloaded
589584

590585
################################################################################
591586
# chm help files

0 commit comments

Comments
 (0)