Skip to content

Commit 7f3215f

Browse files
committed
guix: Prefetch boost source file from working mirror
1 parent 8cb6ab0 commit 7f3215f

2 files changed

Lines changed: 33 additions & 0 deletions

File tree

contrib/guix/guix-build

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -338,6 +338,8 @@ output directory.
338338
EOF
339339
}
340340

341+
guix-prefetch '1h00qp4z5k6lfz310xjwsmqs8fwxi6ngas51169cafz4h9fmc68y' 'https://archives.boost.io/release/1.80.0/source/boost_1_80_0.tar.bz2'
342+
341343
# Deterministically build Bitcoin Core
342344
# shellcheck disable=SC2153
343345
for host in $HOSTS; do

contrib/guix/libexec/prelude.bash

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,37 @@ time-machine() {
6060
-- "$@"
6161
}
6262

63+
################
64+
guix_prefetch_temp=
65+
trap 'test -n "$guix_prefetch_temp" && rm -rf -- "$guix_prefetch_temp"' EXIT
66+
67+
guix-prefetch() {
68+
local hash="$1" uri="$2"
69+
test -n "$guix_prefetch_temp" || guix_prefetch_temp="$(mktemp)"
70+
cat > "$guix_prefetch_temp" << EOF
71+
(use-modules (guix packages)
72+
(guix download)
73+
(guix build-system trivial)
74+
(guix licenses))
75+
76+
(define-public dummy
77+
(package
78+
(name "dummy")
79+
(version "0")
80+
(source (origin
81+
(method url-fetch)
82+
(uri "${uri}")
83+
(sha256 (base32 "${hash}"))))
84+
(build-system trivial-build-system)
85+
(synopsis "")
86+
(description "")
87+
(home-page "")
88+
(license gpl3+)))
89+
90+
dummy
91+
EOF
92+
guix build -f "$guix_prefetch_temp" --source
93+
}
6394

6495
################
6596
# Set common variables

0 commit comments

Comments
 (0)