forked from wizardsardine/liana
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-build.sh
executable file
·52 lines (44 loc) · 1.99 KB
/
docker-build.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
#!/usr/bin/env sh
set -ex
TARGET_DIR="${TARGET_DIR:-"$PWD/deter_build_target"}"
XCODE_PATH="${XCODE_PATH:-"$PWD/Xcode_12.2.xip"}"
XCODE_FILENAME="$(basename $XCODE_PATH)"
XCODE_SHASUM="28d352f8c14a43d9b8a082ac6338dc173cb153f964c6e8fb6ba389e5be528bd0"
# Build (only) the Liana GUI on Windows.
docker build . -t liana_cross_win -f contrib/reproducible/docker/windows.Dockerfile
docker run --rm -ti \
-v "$TARGET_DIR/gui":/liana/target \
-v "$PWD/contrib/reproducible/docker":/liana/docker \
-v "$PWD/gui/Cargo.toml":/liana/Cargo.toml \
-v "$PWD/gui/Cargo.lock":/liana/Cargo.lock \
-v "$PWD/gui/src":/liana/src \
-v "$PWD/gui/ui/Cargo.toml":/liana/ui/Cargo.toml \
-v "$PWD/gui/ui/Cargo.lock":/liana/ui/Cargo.lock \
-v "$PWD/gui/ui/src":/liana/ui/src \
-v "$PWD/gui/ui/static":/liana/ui/static \
liana_cross_win
# Sanity check the given MacOS SDK is the expected one.
if ! $(echo "$XCODE_SHASUM $XCODE_PATH" | sha256sum -c --status); then
echo "No or invalid Xcode SDK found. Need an Xcode_X.Y.xip archive whose hash is $XCODE_SHASUM. You can configure the path using \$XCODE_PATH.";
exit 1;
fi
# Build both the Liana daemon and GUI on MacOS.
docker build . -t liana_cross_mac -f contrib/reproducible/docker/macos.Dockerfile
docker run -ti \
-v "$TARGET_DIR":/liana/target \
-v "$TARGET_DIR/gui":/liana/gui/target \
-v "$PWD/contrib/reproducible/docker":/liana/docker \
-v "$PWD/Cargo.toml":/liana/Cargo.toml \
-v "$PWD/Cargo.lock":/liana/Cargo.lock \
-v "$PWD/src":/liana/src \
-v "$PWD/gui/Cargo.toml":/liana/gui/Cargo.toml \
-v "$PWD/gui/Cargo.lock":/liana/gui/Cargo.lock \
-v "$PWD/gui/src":/liana/gui/src \
-v "$PWD/gui/ui/Cargo.toml":/liana/gui/ui/Cargo.toml \
-v "$PWD/gui/ui/Cargo.lock":/liana/gui/ui/Cargo.lock \
-v "$PWD/gui/ui/src":/liana/gui/ui/src \
-v "$PWD/gui/ui/static":/liana/gui/ui/static \
-v "$XCODE_PATH":"/liana/$XCODE_FILENAME" \
-e XCODE_PATH="/liana/$XCODE_FILENAME" \
liana_cross_mac
set +ex