Guidelines and HOWTOs/Build from source/Install the dependencies: Difference between revisions
Ahmad Samir (talk | contribs) m →Installing required development packages with zypper: add note about cmake()' |
|||
Line 74: | Line 74: | ||
</nowiki>}} | </nowiki>}} | ||
replace dolphin with some other package name, e.g. to build ktexteditor from source: | replace ''dolphin'' with some other package name, e.g. to build ''ktexteditor'' from source: | ||
{{Input|1=<nowiki> | {{Input|1=<nowiki> | ||
# zypper --plus-content repo-source source-install --build-deps-only ktexteditor | # zypper --plus-content repo-source source-install --build-deps-only ktexteditor | ||
Line 80: | Line 80: | ||
Note that the <code>--plus-content</code> option in the above commands means you don't need to have the source repository enabled all the time, <code>--plus-content</code> will make zypper temporarily enable it to get the info it needs. | Note that the <code>--plus-content</code> option in the above commands means you don't need to have the source repository enabled all the time, <code>--plus-content</code> will make zypper temporarily enable it to get the info it needs. | ||
OpenSuse (and most other RPM-based Linux distributions) support cmake() BuildRequires, which means you can install a development package like so: | |||
{{Input|1=<nowiki> | |||
# zypper install 'cmake(KF5KIO)' | |||
</nowiki>}} | |||
the part between the parenthesis ''KF5KIO'' is going to be in the error message that CMake will print in the terminal if you try to build something that requires e.g. KIO if KIO development headers aren't installed. | |||
==== openSUSE Leap 15 (Argon) ==== | ==== openSUSE Leap 15 (Argon) ==== |
Revision as of 13:50, 4 May 2022
In the following we give the dependencies to install. However it might change and this page might be quickly outdated.
Reading the CMakeLists.txt
of the packages you want to install should help you finding what you really need to install. Or read the error logs (see below).
If you need help, see https://community.kde.org/Get_Involved#Getting_in_touch_and_working_together
Enable the source repositories
Some operating systems also require that you enable on the source repositories before you can install build dependencies. Do that now, if necessary:
- Kubuntu/Ubuntu/Debian:
sudo sed -i '/deb-src/s/^# //' /etc/apt/sources.list && sudo apt update
(for more information, see https://askubuntu.com/questions/158871/how-do-i-enable-the-source-code-repositories) - openSUSE Leap & Tumbleweed:
sudo zypper mr -e $(zypper repos | awk '/source/{print $5}')
- Gentoo is all built from sources anyway, so in most cases all necessary build dependencies for installed packages will be available from the get-go, but for convenience this page will refer to sets available from KDE ebuild repository:
emerge eselect-repository && eselect repository enable kde
If you don't see your distro in the above list, then there's nothing you need to do here and you can safely move on.
Any dependencies
KDE neon, Debian, Ubuntu, Kubuntu
All the build packages known by the package you want to build can be installed by running:
sudo apt build-dep <package you want to build>
For example, to install the build dependencies for Dolphin, run:
sudo apt build-dep dolphin
For the frameworks
Arch and Manjaro
All the dependencies used for building frameworks can be installed by running:
$ sudo pacman -Syu --needed phonon-qt5 qt5-webkit qt5-script qt5-svg qt5-tools qt5-x11extras enchant jasper openexr libutempter docbook-xsl shared-mime-info giflib libxss upower udisks2 bzr git doxygen perl-json perl-libwww perl-xml-parser perl-io-socket-ssl akonadi xorg-server-devel libpwquality fontforge eigen libfakekey qca-qt5 xapian-core xsd gperf perl-yaml-syck intltool kdesdk qrencode libdmtx boost ruby-test-unit
Fedora
Most of the dependencies used for building frameworks can be installed by running:
$ sudo dnf install bison flex giflib-devel gperf gpgmepp-devel grantlee-qt5-devel kf5-kconfigwidgets-devel libaccounts-glib-devel libaccounts-qt5-devel libattr-devel libdrm-devel libepoxy-devel libgcrypt-devel libical-devel libinsane-devel libjpeg-turbo-devel libnl3-devel LibRaw-devel libsndfile-devel libSM-devel libXext-devel libxml2-devel libXrender-devel libxslt-devel libXtst-devel lm_sensors-devel lmdb-devel meson ModemManager-devel NetworkManager-libnm-devel ninja-build openal-soft-devel openjpeg2-devel openjpeg-devel openssl-devel perl-FindBin perl-IPC-Cmd perl-JSON-PP perl-YAML-Syck polkit-devel qgpgme-devel qrencode-devel qt5-*-devel qt5-*-static qtkeychain-qt5-devel signon-devel systemd-devel wayland-devel xcb*-devel libqalculate* dbus-glib-devel* libmission-control-plugins* qt5* gmp-ecm*
Download difficult packages to find into the same directory by copying the following lines into your web browsers address bar: http://abf-downloads.openmandriva.org/4.2/repository/x86_64/main/release/lib64signon-glib-devel-2.1-4-omv4002.x86_64.rpm http://abf-downloads.openmandriva.org/4.2/repository/x86_64/main/release/lib64signon-glib2-2.1-4-omv4002.x86_64.rpm http://abf-downloads.openmandriva.org/4.2/repository/x86_64/main/release/lib64signon-glib-gir1.0-2.1-4-omv4002.x86_64.rpm Change directory to the location you have downloaded the files normally ~/Downloads cd ~/Downloads Install using the following command sudo dnf install ./lib64signon-glib2*.rpm Fix for QCA build Library Problems (Fedora 35) sudo ln -s /usr/lib64/libpthread.so.0 /usr/lib64/libpthread.so sudo ln -s /usr/lib64/libdl.so.2 /usr/lib64/libdl.so
Gentoo
Make use of sets provided by KDE ebuild repository to ensure all frameworks packages are installed, thus pulling in all necessary dependencies.
# emerge --ask --verbose @kde-frameworks
Pay attention to the resulting list of packages to be installed and enable additional USE flags to ensure optional dependencies are installed as well.
openSUSE
Installing required development packages with zypper
Generally you can install the required -devel packages that are needed to build some KDE software from source by using zypper
(as root, or by using sudo
), e.g. to install the -devel packages required to build dolphin from source:
# zypper --plus-content repo-source source-install --build-deps-only dolphin
replace dolphin with some other package name, e.g. to build ktexteditor from source:
# zypper --plus-content repo-source source-install --build-deps-only ktexteditor
Note that the --plus-content
option in the above commands means you don't need to have the source repository enabled all the time, --plus-content
will make zypper temporarily enable it to get the info it needs.
OpenSuse (and most other RPM-based Linux distributions) support cmake() BuildRequires, which means you can install a development package like so:
# zypper install 'cmake(KF5KIO)'
the part between the parenthesis KF5KIO is going to be in the error message that CMake will print in the terminal if you try to build something that requires e.g. KIO if KIO development headers aren't installed.
openSUSE Leap 15 (Argon)
Updated 24 June 2018 (likely incomplete)
$ sudo zypper si -d libqt5-qtbase $ sudo zypper in libbz2-devel libxslt-devel libxml2-devel shared-mime-info oxygen-icon-theme giflib-devel vlc-devel doxygen gstreamer-devel gstreamer-plugins-base-devel docbook-xml-slides docbook-xsl-stylesheets xcb-util-keysyms-devel perl-JSON boost-devel libxcb-devel libXrender-devel xcb-util-wm-devel xcb-util-devel xcb-util-image-devel gettext-tools libepoxy-devel $ sudo zypper in gtk3-devel $ sudo zypper in grantlee5-devel kactivities5-devel plasma-framework-devel plasma5-addons-devel plasma5-workspace-devel libQt5Concurrent-devel libQt5DBus-devel libQt5PrintSupport-devel xcb-util-cursor-devel libqt5-qtx11extras-devel xcb-proto-devel git-core
openSUSE 42.1
Install these packages (including the recommended packages):
$ sudo zypper install patterns-openSUSE-devel_kde patterns-openSUSE-devel_kde_frameworks git-core bzr ninja \ gettext-tools libqt5-qttools libgypsy0 libqt5-creator libqt5-linguist libqt5-qtbase-common-devel libqt5-qtbase-devel libqt5-qtbase-examples libqt5-qtdeclarative-devel libqt5-qtdeclarative-examples libqt5-qtdeclarative-tools libqt5-qtdoc libqt5-qtgraphicaleffects libqt5-qtimageformats libqt5-qtimageformats-devel libqt5-qtmultimedia-devel libqt5-qtmultimedia-examples libqt5-qtquick1-devel libqt5-qtquickcontrols libqt5-qtscript-devel libqt5-qtscript-examples libqt5-qtsvg-devel libqt5-qttools-devel libqt5-qtx11extras-devel libqt5-qtxmlpatterns-devel libqt5-qtxmlpatterns-examples libQt5CLucene5 libQt5Concurrent-devel libQt5Concurrent5 libQt5Core-devel libQt5Core5 libQt5DBus-devel libQt5DBus5 libQt5Declarative5 libQt5Designer5 libQt5DesignerComponents5 libQt5Gui-devel libQt5Gui5 libQt5Help5 libQt5Multimedia5 libQt5Network-devel libQt5Network5 libQt5OpenGL-devel libQt5OpenGL5 libQt5Positioning5 libQt5PrintSupport-devel libQt5PrintSupport5 libQt5Script5 libQt5Sensors5 libQt5Sql-devel libQt5Sql5 libQt5Sql5-mysql libQt5Sql5-postgresql libQt5Sql5-sqlite libQt5Sql5-unixODBC libQt5Svg5 libQt5Test-devel libQt5Test5 libQt5WebKit5 libQt5WebKitWidgets5 libQt5Widgets-devel libQt5Widgets5 libQt5X11Extras5 libQt5Xml-devel libQt5Xml5 libQt5XmlPatterns5 libQtQuick5 libQt5WebKitWidgets-devel libqt5-qtbase-private-headers-devel \ xcb-util-keysyms-devel docbook-xsl-stylesheets doxygen polkit-devel libepoxy-devel boost-devel libXcursor-devel libSM-devel giflib-devel libaccounts-qt5-devel gtk3-devel libpng16-devel fltk-devel libopenssl-devel libattr-devel ModemManager-devel NetworkManager-devel wayland-devel lmdb-devel xcb-proto-devel xcb-util-image-devel xcb-util-cursor-devel xcb-util-devel gtk2-devel libqca-qt5-devel libpwquality-devel libical-devel PackageKit-Qt5-devel pam-devel \ bison flex libqt5-qttools-doc
- OPEN ISSUES:
- on my system 'ninja-1.6.0' was installed and when using 'custom-build-command ninja' in the kdesrc-buildrc below, the build of modules fails), maybe see https://bugs.kde.org/show_bug.cgi?id=331654
- Failing modules (of more than 200 modules)
- phonon-vlc, phonon-gstreamer, plasma-pa (PulseAudio missing), kdevplatform, plasma-desktop, kaccounts-integration, kaccounts-mobile, gwenview, kdevelop, libksane, skanlite, ... (see below for solutions)
openSUSE Tumbleweed
This more complete list allows to compile everything that kdesrc-build's default setup (kf5-qt5-build-include) compiles. Note that it doesn't contain Qt or Qt-based libs, you need that on top, or to compile your own Qt (and then include custom-qt5-libs-build-include in kdesrc-buildrc).
$ sudo zypper install aspell-devel atk-devel at-spi2-core-devel audiofile-devel autoconf binutils-devel bluez-devel boost-devel cdparanoia-devel cmake cmark-devel cups-devel cyrus-sasl-devel docbook2X docbook-xsl-stylesheets doxygen eigen3-devel enchant-devel exiv2-devel farstream-devel fdupes ffmpeg-4-libavcodec-devel ffmpeg-4-libavformat-devel ffmpeg-devel fftw3-devel flac-devel flatpak-devel fuse3-devel fwupd-devel gdk-pixbuf-devel gettext-tools giflib-devel git glew-devel grantlee5-devel graphviz-devel gstreamer-devel gstreamermm-devel gstreamer-plugins-bad gstreamer-plugins-base-devel gstreamer-rtsp-server-devel gstreamer-transcoder-devel gstreamer-validate-devel gtk2-devel gtk3-devel hunspell-devel ibus-devel id3lib-devel intltool kcolorpicker-devel kdsoap-devel kimageannotator-devel libaccounts-glib-devel libaccounts-qt5-devel libacl-devel libarchive-devel libassuan-devel libatasmart-devel libattr-devel libblkid-devel libbotan-devel libcanberra-devel libcap-devel libdiscid-devel libdmtx-devel libdwarf-devel libelf-devel libepoxy-devel libepub-devel libepubgen-devel libexiv2-devel libfakekey-devel libffmpegthumbnailer-devel libgbm-devel libgit2-devel libgpgme-devel libgphoto2-devel libgpgmepp-devel libgssglue-devel libgumbo-devel libical-devel libicecream-devel libicu-devel libidn-devel libimobiledevice-devel libiodbc-devel libjasper-devel libkdsoap2 libkolabxml-devel libksane-devel liblcms2-devel libMagick++-devel libmlt++-devel libmms-devel libmtp-devel libmusicbrainz-devel libmysqlclient-devel libmysqld-devel libnl3-devel liboauth-devel libopenssl-devel libopus-devel libotr-devel liboyranos-devel libpcap-devel libpgf-devel libpoppler-devel libpulse-devel libpwquality-devel libqalculate-devel libqgpgme-devel libQt5Charts5-devel libQt5Core-private-headers-devel libQt5PlatformSupport-private-headers-devel libQt5PrintSupport-private-headers-devel libqt5-qtcharts-imports libqt5-qtwayland-private-headers-devel libQt5QuickControls2-devel libraw-devel libsamplerate-devel libsensors4-devel libsignon-qt5-devel libsmbclient-devel libsndfile-devel libspeechd-devel libssh2-devel libssh-devel libudev-devel libusb-1_0-devel libusb-compat-devel libv4l-devel LibVNCServer-devel libvorbis-devel libwacom-devel libxapian-devel libXcm-devel libxkbcommon-devel libxslt-devel libXtst-devel libzeitgeist-devel llvm-clang-devel llvm-devel lmdb-devel make ModemManager-devel mpfr-devel mtdev-devel mozilla-nss-devel NetworkManager-devel openal-soft-devel openconnect-devel opencv-devel openjpeg2-devel openslp-devel PackageKit-devel PackageKit-Qt-devel pam-devel pango-devel parted-devel patterns-kde-devel_kde_frameworks patterns-kde-devel_qt5 pciutils-devel pipewire-devel plymouth-devel polkit-devel postgresql-devel python3 python3-devel python3-openpyxl python3-pycairo python3-python-dateutil qrencode-devel qtkeychain-qt5-devel sane-backends-devel sassc speex-devel taglib tesseract-ocr-devel utempter-devel vlc-devel wayland-protocols-devel wayland-utils xcb-util-cursor-devel xcb-util-image-devel xcb-util-keysyms-devel xcb-util-renderutil-devel xcb-util-wm-devel xf86-input-evdev-devel xf86-input-libinput-devel xf86-input-synaptics-devel xf86-input-wacom-devel xorg-x11-devel xorg-x11-server-sdk xorg-x11-util-devel xz-devel
- OPEN ISSUES:
- libeigen2-devel is no longer available on Tumbleweed via official repos, though it's only needed for kdelibs4support
For Plasma
- Arch/Antergos/Manjaro:
sudo pacman -Syu --needed plasma-desktop plasma-wayland-session plasma-workspace kwin
- Fedora:
sudo dnf install libpcap-devel libnl3-devel libsecret-devel; sudo dnf builddep bluedevil breeze-gtk kde-gtk-config kgamma kscreen kwin plasma-breeze plasma-desktop plasma-discover plasma-disks plasma-drkonqi plasma-firewall plasma-integration plasma-milou plasma-nm plasma-pa plasma-systemmonitor plasma-systemsettings plasma-thunderbolt plasma-vault plasma-wayland-protocols plasma-workspace plasma-workspace-geolocation plasma-workspace-wallpapers plymouth-kcm powerdevil sddm-kcm
- Gentoo:
emerge --ask --verbose @kde-plasma
- KDE neon/Kubuntu/Ubuntu/Debian
sudo apt build-dep plasma-desktop plasma-workspace kwin
- openSUSE Leap & Tumbleweed:
sudo zypper si -d plasma5-desktop plasma5-workspace kwin5
Any other dependencies can be figured out and installed as you continue building the modules one by one.
Though qt6 is listed as an optional dependency in the build phase and already available in some Linux distros, only building with qt5 is currently supported. See https://bugs.kde.org/show_bug.cgi?id=442296
Quick fixes for package manager errors
The above lists might not always be working out of the box on your specific distribution or might be out of date for individual packages. In many cases removing single packages from the lists above still allows you to build many KDE frameworks and applications.
In case it is a package added by a regex, you can exclude the specific package by a workaround using sed. Let us assume for an example that we want to install "libkf5.*-dev" on deb-based systems but have uninstallable packages libkf5example1-dev, libkf5example2-dev. Then we install all "libkf5.*-dev" packages excluding libkf5example1-dev and libkf5example2-dev through:
$ sudo apt install $(apt-cache search -n "libkf5.*-dev" | sed 's/ - .*//' | sed '/libkf5example1-dev/d' | sed '/libkf5example2-dev/d')