Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix building issues of development branch, under macOS #971

Merged
merged 2 commits into from
Feb 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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://github.com/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
Loading