Archive:Getting Started/Build/Mac OS X: Difference between revisions

From KDE TechBase
m (Reverted edits by KennethMartinez (talk) to last revision by AnneW)
 
(53 intermediate revisions by 9 users not shown)
Line 1: Line 1:
{{KDE4}}
__NOINDEX__
{{improve}}
{{improve}}
{{Note|
If you're interested in just checking things out, binaries for kdelibs and parts of KDE in general are available at http://kde.mac.org and are generated semi-regularly.
}}


*Note: You may wish to do all of this inside a directory name that ends in ''.noindex'' or ''.build'' to keep spotlight from indexing all of your temporary build-files as you build them.
*Note: You may wish to do all of this inside a directory name that ends in ''.noindex'' or ''.build'' to keep spotlight from indexing all of your temporary build-files as you build them.
<syntaxhighlight lang="text">mkdir ~/kde4.build
cd ~/kde4.build</syntaxhighlight>
== MacPorts or Fink ==
The best method for currently installing KDE on Mac is to use either Macports or Fink to build at least the system requirements and then also install their stable KDE, or build your own development KDE using on top of their base.
You can find out more information on the [[/MacPorts| KDE on MacPorts]] page.
== Setting Up Your Build Environment ==
Variables must be set to build KDE successfully, and are noted below
*Note: Replace /opt/kde4-deps with the location of your 3rd-party tools, and add your cmake location if you compiled from source
<syntaxhighlight lang="text">export PATH="/opt/qt4/bin:/opt/kde4/bin:/opt/kde4-deps/bin:~/.local/bin/:$PATH"
export CMAKE_LIBRARY_PATH="/opt/kde4-deps/lib"
export CMAKE_INCLUDE_PATH="/opt/kde4-deps/include"
export PKG_CONFIG_PATH="/opt/qt4/lib/:/opt/kde4-deps/lib/pkgconfig/"
</syntaxhighlight>
You might want to put those in your ~/.bash_profile
* For Fink users: If your ''Distribution'' line in ''/sw/etc/fink.conf'' is 10.4-transitional, instead of 10.4, make sure you run ''sudo gcc_select 3.3'' before proceeding with any compiling, or you will end up with binary-incompatible c++ code!
* For others: run ''sudo gcc_select 4.0'' if you want to be compatible with the pre-made installers.


== Required Third Party Tools ==
== Required Third Party Tools ==
The following third party tools are required for successfully building KDE on OSX.
The following third party tools are required for successfully building KDE on OSX. Also, here are some [[Getting_Started/Build/KDE4/LFS| good tips for installing from source]]. I assume you have OS X 10.5 or 10.6 installed, otherwise you would have some more dependencies.
* [http://developer.apple.com/technologies/xcode.html XCode]
* [http://www.gnu.org/software/libtool/libtool.html libtool]
<syntaxhighlight lang="text">cd ~/kde4.build
curl http://ftp.gnu.org/gnu/libtool/libtool-2.2.tar.gz -O
tar xfz libtool-2.2.tar.gz
cd libtool-2.2
ls
./configure --prefix=/opt/kde4-deps
make
sudo make install</syntaxhighlight>
* [http://www.xmlsoft.org/downloads.html libxml2 and libxslt]
<syntaxhighlight lang="text">cd ~/kde4.build
curl ftp://xmlsoft.org/libxml2/libxml2-sources-2.7.7.tar.gz -O
tar xfz libxml2-sources-*.tar.gz
cd libxml2-2.7.7
./configure --prefix=/opt/kde4-deps/
make
sudo make install


cd ~/kde4.build
curl ftp://xmlsoft.org/libxml2/libxslt-1.1.26.tar.gz -O
tar xfz libxslt-*.tar.gz
cd libxslt-1.1.26
./configure --prefix=/opt/kde4-deps/
make
sudo make install
</syntaxhighlight>
* [http://www.linuxfromscratch.org/blfs/view/svn/pst/DocBook.html DocBook XML DTD-4.5 and DocBook XSL Stylesheets-1.75.2]
<syntaxhighlight lang="text">cd ~/kde4.build
mkdir docbook
cd docbooj
curl http://www.docbook.org/xml/4.5/docbook-xml-4.5.zip -O
unzip docbook-xml-4.5.zip
# RUN ALL THE COMMANDS AT http://www.linuxfromscratch.org/blfs/view/svn/pst/DocBook.html AS ROOT
# DOWNLOAD THE FILE AT http://www.linuxfromscratch.org/blfs/view/svn/pst/docbook-xsl.html
sudo tar xfj docbook-xsl-1.75.2.tar.bz2
cd docbook-xsl-1.75.2
# RUN ALL THE COMMANDS THERE AS ROOT</syntaxhighlight>
* [http://www.gtk.org/gtk-doc/download.html gtk-doc]
<syntaxhighlight lang="text">cd ~/kde4.build
curl http://ftp.gnome.org/pub/GNOME/sources/gtk-doc/1.15/gtk-doc-1.15.tar.gz -O -L
tar xfz gtk-doc-*.tar.gz
cd gtk-doc-1.15
./configure --prefix=/opt/kde4-deps/</syntaxhighlight>
* [http://www.gtk.org/download.html glib2]
<syntaxhighlight lang="text">git clone git://git.gnome.org/glib
cd glib/
./autogen.sh --prefix=/opt/kde4-deps/ ## THIS IS WHERE I GET STUCK (entriken 2010-08-20)</syntaxhighlight>
* shared-mime-info
* AGG
* AGG
* bzip2
* giflib or libungif
* giflib or libungif
* libart_lgpl
* libart_lgpl
Line 15: Line 87:
* libmng
* libmng
* libpng
* libpng
* libxml2
* libxslt
* libusb
* libusb
* OpenEXR
* OpenEXR
* PCRE
* PCRE
* Strigi
* Strigi
* shared-mime-info
* pkgconfig
* pkgconfig
* subversion (to check out the kde sources)
* dbus


== Verify Compiler Version ==
* Fink: If your ''Distribution'' line in ''/sw/etc/fink.conf'' is 10.4-transitional, instead of 10.4, make sure you run ''sudo gcc_select 3.3'' before proceeding with any compiling, or you will end up with binary-incompatible c++ code!
* Manual: run ''sudo gcc_select 4.0'' if you want to be compatible with the pre-made installers.
== Qt/Mac Open Source Edition ==
== Qt/Mac Open Source Edition ==
Download qt-mac-opensource from http://www.trolltech.com/download/qt/mac
Get the Qt/Mac source code from http://qt.nokia.com/downloads/sdk-mac-os-cpp


Patches are required for a successful build. Download the qt-copy patches through KDE's svn:
The latest version has QtDBus and should work with KDE for Mac. Get it here: http://download.qt.nokia.com/qtsdk/qt-sdk-mac-opensource-2010.04.dmg
<code>svn co svn://anonsvn.kde.org/home/kde/trunk/qt-copy/patches/</code>
 
and apply the patches:
(statement make by entriken and unverified 2010-08-20)
<code>cd qt-mac-opensource-4*
for patch in /path/to/patches/*.diff; do patch -p0 < $patch; done
</code>
And finally, compile qt-mac:
<code>./configure -prefix /opt/qt4-mac -qt-gif
make all install</code>


== CMake ==
== CMake ==
CMake may be downloaded from CVS:
Get the latest CMake from http://www.cmake.org/cmake/resources/software.html#latest and install:
<code>cvs -d :pserver:anonymous@www.cmake.org:/cvsroot/CMake login</code>
 
Note: password is "cmake"
<syntaxhighlight lang="text">cd ~/kde4.build
<code>cvs -d :pserver:anonymous@www.cmake.org:/cvsroot/CMake co CMake</code>
curl http://www.cmake.org/files/v2.8/cmake-2.8.2.tar.gz -O
And then compiled and installed:
tar xfz cmake-*.tar.gz
<code>cd CMake
cd cmake-*
./configure --prefix=/opt/cmake
./configure --prefix=/opt/kde4-deps
make all install</code>
make all
== Setting Up Your Build Environment ==
sudo make install</syntaxhighlight>
Variable must be set to build KDE successfully, and are noted below
 
*Note: Replace /opt/kde4-deps with the location of your 3rd-party tools, and add your cmake location if you compiled from source
<code>export PATH="/opt/qt4/bin:/opt/kde4/bin:/opt/kde4-deps/bin:$PATH"
export CMAKE_LIBRARY_PATH="/opt/kde4-deps/lib"
export CMAKE_INCLUDE_PATH="/opt/kde4-deps/include"
export PKG_CONFIG_PATH="/opt/qt4/lib/"</code>
== Building kdelibs ==
== Building kdelibs ==
kdelibs must be checked out of svn locally to be built:
kdelibs must be checked out of svn locally to be built:
<code>svn co svn://anonsvn.kde.org/home/kde/trunk/KDE/kdelibs</code>
<syntaxhighlight lang="text">cd ~/kde4.build
svn co svn://anonsvn.kde.org/home/kde/trunk/KDE/kdelibs</syntaxhighlight>
And then compiled by performing the following:
And then compiled by performing the following:
<code>mkdir kdelibs.build
<syntaxhighlight lang="text">mkdir kdelibs.build
cd kdelibs.build
cd kdelibs.build
cmake ../kdelibs -DCMAKE_INSTALL_PREFIX=/opt/kde4
cmake ../kdelibs -DCMAKE_INSTALL_PREFIX=/opt/kde4
make all install</code>
make all install</syntaxhighlight>


== Troubleshooting ==
== Troubleshooting ==
If kdelibs fails to compile successfully, check the build status for the latest Nightly Builds and Continuous Builds at http://public.kitware.com/dashboard.php?name=kde
If kdelibs fails to compile successfully, check the build status for the latest Nightly Builds and Continuous Builds at http://public.kitware.com/dashboard.php?name=kde


== Using Binaries ==
Information about getting and compiling the dependencies can be found at [[Getting_Started/Build]] (pages are Linux focused, but can be useful)
If you're interested in just checking things out, binaries for kdelibs and parts of KDE in general are available at http://ranger.users.finkproject.org/kde/ and are generated semi-regularly.


== Further Reading ==
== Further Reading ==
For more general information on using CMake, see the [[Development/Tutorials/CMake|CMake Tutorial]].
For more general information on using CMake, see the [[Development/Tutorials/CMake|CMake Tutorial]].
[[Category:Mac OSX]]

Latest revision as of 15:52, 31 July 2012

Warning
This section needs improvements: Please help us to

cleanup confusing sections and fix sections which contain a todo


Note
If you're interested in just checking things out, binaries for kdelibs and parts of KDE in general are available at http://kde.mac.org and are generated semi-regularly.


  • Note: You may wish to do all of this inside a directory name that ends in .noindex or .build to keep spotlight from indexing all of your temporary build-files as you build them.
mkdir ~/kde4.build
cd ~/kde4.build

MacPorts or Fink

The best method for currently installing KDE on Mac is to use either Macports or Fink to build at least the system requirements and then also install their stable KDE, or build your own development KDE using on top of their base.

You can find out more information on the KDE on MacPorts page.

Setting Up Your Build Environment

Variables must be set to build KDE successfully, and are noted below

  • Note: Replace /opt/kde4-deps with the location of your 3rd-party tools, and add your cmake location if you compiled from source
export PATH="/opt/qt4/bin:/opt/kde4/bin:/opt/kde4-deps/bin:~/.local/bin/:$PATH"
export CMAKE_LIBRARY_PATH="/opt/kde4-deps/lib"
export CMAKE_INCLUDE_PATH="/opt/kde4-deps/include"
export PKG_CONFIG_PATH="/opt/qt4/lib/:/opt/kde4-deps/lib/pkgconfig/"

You might want to put those in your ~/.bash_profile

  • For Fink users: If your Distribution line in /sw/etc/fink.conf is 10.4-transitional, instead of 10.4, make sure you run sudo gcc_select 3.3 before proceeding with any compiling, or you will end up with binary-incompatible c++ code!
  • For others: run sudo gcc_select 4.0 if you want to be compatible with the pre-made installers.

Required Third Party Tools

The following third party tools are required for successfully building KDE on OSX. Also, here are some good tips for installing from source. I assume you have OS X 10.5 or 10.6 installed, otherwise you would have some more dependencies.

cd ~/kde4.build
curl http://ftp.gnu.org/gnu/libtool/libtool-2.2.tar.gz -O
tar xfz libtool-2.2.tar.gz 
cd libtool-2.2
ls
./configure --prefix=/opt/kde4-deps
make
sudo make install
cd ~/kde4.build
curl ftp://xmlsoft.org/libxml2/libxml2-sources-2.7.7.tar.gz -O
tar xfz libxml2-sources-*.tar.gz
cd libxml2-2.7.7
./configure --prefix=/opt/kde4-deps/
make
sudo make install

cd ~/kde4.build
curl ftp://xmlsoft.org/libxml2/libxslt-1.1.26.tar.gz -O
tar xfz libxslt-*.tar.gz
cd libxslt-1.1.26
./configure --prefix=/opt/kde4-deps/
make
sudo make install
cd ~/kde4.build
mkdir docbook
cd docbooj
curl http://www.docbook.org/xml/4.5/docbook-xml-4.5.zip -O
unzip docbook-xml-4.5.zip
# RUN ALL THE COMMANDS AT http://www.linuxfromscratch.org/blfs/view/svn/pst/DocBook.html AS ROOT
# DOWNLOAD THE FILE AT http://www.linuxfromscratch.org/blfs/view/svn/pst/docbook-xsl.html
sudo tar xfj docbook-xsl-1.75.2.tar.bz2
cd docbook-xsl-1.75.2
# RUN ALL THE COMMANDS THERE AS ROOT
cd ~/kde4.build
curl http://ftp.gnome.org/pub/GNOME/sources/gtk-doc/1.15/gtk-doc-1.15.tar.gz -O -L
tar xfz gtk-doc-*.tar.gz
cd gtk-doc-1.15
./configure --prefix=/opt/kde4-deps/
git clone git://git.gnome.org/glib
cd glib/
./autogen.sh --prefix=/opt/kde4-deps/ ## THIS IS WHERE I GET STUCK (entriken 2010-08-20)
  • shared-mime-info
  • AGG
  • giflib or libungif
  • libart_lgpl
  • libidn
  • libjpeg
  • libmng
  • libpng
  • libusb
  • OpenEXR
  • PCRE
  • Strigi
  • pkgconfig
  • dbus

Qt/Mac Open Source Edition

Get the Qt/Mac source code from http://qt.nokia.com/downloads/sdk-mac-os-cpp

The latest version has QtDBus and should work with KDE for Mac. Get it here: http://download.qt.nokia.com/qtsdk/qt-sdk-mac-opensource-2010.04.dmg

(statement make by entriken and unverified 2010-08-20)

CMake

Get the latest CMake from http://www.cmake.org/cmake/resources/software.html#latest and install:

cd ~/kde4.build
curl http://www.cmake.org/files/v2.8/cmake-2.8.2.tar.gz -O
tar xfz cmake-*.tar.gz
cd cmake-*
./configure --prefix=/opt/kde4-deps
make all
sudo make install

Building kdelibs

kdelibs must be checked out of svn locally to be built:

cd ~/kde4.build
svn co svn://anonsvn.kde.org/home/kde/trunk/KDE/kdelibs

And then compiled by performing the following:

mkdir kdelibs.build
cd kdelibs.build
cmake ../kdelibs -DCMAKE_INSTALL_PREFIX=/opt/kde4
make all install

Troubleshooting

If kdelibs fails to compile successfully, check the build status for the latest Nightly Builds and Continuous Builds at http://public.kitware.com/dashboard.php?name=kde

Information about getting and compiling the dependencies can be found at Getting_Started/Build (pages are Linux focused, but can be useful)

Further Reading

For more general information on using CMake, see the CMake Tutorial.