kstars: 2.9.8 -> 3.4.3

This commit is contained in:
Hunter Jones 2020-11-02 18:34:55 -06:00 committed by Alyssa Ross
parent 58f024530a
commit 5041cbc691
2 changed files with 72 additions and 15 deletions

View file

@ -1,27 +1,30 @@
{
mkDerivation, lib, fetchgit,
extra-cmake-modules,
stdenv, extra-cmake-modules, fetchurl,
kconfig, kdoctools, kguiaddons, ki18n, kinit, kiconthemes, kio,
knewstuff, kplotting, kwidgetsaddons, kxmlgui,
knewstuff, kplotting, kwidgetsaddons, kxmlgui, wrapQtAppsHook,
qtx11extras, qtwebsockets,
eigen, zlib,
cfitsio, indilib, xplanet
cfitsio, indilib, xplanet, libnova, gsl
}:
mkDerivation {
name = "kstars";
src = fetchgit {
url = "https://anongit.kde.org/kstars.git";
rev = "7acc527939280edd22823371dc4e22494c6c626a";
sha256 = "1n1lgi7p3dj893fdnzjbnrha40p4apl0dy8zppcabxwrb1khb84v";
stdenv.mkDerivation rec {
pname = "kstars";
version = "3.4.3";
src = fetchurl {
url = "https://mirrors.mit.edu/kde/stable/kstars/kstars-${version}.tar.xz";
sha256 = "0j5yxg6ay6sic194skz6vjzg6yvrpb3gvypvs0frjrcjbsl1j4f8";
};
nativeBuildInputs = [ extra-cmake-modules kdoctools ];
patches = [
./indi-fix.patch
];
nativeBuildInputs = [ extra-cmake-modules kdoctools wrapQtAppsHook ];
buildInputs = [
kconfig kdoctools kguiaddons ki18n kinit kiconthemes kio
knewstuff kplotting kwidgetsaddons kxmlgui
@ -30,10 +33,14 @@ mkDerivation {
eigen zlib
cfitsio indilib xplanet
cfitsio indilib xplanet libnova gsl
];
meta = with lib; {
cmakeFlags = [
"-DINDI_NIX_ROOT=${indilib}"
];
meta = with stdenv.lib; {
description = "Virtual planetarium astronomy software";
homepage = "https://kde.org/applications/education/org.kde.kstars";
longDescription = ''

View file

@ -0,0 +1,50 @@
--- CMakeLists.txt 2020-11-02 13:58:06.119743710 -0600
+++ kstars-3.4.3/CMakeLists.txt 2020-11-02 14:05:01.707799274 -0600
@@ -4,5 +4,7 @@
set (KStars_VERSION_REVISION 3)
set (CMAKE_CXX_STANDARD 11)
+add_definitions(-DINDI_NIX_ROOT=${INDI_NIX_ROOT})
+
# Build KStars Lite with -DBUILD_KSTARS_LITE=ON
option(BUILD_KSTARS_LITE "Build KStars Lite" OFF)
--- ksutils.cpp 2020-11-02 13:47:44.883596916 -0600
+++ kstars-3.4.3/kstars/auxiliary/ksutils.cpp 2020-11-02 17:41:44.961937090 -0600
@@ -1076,6 +1076,9 @@
{
QString snap = QProcessEnvironment::systemEnvironment().value("SNAP");
QString flat = QProcessEnvironment::systemEnvironment().value("FLATPAK_DEST");
+#define STR_EXPAND(x) #x
+#define STR(x) STR_EXPAND(x)
+ QString nix = QString(STR(INDI_NIX_ROOT));
if (option == "fitsDir")
{
@@ -1089,7 +1091,7 @@
if (flat.isEmpty() == false)
return flat + "/bin/indiserver";
else
- return snap + "/usr/bin/indiserver";
+ return nix + "/bin/indiserver";
}
else if (option == "INDIHubAgent")
{
@@ -1099,7 +1101,7 @@
if (flat.isEmpty() == false)
return flat + "/bin/indihub-agent";
else
- return snap + "/usr/bin/indihub-agent";
+ return nix + "/bin/indihub-agent";
}
else if (option == "indiDriversDir")
{
@@ -1109,7 +1111,7 @@
if (flat.isEmpty() == false)
return flat + "/share/indi";
else
- return snap + "/usr/share/indi";
+ return nix + "/share/indi";
#else
return QStandardPaths::locate(QStandardPaths::GenericDataLocation, "indi", QStandardPaths::LocateDirectory);
#endif