1
0
Fork 1
mirror of https://github.com/NixOS/nixpkgs.git synced 2024-12-25 03:17:13 +00:00
nixpkgs/pkgs/applications/science/astronomy/kstars/fs-fixes.patch

60 lines
2.2 KiB
Diff
Raw Normal View History

2020-12-25 21:53:24 +00:00
--- 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")
{