Jump to content

Guidelines and HOWTOs/Build from source/Mac: Difference between revisions

From KDE Community Wiki
Tfry (talk | contribs)
remove some dupes
Tfry (talk | contribs)
* Add instructions for installing prerequisites using Macports * Merge some of the code snippets, so they are easier to copy and paste
Line 1: Line 1:
== Install required tools and libraries ==
Required tools and libraries can be installed using ''either'' Homebrew or Macports, as described below.


In ''both'' cases, you will need to download and install [https://developer.apple.com/xcode/ XCode], first.
=== Homebrew (plus official Qt installer) ===
* Install Qt (use the official Qt installer, recommended version Qt >= 5.6)
* Install Qt (use the official Qt installer, recommended version Qt >= 5.6)
* Install homebrew and get some basic dependencies (http://brew.sh/)
* Install homebrew and get some basic dependencies (http://brew.sh/)
  /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
  /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
  brew install cmake wget coreutils p7zip gettext ninja python3 bison boost shared-mime-info
  brew install cmake wget coreutils p7zip gettext ninja python3 bison boost shared-mime-info
* Optional: You might need some extra environment variables
export CMAKE_LIBRARY_PATH=/usr/local/Cellar/gettext/0.19.8.1/lib
export CMAKE_INCLUDE_PATH=/usr/local/Cellar/gettext/0.19.8.1/include
export PATH=/usr/local/Cellar/bison/3.0.4/bin:$PATH
 
# Setup environment (path must contain your Qt install, here 5.7 default location and brew's gettext)
export PATH=/Users/cullmann/Qt5.7.0/5.7/clang_64/bin:/usr/local/Cellar/gettext/0.19.7/bin:$PATH
=== Macports (including Qt) ===
* Install Macports
* Install basic dependencies and tools:
sudo port install git qt56 cmake wget coreutils p7zip gettext ninja python36 bison boost shared-mime-info
* Add GNU coreutils to your path:
export PATH=/opt/local/libexec/gnubin/:$PATH


* Prepare some build directory in your home directory, here we assume:
== Install Craft ==
# Prepare some build directory in your home directory, here we assume:
  mkdir ~/kf
  mkdir ~/kf
 
# Switch to this build dir
* Switch to this build dir
  cd ~/kf
  cd ~/kf
 
# Get Craft
* Get Craft
  git clone git://anongit.kde.org/craft.git
  git clone git://anongit.kde.org/craft.git
 
# Copy Mac OS X config template to right location, should be OK to use out of the box
* Copy Mac OS X config template to right location, should be OK to use out of the box
  mkdir etc
  mkdir etc
  cp craft/kdesettings.mac etc/kdesettings.ini
  cp craft/kdesettings.mac etc/kdesettings.ini


* Optional: You might need some extra environment variables
== Using craft ==
 
* Every time you want to use craft in a new shell, you need to set up the craft environment, first:
  export CMAKE_LIBRARY_PATH=/usr/local/Cellar/gettext/0.19.8.1/lib
  export CMAKE_INCLUDE_PATH=/usr/local/Cellar/gettext/0.19.8.1/include
 
  export PATH=/usr/local/Cellar/bison/3.0.4/bin:$PATH
 
* Setup environment (path must contain your Qt install, here 5.7 default location and brew's gettext)
export PATH=/Users/cullmann/Qt5.7.0/5.7/clang_64/bin:/usr/local/Cellar/gettext/0.19.7/bin:$PATH
  . craft/kdeenv.sh
  . craft/kdeenv.sh


Line 33: Line 43:
  craft kate
  craft kate


== Deploying applications ==
* To create a app bundle (+ dmg file), you need to have the breeze-icons around:
* To create a app bundle (+ dmg file), you need to have the breeze-icons around:
  craft breeze-icons
  craft breeze-icons


* To do deploy all things, unfortunately at the moment you need a patched macdeployqt. Example scripty for kate can be found on [https://quickgit.kde.org/?p=kate.git&a=blob&f=mac%2Femerge-deploy.sh kate.git/mac/emerge-deploy.sh]
* To do deploy all things, unfortunately at the moment you need a patched macdeployqt. Example scripty for kate can be found on [https://quickgit.kde.org/?p=kate.git&a=blob&f=mac%2Femerge-deploy.sh kate.git/mac/emerge-deploy.sh]
** If you installed qt using Macports, your copy of macdeployqt ''should'' be patched, already. It will not be in your system path by default, however. Find it at /opt/local/libexec/qt5 .

Revision as of 11:16, 31 May 2017

Install required tools and libraries

Required tools and libraries can be installed using either Homebrew or Macports, as described below.

In both cases, you will need to download and install XCode, first.

Homebrew (plus official Qt installer)

  • Install Qt (use the official Qt installer, recommended version Qt >= 5.6)
  • Install homebrew and get some basic dependencies (http://brew.sh/)
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
brew install cmake wget coreutils p7zip gettext ninja python3 bison boost shared-mime-info
  • Optional: You might need some extra environment variables
export CMAKE_LIBRARY_PATH=/usr/local/Cellar/gettext/0.19.8.1/lib
export CMAKE_INCLUDE_PATH=/usr/local/Cellar/gettext/0.19.8.1/include
export PATH=/usr/local/Cellar/bison/3.0.4/bin:$PATH
 
# Setup environment (path must contain your Qt install, here 5.7 default location and brew's gettext)
export PATH=/Users/cullmann/Qt5.7.0/5.7/clang_64/bin:/usr/local/Cellar/gettext/0.19.7/bin:$PATH

Macports (including Qt)

  • Install Macports
  • Install basic dependencies and tools:
sudo port install git qt56 cmake wget coreutils p7zip gettext ninja python36 bison boost shared-mime-info
  • Add GNU coreutils to your path:
export PATH=/opt/local/libexec/gnubin/:$PATH

Install Craft

# Prepare some build directory in your home directory, here we assume:
mkdir ~/kf
# Switch to this build dir
cd ~/kf
# Get Craft
git clone git://anongit.kde.org/craft.git
# Copy Mac OS X config template to right location, should be OK to use out of the box
mkdir etc
cp craft/kdesettings.mac etc/kdesettings.ini

Using craft

  • Every time you want to use craft in a new shell, you need to set up the craft environment, first:
. craft/kdeenv.sh
  • In this shell, now craft is usable, e.g. to build Kate with all dependencies:
craft kate

Deploying applications

  • To create a app bundle (+ dmg file), you need to have the breeze-icons around:
craft breeze-icons
  • To do deploy all things, unfortunately at the moment you need a patched macdeployqt. Example scripty for kate can be found on kate.git/mac/emerge-deploy.sh
    • If you installed qt using Macports, your copy of macdeployqt should be patched, already. It will not be in your system path by default, however. Find it at /opt/local/libexec/qt5 .