User:Donnguyen: Difference between revisions
No edit summary |
No edit summary |
||
Line 1: | Line 1: | ||
= Building KDE/Plasma 5 on Ubuntu 14.04 LTS = | = Building KDE/Plasma 5 on Ubuntu 14.04 LTS = | ||
The aim of this guide is to help you build KDE Plasma 5 for development and/or use. These instructions are valid as of 31 Aug 2016. | {{Warning|Since this guide uses PPA's and packages from Xenial, this may cause instability to your system | ||
}} | |||
The aim of this guide is to help you build KDE Plasma 5 for development and/or use. I decided to write a guide specifically for Ubuntu 14.04 because it can be tricky to resolve all of the build dependencies and problems specific to this system. These instructions are valid as of 31 Aug 2016. Since you will be building out of the master branch, dependencies may change after this guide is written. I will try to update this guide to cover any new dependencies. | |||
Most of the instructions in this guide can be cut and pasted. A few steps will require you to edit some files or interact with a GUI. | |||
{{Note|Following the instructions in this guide will install Qt to /opt/Qt5.7.0 and kde to /opt/kde-5. | |||
}} | |||
== Install a recent version of cmake == | == Install a recent version of cmake == | ||
You will need to install a more recent version of cmake to build. | |||
{{Input|1=<nowiki> | {{Input|1=<nowiki> | ||
sudo apt-get install build-essential | sudo apt-get install build-essential | ||
Line 27: | Line 35: | ||
{{Tip|You may lose network connection after this step. Reboot to fix.}} | {{Tip|You may lose network connection after this step. Reboot to fix.}} | ||
== Install Qt 5.7.0 using installer == | == Install Qt 5.7.0 using Qt offline installer == | ||
Download and install to default location | Download and install Qt 5.7.0 to the default location /opt/Qt5.7.0 | ||
{{Input|1=<nowiki>sudo ./qt-opensource-linux-x64-5.7.0.run</nowiki>}} | {{Input|1=<nowiki>wget http://download.qt.io/official_releases/qt/5.7/5.7.0/qt-opensource-linux-x64-5.7.0.run | ||
sudo ./qt-opensource-linux-x64-5.7.0.run</nowiki>}} | |||
Choose default options and include "Sources" option | Choose default options and include "Sources" option | ||
{{Note|On my computer it appears to be stuck at 4%(dialog box doesn't respond), but it installs just fine if I wait.}} | {{Note|On my computer it appears to be stuck at 4%(dialog box doesn't respond), but it installs just fine if I wait.}} | ||
Line 39: | Line 48: | ||
== Build Qtwebkit == | == Build Qtwebkit == | ||
Install dependencies for building Qtwebkit | Install dependencies for building Qtwebkit: | ||
{{Input|1=<nowiki>sudo apt-get install flex bison gperf libicu-dev libxslt-dev ruby</nowiki>}} | {{Input|1=<nowiki>sudo apt-get install flex bison gperf libicu-dev libxslt-dev ruby</nowiki>}} | ||
Install git | Install git: | ||
{{Input|1=<nowiki>sudo apt-get install git</nowiki>}} | {{Input|1=<nowiki>sudo apt-get install git</nowiki>}} | ||
Clone and build qtwebkit | Clone and build qtwebkit: | ||
{{Input|1=<nowiki>git clone git://code.qt.io/qt/qtwebkit.git --branch 5.7.0 | {{Input|1=<nowiki>git clone git://code.qt.io/qt/qtwebkit.git --branch 5.7.0 | ||
mkdir qtwebkit-build | mkdir qtwebkit-build | ||
Line 53: | Line 62: | ||
== Setup kdesrc-build and .kdesrc-buildrc == | == Setup kdesrc-build and .kdesrc-buildrc == | ||
Most of this section is taken from https://community.kde.org/Guidelines_and_HOWTOs/Build_from_source | kdesrc-build needs xml-parser-perl so install it with the following command: | ||
{{Input|1=<nowiki>sudo apt-get install libxml-parser-perl</nowiki>}} | |||
Most of this section is taken from https://community.kde.org/Guidelines_and_HOWTOs/Build_from_source and copied here for your convenience. Be sure to set qtdir and kdedir as directed at the end of this section. | |||
=== Git remote prefix === | === Git remote prefix === | ||
Let's setup a "kde:" prefix for git commands. Add the following text to your ~/.gitconfig: | Let's setup a "kde:" prefix for git commands. Add the following text to your ~/.gitconfig: | ||
Line 99: | Line 112: | ||
</pre> | </pre> | ||
Set qtdir to output of qmake –v minus the lib | Set qtdir to output of <code>qmake –v</code> minus the lib | ||
kdedir /opt/kde-5 # Where to install KF5-based software | kdedir /opt/kde-5 # Where to install KF5-based software | ||
qtdir /opt/Qt5.7.0/5.7/gcc_64 # Where to find Qt5 | qtdir /opt/Qt5.7.0/5.7/gcc_64 # Where to find Qt5 | ||
{{Remember|Make sure you have write access to the | {{Remember|Make sure you have write access to the directory specified by kdedir!}} | ||
===Setup work around for baloo compilation error === | |||
===Setup baloo | Add the following to ~/.kdesrc-buildrc to work around the compilation error with baloo: | ||
options baloo | |||
cmake-options -DCMAKE_CXX_FLAGS="-lc" | |||
end options | |||
end options | |||
== Build plasma-desktop == | == Build plasma-desktop == | ||
Install dependencies to build plasma-desktop: | |||
{{Input|1=<nowiki>sudo apt-get build-dep polkit-qt-1 | {{Input|1=<nowiki>sudo apt-get build-dep polkit-qt-1 | ||
sudo apt-get install libgif-dev | sudo apt-get install libgif-dev libnm-glib-dev "^libxcb.*" libx11-xcb-dev libglu1-mesa-dev libxrender-dev libxi-dev libattr1-dev liblmdb-dev libxapian-dev | ||
</nowiki>}} | </nowiki>}} | ||
Download and install some packages from Xenial: | Download and install some packages from Xenial: | ||
Line 134: | Line 137: | ||
dpkg -i *.deb | dpkg -i *.deb | ||
</nowiki>}} | </nowiki>}} | ||
Finally, we can build plasma-desktop: | |||
{{Input|1=<nowiki>kdesrc-build --include-dependencies plasma-desktop</nowiki>}} | {{Input|1=<nowiki>kdesrc-build --include-dependencies plasma-desktop</nowiki>}} | ||
== Build some extra applications == | == Build some extra applications == | ||
You may want to build some base applications and can do so with: | |||
{{Input|1=<nowiki> | {{Input|1=<nowiki> | ||
kdesrc-build applications | kdesrc-build applications | ||
</nowiki>}} | </nowiki>}} | ||
You can use kdesrc-build to build other applications. For example, to build kdevelop: | |||
{{Input|1=<nowiki> | |||
kdesrc-build --include-dependencies kdevelop | |||
</nowiki>}} | |||
== Set up environment to run plasma 5 == | == Set up environment to run plasma 5 == | ||
Follow this guide to set up and run plasma 5: https://community.kde.org/Guidelines_and_HOWTOs/Build_from_source/Test_plasma |
Revision as of 17:17, 2 September 2016
Building KDE/Plasma 5 on Ubuntu 14.04 LTS
The aim of this guide is to help you build KDE Plasma 5 for development and/or use. I decided to write a guide specifically for Ubuntu 14.04 because it can be tricky to resolve all of the build dependencies and problems specific to this system. These instructions are valid as of 31 Aug 2016. Since you will be building out of the master branch, dependencies may change after this guide is written. I will try to update this guide to cover any new dependencies.
Most of the instructions in this guide can be cut and pasted. A few steps will require you to edit some files or interact with a GUI.
Install a recent version of cmake
You will need to install a more recent version of cmake to build.
sudo apt-get install build-essential wget https://cmake.org/files/v3.6/cmake-3.6.1.tar.gz tar -zxvf cmake-3.6.1.tar.gz cd cmake-3.6.1/ ./configure make sudo apt-get install checkinstall sudo checkinstall
Upgrade libwayland-dev and network-manager from PPA's
Upgrade libwayland-dev and related dependencies:
sudo add-apt-repository ppa:xorg-edgers/ppa sudo apt-get update sudo apt-get install libwayland-dev
Upgrade network-manager and related dependencies:
sudo add-apt-repository ppa:9v-shaun-42/networkmanager sudo apt-get update sudo apt-get install network-manager
Tip |
---|
You may lose network connection after this step. Reboot to fix. |
Install Qt 5.7.0 using Qt offline installer
Download and install Qt 5.7.0 to the default location /opt/Qt5.7.0
wget http://download.qt.io/official_releases/qt/5.7/5.7.0/qt-opensource-linux-x64-5.7.0.run sudo ./qt-opensource-linux-x64-5.7.0.run
Choose default options and include "Sources" option
Install some build dependencies
sudo apt-get build-dep kde-workspace qtbase5-dev
Build Qtwebkit
Install dependencies for building Qtwebkit:
sudo apt-get install flex bison gperf libicu-dev libxslt-dev ruby
Install git:
sudo apt-get install git
Clone and build qtwebkit:
git clone git://code.qt.io/qt/qtwebkit.git --branch 5.7.0 mkdir qtwebkit-build cd qtwebkit-build /opt/Qt5.7.0/5.7/gcc_64/bin/qmake ../qtwebkit make sudo make install
Setup kdesrc-build and .kdesrc-buildrc
kdesrc-build needs xml-parser-perl so install it with the following command:
sudo apt-get install libxml-parser-perl
Most of this section is taken from https://community.kde.org/Guidelines_and_HOWTOs/Build_from_source and copied here for your convenience. Be sure to set qtdir and kdedir as directed at the end of this section.
Git remote prefix
Let's setup a "kde:" prefix for git commands. Add the following text to your ~/.gitconfig:
[url "git://anongit.kde.org/"]
insteadOf = kde:
[url "ssh://[email protected]/"]
pushInsteadOf = kde:
Install kdesrc-build
kdesrc-build is, a user-space package manager, it is used to compile KDE-related projects from source and installs them into a designated directory.
Follow the given steps to set up kdesrc-build to install KDevelop into our $HOME directory:
mkdir ~/kdesrc cd ~/kdesrc git clone kde:kdesrc-build cd kdesrc-build cp kdesrc-buildrc-kf5-sample ~/.kdesrc-buildrc # Install a symlink of kdesrc-build to a location in PATH mkdir ~/bin ln -s $PWD/kdesrc-build ~/bin export PATH=~/bin:$PATH
You will need to append the line
export PATH=~/bin:$PATH
to
~/.bashrc
so kdesrc-build is available in PATH whenever you open a terminal.
Configure kdesrc-build
edit
~/.kdesrc-buildrc
Replace
/path/to/kdesrc-build/kf5-qt5-build-include
with
~/kdesrc/kdesrc-build/kf5-qt5-build-include
in ~/.kdesrc-buildrc file Add
ignore-kde-structure true
and
make-options -jN
to the global section in ~/.kdesrc-buildrc
global ... ignore-kde-structure true make-options -j5 # NOTE: 5 is the number of jobs, this should usually be (number-of-cpu-cores + 1) #stop-on-failure true # Stop kdesrc-build ... end global
Set qtdir to output of qmake –v
minus the lib
kdedir /opt/kde-5 # Where to install KF5-based software qtdir /opt/Qt5.7.0/5.7/gcc_64 # Where to find Qt5
Remember |
---|
Make sure you have write access to the directory specified by kdedir! |
Setup work around for baloo compilation error
Add the following to ~/.kdesrc-buildrc to work around the compilation error with baloo:
options baloo cmake-options -DCMAKE_CXX_FLAGS="-lc" end options
Build plasma-desktop
Install dependencies to build plasma-desktop:
sudo apt-get build-dep polkit-qt-1 sudo apt-get install libgif-dev libnm-glib-dev "^libxcb.*" libx11-xcb-dev libglu1-mesa-dev libxrender-dev libxi-dev libattr1-dev liblmdb-dev libxapian-dev
Download and install some packages from Xenial:
mkdir extra-deb cd extra-deb wget http://mirrors.kernel.org/ubuntu/pool/main/libx/libxkbcommon/libxkbcommon-dev_0.5.0-1ubuntu2_amd64.deb wget http://mirrors.kernel.org/ubuntu/pool/main/libx/libxkbcommon/libxkbcommon0_0.5.0-1ubuntu2_amd64.deb wget http://mirrors.kernel.org/ubuntu/pool/main/libe/libepoxy/libepoxy-dev_1.3.1-1_amd64.deb wget http://mirrors.kernel.org/ubuntu/pool/main/libe/libepoxy/libepoxy0_1.3.1-1_amd64.deb dpkg -i *.deb
Finally, we can build plasma-desktop:
kdesrc-build --include-dependencies plasma-desktop
Build some extra applications
You may want to build some base applications and can do so with:
kdesrc-build applications
You can use kdesrc-build to build other applications. For example, to build kdevelop:
kdesrc-build --include-dependencies kdevelop
Set up environment to run plasma 5
Follow this guide to set up and run plasma 5: https://community.kde.org/Guidelines_and_HOWTOs/Build_from_source/Test_plasma