Calligra/Building Calligra on OSX
< Calligra
Install Dependencies
First you need to install Calligra dependencies, you can do it manually, through Macports or Homebrew, here shows how to do it in Homebrew.
- Install Homebrew following this guide.
- Setup
adymo/homebrew-kde
tap following this guide. - Install all the dependencies to the calligra formula.
- Install
ninja
through Homebrew, which is a build tool faster than GNU make.
Setup Calligra Source Code
- Clone Calligra git repo.
git clone git://anongit.kde.org/calligra
- Checkout the branch you want to build, master branch usually works best on OSX
- Make a directory for build and a directory for install, here we call them ${BUILD_DIR} and ${INSTALL_DIR} as references.
Build & Install
- Go to ${BUILD_DIR}, run cmake, ${PATH_TO_SOURCE_DIR} is the relative path from ${BUILD_DIR} to the source code directory:
cmake -DCMAKE_INSTALL_PREFIX=${INSTALL_DIR} -DKDE_DEFAULT_HOME=${CMAKE_INSTALL_PREFIX}/.kde -DCMAKE_PREFIX_PATH=/usr/local/opt/gettext:/usr/local/opt/sqlite/:/usr/local/kde4 -DBUILD_doc=FALSE -DBUNDLE_INSTALL_DIR=${CMAKE_INSTALL_PREFIX}/bin -DCMAKE_BUILD_TYPE:STRING=RelWithDebInfo -DPRODUCTSET=osx ${PATH_TO_SOURCE_DIR} -GNinja -Wno-dev -DCMAKE_CXX_FLAGS=-w
- Build and install through command
ninja install
- Setup environment variables similar to the homebrew-kde guide or put them in a script so you can fire up a debugger easily
Run & Debug
- If you set environment variables in ~/.profile and ran kbuildsycoca4 and update-mime-database, you can run Calligra application by .app container under ${INSTALL_DIR}/bin
- Here is a example script which included environment variable setup and debugger support [WIP]
#! /bin/bash INSTALL_DIR=/Users/yue/Dev/calligra/install BREW_DIR=/usr/local BREW_KDE_DIR=/usr/local/kde4 export XDG_DATA_HOME=${INSTALL_DIR}/share:$XDG_DATA_HOME export KDEDIRS=${INSTALL_DIR}/install:$KDEDIRS export DYLD_LIBRARY_PATH=${INSTALL_DIR}/lib:$DYLD_LIBRARY_PATH export PATH=${INSTALL_DIR}/bin:$PATH kbuildsycoca4 --noincremental update-mime-database ${BREW_DIR}/share/mime update-mime-database ${BREW_KDE_DIR}/share/mime update-mime-database ${INSTALL_DIR}/share/mime /Applications/KDE4/${1}.app/Contents/MacOS/$1