diff --git a/README.md b/README.md index dbdaff5a9..00ee21f42 100644 --- a/README.md +++ b/README.md @@ -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 diff --git a/build_mac.sh b/build_mac.sh old mode 100644 new mode 100755 index 38b7e7af2..cac27e27e --- a/build_mac.sh +++ b/build_mac.sh @@ -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