- Install homebrew from https://brew.sh/ (follow the instructions there)
- tap the https://invent.kde.org/packaging/homebrew-kde/ repo,
brew tap kde-mac/kde https://invent.kde.org/packaging/homebrew-kde.git brew edit okular, workaround now is to comment out or delete the linedepends_on "chmlib"(won't compile on macos arm64 for now as of 2021-08-18), then save (if using vim you need to first pressito insert/type, when saving then<esc>then:wqthen<enter>.brew install okular, wait for stuff to compile and/or install- It may ask for keychain credentials (to sign the binaries? because of mac arm64 security policy https://eclecticlight.co/2021/01/26/when-you-dont-have-permission-to-run-an-app-on-an-m1-mac/)
$(brew --repo kde-mac/kde)/tools/do-caveats.sh- Now okular is in your
$HOME/Applications/KDEfolder, and will show up in Launchpad! You can view pdf, djvu, etc documents.
Edit: as of 2025 there is now a precompiled nightly binary available for download at https://okular.kde.org/download/, or at https://cdn.kde.org/ci-builds/graphics/okular/master/macos-arm64/. It is unsigned so use sudo xattr -rd com.apple.quarantine /Applications/okular.app to bypass quarantine after install.
Hi David. The Okular Nightly Build doesn't support the print option for me.
I tried to build from the source of git to solve the problem of print / print-preview. I managed to change the
CMaleList.txtto detect theLibSpectrepackage since this is the reason why we cannot use ps files. After./configure, make, sudo make install, I changed some of the files and environment variables like this:source ~/CraftRoot/craft/craftenv.shinstall_name_tool -change \ "/usr/local/lib/libspectre.1.dylib" \ "/Users/sakuraim/CraftRoot/lib/libspectre.1.dylib" \ /Users/sakuraim/myokular/lib/okular/generators/okularGenerator_ghostview.sosource /Users/sakuraim/okular/build/prefix.shexport DYLD_LIBRARY_PATH="/Users/sakuraim/CraftRoot/lib:$DYLD_LIBRARY_PATH"export OKULAR_GHOSTVIEW_DPI=1200export QT_PLUGIN_PATH="/Users/sakuraim/CraftRoot/plugins"Note that I changed CMakeList.txt as follows
# Apple-specific configurationset(APPLE_SUPPRESS_X11_WARNING ON)find_path(LIBSPECTRE_INCLUDE_DIR spectre/spectre.h/opt/homebrew/include/usr/local/include)find_library(LIBSPECTRE_LIBRARY spectre/opt/homebrew/lib/usr/local/lib)if(LIBSPECTRE_INCLUDE_DIR AND LIBSPECTRE_LIBRARY)set(LibSpectre_FOUND TRUE CACHE BOOL "Found LibSpectre" FORCE)set(LibSpectre_INCLUDE_DIRS ${LIBSPECTRE_INCLUDE_DIR} CACHE STRING "LibSpectre include dirs" FORCE)set(LibSpectre_LIBRARIES ${LIBSPECTRE_LIBRARY} CACHE STRING "LibSpectre libraries" FORCE)message(STATUS "Manually found LibSpectre: ${LIBSPECTRE_LIBRARY}")endif()The
Kf6/Qt6environment was introduced via the Craft packager. The build option wascmake -DCMAKE_INSTALL_PREFIX=/Users/sakuraim/myokular \-DCMAKE_PREFIX_PATH="/Users/sakuraim/myokular;/usr/local/lib;/usr/local;/Users/sakuraim/CraftRoot" \-DCMAKE_OSX_ARCHITECTURES="arm64" \-DOKULAR_UI=desktop \-DFORCE_NOT_REQUIRED_DEPENDENCIES="KExiv2Qt6;EPub;Discount" -Wno-dev ..Now that I can open PS files and do print-preview. However, the preview / PS file size is very small. In addition, I still cannot print files. It crashed like this:
bus error ./okularI tried to solve this problem, but so far it is not possible.