Skip to content

Commit

Permalink
Merge pull request #971 from jinjiaodawang/development
Browse files Browse the repository at this point in the history
Fix building issues of development branch, under macOS
  • Loading branch information
ahrm authored Feb 12, 2024
2 parents dfb661f + bac3f9e commit 20950cf
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 3 deletions.
22 changes: 19 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -151,13 +151,29 @@ build_windows.bat
```

### Mac
1. Install Xcode and Qt 5.
2. Clone the repository and build:
1. Uninstall previous Qt6 installed by Homebrew
2. Install Xcode.
3. Install Qt6.
```
pip install aqtinstall
cd /path/to/qt
aqt install-qt mac desktop 6.6.1 clang_64 -m all
export Qt6_DIR=/path/to/qt/6.6.1/macos/
export QT_PLUGIN_PATH=/path/to/qt/6.6.1/macos/plugins
export PKG_CONFIG_PATH=/path/to/qt/6.6.1/macos/lib/pkgconfig
export QML2_IMPORT_PATH=/path/to/qt/6.6.1/macos/qml
export PATH="/path/to/qt/6.6.1/macos/bin:$PATH"
```
4. Clone the repository, build and install:
```
git clone --recursive https:/ahrm/sioyek
cd sioyek
chmod +x build_mac.sh
./build_mac.sh
setopt PIPE_FAIL PRINT_EXIT_VALUE ERR_RETURN SOURCE_TRACE XTRACE
MAKE_PARALLEL=8 ./build_mac.sh
mv build/sioyek.app /Applications/
sudo codesign --force --sign - --deep /Applications/sioyek.app
```

## Donation
Expand Down
10 changes: 10 additions & 0 deletions build_mac.sh
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -34,5 +34,15 @@ cp pdf_viewer/keys.config build/sioyek.app/Contents/MacOS/keys.config
cp pdf_viewer/keys_user.config build/sioyek.app/Contents/MacOS/keys_user.config
cp tutorial.pdf build/sioyek.app/Contents/MacOS/tutorial.pdf

# Capture the current PATH
CURRENT_PATH=$(echo $PATH)

# Define the path to the Info.plist file inside the app bundle
INFO_PLIST="build/sioyek.app/Contents/Info.plist"

# Add LSEnvironment key with PATH to Info.plist
/usr/libexec/PlistBuddy -c "Add :LSEnvironment dict" "$INFO_PLIST" || echo "LSEnvironment already exists"
/usr/libexec/PlistBuddy -c "Add :LSEnvironment:PATH string $CURRENT_PATH" "$INFO_PLIST" || /usr/libexec/PlistBuddy -c "Set :LSEnvironment:PATH $CURRENT_PATH" "$INFO_PLIST"

macdeployqt build/sioyek.app -dmg
zip -r sioyek-release-mac.zip build/sioyek.dmg

0 comments on commit 20950cf

Please sign in to comment.