File tree 7 files changed +22
-32
lines changed
7 files changed +22
-32
lines changed Original file line number Diff line number Diff line change 1
- 28
1
+ 29
Original file line number Diff line number Diff line change 11
11
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
12
# See the License for the specific language governing permissions and
13
13
# limitations under the License.
14
- FROM thyrlian/android-sdk:4.0 as android
14
+ FROM thyrlian/android-sdk:4.0 AS android
15
15
16
16
FROM ubuntu:22.04
17
17
18
- ENV DEBIAN_FRONTEND noninteractive
19
-
20
18
# Android
21
19
COPY --from=android /opt/android-sdk /opt/android-sdk
22
20
23
- ADD scripts/docker_install.sh /tmp/
24
- RUN /tmp/docker_install.sh
21
+ RUN --mount=target=/mnt,source=scripts DEBIAN_FRONTEND=noninteractive /mnt/docker_install.sh
25
22
26
- ENV GOPATH /opt/go
27
- ENV GOROOT /opt/go_dist /go
28
- ENV PATH $GOROOT /bin:$GOPATH /bin:$PATH
23
+ # In this path executables will be installed during docker build
24
+ ARG SYS_GOPATH= /opt/go
25
+ ENV PATH=${SYS_GOPATH} /bin:/usr/local/go /bin:$PATH
29
26
30
- ADD Makefile /tmp/
31
- RUN make -C /tmp/ envinit
27
+ RUN --mount=target=/mnt/Makefile,source=Makefile GOPATH=${SYS_GOPATH} make -C /mnt envinit
32
28
33
- ENV PATH /opt/qt6/6.8.2/gcc_64/bin:/opt/qt6/6.8.2/gcc_64/libexec:$PATH
29
+ ENV PATH= /opt/qt6/6.8.2/gcc_64/bin:/opt/qt6/6.8.2/gcc_64/libexec:$PATH
34
30
35
31
CMD ["bash" ]
Original file line number Diff line number Diff line change 14
14
15
15
SHELL := /bin/bash
16
16
WEBROOT := frontends/web
17
- GOPATH ?= $(HOME ) /go
18
- PATH := $(PATH ) :$(GOPATH ) /bin
19
17
20
18
catch :
21
19
@echo " Choose a make target."
22
20
envinit :
23
21
# Keep golangci-lint version in sync with what's in .github/workflows/ci.yml.
24
- curl -sfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(GOPATH ) /bin v1.61.0
22
+ curl -sfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(shell go env GOPATH) /bin v1.61.0
25
23
go install github.com/vektra/mockery/
[email protected]
26
24
go install github.com/matryer/
[email protected]
27
25
go install golang.org/x/tools/cmd/goimports@latest
@@ -84,8 +82,11 @@ clean:
84
82
cd frontends/qt && $(MAKE ) clean
85
83
cd frontends/android && $(MAKE ) clean
86
84
cd backend/mobileserver && $(MAKE ) clean
85
+
86
+ # The container image only supports amd64 bercause of "thyrlian/android-sdk"
87
+ # that downloads amd64 specific binaries
87
88
dockerinit :
88
- ./scripts/container.sh build --pull --force-rm -t shiftcrypto/bitbox-wallet-app .
89
+ ./scripts/container.sh build --platform linux/amd64 --pull -t shiftcrypto/bitbox-wallet-app: $( shell cat .containerversion) .
89
90
dockerdev :
90
91
./scripts/dockerdev.sh
91
92
locize-push :
Original file line number Diff line number Diff line change 1
1
export ANDROID_SDK_ROOT := /opt/android-sdk
2
2
export ANDROID_NDK_HOME := /opt/android-sdk/ndk/21.2.6472646
3
- # gomodcache location for gomobile build pkgs. Set to tmp folder, because writing access is needed.
4
- export GOMODCACHE_ROOT := /tmp/gomodcache/pkg/mod
Original file line number Diff line number Diff line change 1
1
include ../../android-env.mk.inc
2
2
3
- # GOMODCACHE to /tmp directory, because gomobile needs to write pkgs.
4
- # Also set -glflags to fix the vendor issue with gomobile, see: https://github.com/golang/go/issues/67927#issuecomment-2241523694
3
+ # Set -glflags to fix the vendor issue with gomobile, see: https://github.com/golang/go/issues/67927#issuecomment-2241523694
5
4
build-android :
6
- GOMODCACHE= ${GOMODCACHE_ROOT} ANDROID_HOME=${ANDROID_SDK_ROOT} gomobile bind -x -a -glflags=" -mod=readonly" -ldflags=" -s -w" -target android .
5
+ ANDROID_HOME=${ANDROID_SDK_ROOT} gomobile bind -x -a -glflags=" -mod=readonly" -ldflags=" -s -w" -target android .
7
6
build-ios :
8
- GOMODCACHE= ${GOMODCACHE_ROOT} gomobile bind -x -a -glflags=" -mod=readonly" -ldflags=" -s -w" -target ios,iossimulator .
7
+ gomobile bind -x -a -glflags=" -mod=readonly" -ldflags=" -s -w" -target ios,iossimulator .
9
8
clean :
10
9
rm -f mobileserver.aar mobileserver-sources.jar
Original file line number Diff line number Diff line change 13
13
# See the License for the specific language governing permissions and
14
14
# limitations under the License.
15
15
16
-
17
16
apt-get update
18
17
apt-get install -y --no-install-recommends curl ca-certificates
19
18
@@ -83,8 +82,7 @@ aqt install-qt linux desktop 6.8.2 -m qtpositioning qtserialport qtwebchannel qt
83
82
npm install -g npm@10
84
83
npm install -g locize-cli
85
84
86
- mkdir -p /opt/go_dist
87
- curl https://dl.google.com/go/go1.22.5.linux-amd64.tar.gz | tar -xz -C /opt/go_dist
85
+ curl https://dl.google.com/go/go1.22.5.linux-amd64.tar.gz | tar -xz -C /usr/local
88
86
89
87
# fuse is needed to run the linuxdeployqt appimage.
90
88
apt-get install -y --no-install-recommends fuse
Original file line number Diff line number Diff line change @@ -12,7 +12,7 @@ if [ "$OS_NAME" == "linux" ]; then
12
12
# Which docker image to use to run the CI. Defaults to Docker Hub.
13
13
# Overwrite with CI_IMAGE=docker/image/path environment variable.
14
14
# Keep this in sync with .github/workflows/ci.yml.
15
- : " ${CI_IMAGE:= shiftcrypto/ bitbox-wallet-app: 26 } "
15
+ : " ${CI_IMAGE:= shiftcrypto/ bitbox-wallet-app: $(cat .containerversion) } "
16
16
# Time image pull to compare in the future.
17
17
time docker pull " $CI_IMAGE "
18
18
@@ -32,14 +32,12 @@ if [ "$OS_NAME" == "osx" ]; then
32
32
# GitHub CI installs Go and Qt directly in the macos action, before executing
33
33
# this script.
34
34
go version
35
- export GOPATH=~ /go
36
- export PATH=" $PATH :~/go/bin"
37
- mkdir -p $GOPATH /$( dirname $GO_SRC_DIR )
35
+ export PATH=" ~/go/bin:$PATH "
36
+ mkdir -p $( go env GOPATH) /$( dirname $GO_SRC_DIR )
38
37
# GitHub checkout action (git clone) seem to require current work dir
39
38
# to be the root of the repo during its clean up phase. So, we push it
40
39
# here and pop in the end.
41
- pushd ../ && cp -a bitbox-wallet-app $GOPATH /$( dirname $GO_SRC_DIR )
42
- cd $GOPATH /$GO_SRC_DIR
43
- make " $WHAT "
40
+ pushd ../ && cp -a bitbox-wallet-app $( go env GOPATH/) $( dirname $GO_SRC_DIR )
41
+ make -C $( go env GOPATH) /$GO_SRC_DIR " $WHAT "
44
42
popd
45
43
fi
You can’t perform that action at this time.
0 commit comments