This page is a community effort to document the procedure to build the KDE Frameworks 5 version of KStars on various platforms and environments. We have a separate page for the old KDE4 version.
Typically, you would want to build KStars from source if you plan to develop KStars, or stay on the bleeding edge and contribute valuable feedback.
If you plan to develop KStars, it is highly recommended to utilize an IDE. You can use any IDE of your choice, but QtCreator or KDevelop are recommended as they are more suited for Qt/KDE development.
To build and develop KStars, several packages may be required from your distribution. Here's a list.
To install all of these, use the following commands:
sudo apt-get install build-essential cmake git libeigen3-dev libcfitsio-dev zlib1g-dev libindi-dev extra-cmake-modules libkf5plotting-dev libqt5svg5-dev libkf5iconthemes-dev libkf5xmlgui-dev kio-dev kinit-dev libkf5newstuff-dev kdoctools-dev libkf5notifications-dev qtdeclarative5-dev libkf5crash-dev gettext
Warning: this list looks incomplete.
sudo pacman -S eigen libindi wcslib xplanet cmake kf5 extra-cmake-modules
yum install cfitsio-devel eigen3-devel cmake extra-cmake-modules.noarch kf5-kconfig-devel kf5-kdbusaddons-devel kf5-kdoctools-devel kf5-kguiaddons-devel kf5-ki18n-devel kf5-kiconthemes-devel kf5-kinit-devel kf5-kio-devel kf5-kjobwidgets-devel kf5-knewstuff-devel kf5-kplotting-devel kf5-ktexteditor-devel kf5-kwidgetsaddons-devel kf5-kwindowsystem-devel kf5-kxmlgui-devel libindi-devel libindi-static qt5-qtdeclarative-devel qt5-qtmultimedia-devel qt5-qtsvg-devel wcslib-devel xplanet zlib-devel
KStars development happens on KDE's git repository. (Git is an open-source version control software.). The code on git is the bleeding-edge developers' version of KStars. It it mostly stable, but occasionally breaks.
mkdir ~/kde && cd ~/kde
git clone git://anongit.kde.org/kstars
mkdir build && cd build
cmake ../kstars -DCMAKE_INSTALL_PREFIX=/usr
6) Install KStars:
sudo make install
That’s all! This installs KStars globally, so if you have an existing KStars, it will overwrite it.
You can keep your copy up-to-date by typing `git pull --rebase` in ~/kde/kstars. Feel free to send patches to our mailing list email@example.com. And join #kde-kstars on irc.kde.org :–)
Only cross-compilation on (Ubuntu) Linux is supported.
sudo apt-get install dos2unix ccache
Set the following environmental variables before building:
export QT_ANDROID=Qt SDK for Android target # E.g. .../Qt/5.8/android_armv7 export ANDROID_NDK=Android NDK path export ANDROID_SDK_ROOT=Android SDK path export ANDROID_API_LEVEL=Android API level # Currently the minimum is 17
If you want to generate signed release package set the following variables:
export ANDROID_KEYSTORE=your_keystore_file export ANDROID_KEYSTORE_ALIAS=your_keystore_alias
First build the KF5 dependencies separately:
1. Go to the root of the source directory.
2. Create build directory for out-of-source build:
mkdir build cd build
3. Run build_kf5.sh and verify that the script builds everything without any problem.
When KF5 are ready, build KStars Lite for Android:
cmake -B. -H.. -DBUILD_KSTARS_LITE=ON -DCMAKE_TOOLCHAIN_FILE=android/toolchain-android.cmake -DEIGEN3_INCLUDE_DIR=/usr/include/eigen3/ -DCMAKE_INSTALL_PREFIX=$(pwd)/android/export -DCMAKE_BUILD_TYPE=MinSizeRel
make -j4 install
adb install android/kstars_build_apk/bin/QtApp-debug.apk
adb install android/kstars_build_apk/bin/kstars-signed.apk
The textual tests and the KStars GUI tests are built with the normal process and they can be executed with "ctest" command. To build the KStars Lite GUI tests instead of KStars GUI tests, KStars Lite must be build by passing -DBUILD_KSTARS_LITE=ON to the cmake configuration.