Merge pull request #104848 from hjones2199/kstars-up

kstars: 3.4.3 -> 3.5.0
This commit is contained in:
Doron Behar 2020-12-28 00:16:21 +02:00 committed by GitHub
commit 7c304d037f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 102 additions and 57 deletions

View File

@ -9,20 +9,23 @@
eigen, zlib,
cfitsio, indilib, xplanet, libnova, libraw, gsl, wcslib
cfitsio, indilib, xplanet, libnova, libraw, gsl, wcslib, stellarsolver
}:
mkDerivation rec {
pname = "kstars";
version = "3.4.3";
version = "3.5.0";
src = fetchurl {
url = "https://mirrors.mit.edu/kde/stable/kstars/kstars-${version}.tar.xz";
sha256 = "0j5yxg6ay6sic194skz6vjzg6yvrpb3gvypvs0frjrcjbsl1j4f8";
url = "mirror://kde/stable/kstars/kstars-${version}.tar.xz";
sha256 = "0fpkm75abn0hhdhfyvpfl6n0fr7gvw63xhb4hvwdrglhkf2nxam1";
};
patches = [
./indi-fix.patch
# Patches ksutils.cpp to use nix store prefixes to find program binaries of
# indilib and xplanet dependencies. Without the patch, Ekos is unable to spawn
# indi servers for local telescope/camera control.
./fs-fixes.patch
];
nativeBuildInputs = [ extra-cmake-modules kdoctools ];
@ -34,11 +37,12 @@ mkDerivation rec {
eigen zlib
cfitsio indilib xplanet libnova libraw gsl wcslib
cfitsio indilib xplanet libnova libraw gsl wcslib stellarsolver
];
cmakeFlags = [
"-DINDI_NIX_ROOT=${indilib}"
"-DXPLANET_NIX_ROOT=${xplanet}"
];
meta = with lib; {
@ -51,6 +55,6 @@ mkDerivation rec {
'';
license = licenses.gpl2;
platforms = platforms.linux;
maintainers = with maintainers; [ timput ];
maintainers = with maintainers; [ timput hjones2199 ];
};
}

View File

@ -0,0 +1,59 @@
--- kstars-3.5.0/CMakeLists.txt.old 2020-11-24 12:36:37.967433937 -0600
+++ kstars-3.5.0/CMakeLists.txt 2020-11-24 13:36:56.275263691 -0600
@@ -5,6 +5,9 @@
set (KSTARS_BUILD_RELEASE "Stable")
set (CMAKE_CXX_STANDARD 11)
+add_definitions(-DINDI_NIX_ROOT=${INDI_NIX_ROOT})
+add_definitions(-DXPLANET_NIX_ROOT=${XPLANET_NIX_ROOT})
+
# Build KStars Lite with -DBUILD_KSTARS_LITE=ON
option(BUILD_KSTARS_LITE "Build KStars Lite" OFF)
--- kstars-3.5.0/kstars/auxiliary/ksutils.old.cpp 2020-11-24 12:22:14.397319680 -0600
+++ kstars-3.5.0/kstars/auxiliary/ksutils.cpp 2020-11-24 13:32:22.946477798 -0600
@@ -1081,6 +1081,10 @@
// We support running within Snaps, Flatpaks, and AppImage
// The path should accomodate the differences between the different
// packaging solutions
+ #define STR_EXPAND(x) #x
+ #define STR(x) STR_EXPAND(x)
+ QString indi_prefix = QString(STR(INDI_NIX_ROOT));
+ QString xplanet_prefix = QString(STR(XPLANET_NIX_ROOT));
QString snap = QProcessEnvironment::systemEnvironment().value("SNAP");
QString flat = QProcessEnvironment::systemEnvironment().value("FLATPAK_DEST");
QString appimg = QProcessEnvironment::systemEnvironment().value("APPDIR");
@@ -1110,21 +1114,21 @@
#if defined(Q_OS_OSX)
return "/usr/local/bin/indiserver";
#endif
- return prefix + "/bin/indiserver";
+ return indi_prefix + "/bin/indiserver";
}
else if (option == "INDIHubAgent")
{
#if defined(Q_OS_OSX)
return "/usr/local/bin/indihub-agent";
#endif
- return prefix + "/bin/indihub-agent";
+ return indi_prefix + "/bin/indihub-agent";
}
else if (option == "indiDriversDir")
{
#if defined(Q_OS_OSX)
return "/usr/local/share/indi";
#elif defined(Q_OS_LINUX)
- return prefix + "/share/indi";
+ return indi_prefix + "/share/indi";
#else
return QStandardPaths::locate(QStandardPaths::GenericDataLocation, "indi", QStandardPaths::LocateDirectory);
#endif
@@ -1181,7 +1185,7 @@
#if defined(Q_OS_OSX)
return "/usr/local/bin/xplanet";
#endif
- return prefix + "/bin/xplanet";
+ return xplanet_prefix + "/bin/xplanet";
}
else if (option == "ASTAP")
{

View File

@ -1,50 +0,0 @@
--- 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

View File

@ -0,0 +1,30 @@
{ stdenv, mkDerivation, fetchFromGitHub, cmake,
qtbase, cfitsio, gsl, wcslib, withTester ? false }:
mkDerivation rec {
pname = "stellarsolver";
version = "1.5";
src = fetchFromGitHub {
owner = "rlancaste";
repo = pname;
rev = version;
sha256 = "12j20j9qbkkx55ix4nm1iw7wd36hamkpidbwhcnmj4yk5fqlyq4y";
};
nativeBuildInputs = [ cmake ];
buildInputs = [ qtbase cfitsio gsl wcslib ];
cmakeFlags = [
"-DBUILD_TESTER=${if withTester then "on" else "off"}"
];
meta = with stdenv.lib; {
homepage = "https://github.com/rlancaste/stellarsolver";
description = "Astrometric plate solving library";
license = licenses.gpl3Plus;
maintainers = with maintainers; [ hjones2199 ];
platforms = [ "x86_64-linux" ];
};
}

View File

@ -27501,6 +27501,8 @@ in
stellarium = libsForQt5.callPackage ../applications/science/astronomy/stellarium { };
stellarsolver = libsForQt5.callPackage ../development/libraries/stellarsolver { };
astrolabe-generator = callPackage ../applications/science/astronomy/astrolabe-generator { };
tulip = callPackage ../applications/science/misc/tulip {