Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
benma committed Oct 30, 2024
1 parent 952b20d commit 661564a
Show file tree
Hide file tree
Showing 6 changed files with 27 additions and 21 deletions.
9 changes: 9 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,15 @@ jobs:
uses: actions/setup-node@v4
with:
node-version: '20.x'
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.x'
- name: Install Qt
run: |
pip install aqtinstall
aqt list-qt mac desktop --arch 6.2.4
aqt install-qt mac desktop 6.2.4 --modules qtpositioning qtserialport qtwebchannel qtwebengine --outputdir ~/Qt
- name: Build macOS app
run: >
./scripts/github-ci.sh qt-osx;
Expand Down
5 changes: 3 additions & 2 deletions docs/BUILD.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,11 @@ Build artifacts:

## MacOS

Make sure you have `qt@5/bin`, `[email protected]/bin` and `go/bin` in your PATH, i.e. add to your `.zshrc`
Make sure you have `qt@6/bin`, `qt@6/libexec`, `[email protected]/bin` and `go/bin` in your PATH, i.e. add to your `.zshrc`

```bash
export PATH="$PATH:/usr/local/opt/qt@5/bin"
export PATH="$PATH:/usr/local/opt/qt@6/bin"
export PATH="$PATH:/usr/local/opt/qt@6/libexec"
export PATH="$PATH:/usr/local/opt/[email protected]/bin"
export PATH="$PATH:$HOME/go/bin"
```
Expand Down
2 changes: 2 additions & 0 deletions frontends/qt/BitBox.pro
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,8 @@ SOURCES += \
HEADERS += libserver.h webclass.h filedialog.h

unix:macx {
CONFIG += sdk_no_version_check
QMAKE_APPLE_DEVICE_ARCHS = x86_64 arm64
# Those frameworks are needed for Go's http/net packages.
# Waiting for https://github.com/golang/go/issues/11258 to be able to automatically capture link flags.
LIBS += -framework CoreFoundation -framework Security
Expand Down
8 changes: 5 additions & 3 deletions frontends/qt/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -17,16 +17,15 @@ include ../../env.mk.inc
base:
mkdir build
./genassets.sh
qmake -set MACOS_MIN_VERSION $(MACOS_MIN_VERSION)
qmake -o build/Makefile
cd build && $(MAKE)
clean:
-rm -rf build
cd server && $(MAKE) clean
linux:
$(MAKE) clean
cd server && $(MAKE) linux
$(MAKE) base
qmake -o build/Makefile
cd build && $(MAKE)
mkdir build/linux-tmp build/linux
mv build/BitBox build/linux-tmp
cp build/assets.rcc build/linux-tmp/
Expand All @@ -47,6 +46,9 @@ osx:
$(MAKE) clean
cd server && $(MAKE) macosx
$(MAKE) base
# See https://stackoverflow.com/questions/77136519/qmake-failing-with-sdk-14-ventura-13-5-2
qmake -early QMAKE_DEFAULT_LIBDIRS=$(shell xcrun -show-sdk-path)/usr/lib -o build/Makefile
cd build && $(MAKE)
mkdir build/osx
mv build/BitBox.app build/osx/
cp resources/MacOS/Info.plist build/osx/BitBox.app/Contents/
Expand Down
8 changes: 4 additions & 4 deletions scripts/github-ci.sh
Original file line number Diff line number Diff line change
Expand Up @@ -32,12 +32,12 @@ if [ "$OS_NAME" == "osx" ]; then
# GitHub CI installs Go directly in the macos action, before executing
# this script.
go version
brew install qt@5
export PATH="/usr/local/opt/qt@5/bin:$PATH"
export LDFLAGS="-L/usr/local/opt/qt@5/lib"
export CPPFLAGS="-I/usr/local/opt/qt@5/include"
export PATH="~/Qt/6.2.4/macos/bin:~/Qt/6.2.4/macos/libexec:$PATH"
export LDFLAGS="-L~/Qt/6.2.4/macos/lib"
export CPPFLAGS="-I~/Qt/6.2.4/macos/include"
export GOPATH=~/go
export PATH=$PATH:~/go/bin
echo "qmake -version" && qmake -version
mkdir -p $GOPATH/$(dirname $GO_SRC_DIR)
# GitHub checkout action (git clone) seem to require current work dir
# to be the root of the repo during its clean up phase. So, we push it
Expand Down
16 changes: 4 additions & 12 deletions scripts/osx-brew.sh
Original file line number Diff line number Diff line change
@@ -1,14 +1,6 @@
#!/bin/bash

if [ $(arch) = "arm64" ]; then
# recent M-based apple machines have an arm64 arch, but we need to install x86_64 deps
arch -x86_64 /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)"
/usr/local/Homebrew/bin/brew install [email protected]
/usr/local/Homebrew/bin/brew install qt@5
/usr/local/Homebrew/bin/brew install create-dmg
else
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)"
brew install [email protected]
brew install qt@5
brew install create-dmg
fi
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)"
brew install [email protected]
brew install qt@6
brew install create-dmg

0 comments on commit 661564a

Please sign in to comment.