aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCarl Dong <contact@carldong.me>2020-12-21 15:26:23 -0500
committerCarl Dong <contact@carldong.me>2021-01-08 11:40:01 -0500
commit0b7cd07bb56baa112ffa596fb23a905871031a36 (patch)
tree26931ccf239718353dcb17cdc8ab11ad05469e19
parentd27ff8b86aa66acec63b5713912bd4ad9470e66f (diff)
guix: Move OUTDIR determination+creation to guix-build.sh
-rwxr-xr-xcontrib/guix/guix-build.sh6
-rw-r--r--contrib/guix/libexec/build.sh4
2 files changed, 6 insertions, 4 deletions
diff --git a/contrib/guix/guix-build.sh b/contrib/guix/guix-build.sh
index 9ce0c7e18c..64c1e35e03 100755
--- a/contrib/guix/guix-build.sh
+++ b/contrib/guix/guix-build.sh
@@ -91,6 +91,10 @@ time-machine() {
-- "$@"
}
+# Make sure an output directory exists for our builds
+OUTDIR="${OUTDIR:-${PWD}/output}"
+[ -e "$OUTDIR" ] || mkdir -p "$OUTDIR"
+
#########
# Build #
#########
@@ -189,6 +193,7 @@ for host in ${HOSTS=x86_64-linux-gnu arm-linux-gnueabihf aarch64-linux-gnu riscv
--pure \
--no-cwd \
--share="$PWD"=/bitcoin \
+ --share="$OUTDIR"=/outdir \
--expose="$(git rev-parse --git-common-dir)" \
${SOURCES_PATH:+--share="$SOURCES_PATH"} \
--max-jobs="$MAX_JOBS" \
@@ -199,6 +204,7 @@ for host in ${HOSTS=x86_64-linux-gnu arm-linux-gnueabihf aarch64-linux-gnu riscv
SOURCE_DATE_EPOCH="${SOURCE_DATE_EPOCH:?unable to determine value}" \
${V:+V=1} \
${SOURCES_PATH:+SOURCES_PATH="$SOURCES_PATH"} \
+ OUTDIR=/outdir \
bash -c "cd /bitcoin && bash contrib/guix/libexec/build.sh"
)
diff --git a/contrib/guix/libexec/build.sh b/contrib/guix/libexec/build.sh
index d658c4f6a6..50440c939d 100644
--- a/contrib/guix/libexec/build.sh
+++ b/contrib/guix/libexec/build.sh
@@ -23,10 +23,6 @@ echo "At most ${MAX_JOBS:?not set} jobs will run at once..."
# $HOSTs after successfully building.
BASEPREFIX="${PWD}/depends"
-# Setup an output directory for our build
-OUTDIR="${OUTDIR:-${PWD}/output}"
-[ -e "$OUTDIR" ] || mkdir -p "$OUTDIR"
-
# Setup the directory where our Bitcoin Core build for HOST will occur
DISTSRC="${DISTSRC:-${PWD}/distsrc-${HOST}}"
if [ -e "$DISTSRC" ]; then