commit:     7f52155b9806f7420eae1ae850d1a126967462ff
Author:     Andreas Sturmlechner <asturm <AT> gentoo <DOT> org>
AuthorDate: Tue Jul 25 14:38:54 2023 +0000
Commit:     Andreas Sturmlechner <asturm <AT> gentoo <DOT> org>
CommitDate: Tue Jul 25 14:38:54 2023 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=7f52155b

sci-astronomy/kstars: Fix build w/ USE=-indi

Closes: https://bugs.gentoo.org/911199
Signed-off-by: Andreas Sturmlechner <asturm <AT> gentoo.org>

 sci-astronomy/kstars/files/kstars-3.6.5-gsl.patch | 59 +++++++++++++++++++++++
 sci-astronomy/kstars/kstars-3.6.5.ebuild          |  7 ++-
 2 files changed, 64 insertions(+), 2 deletions(-)

diff --git a/sci-astronomy/kstars/files/kstars-3.6.5-gsl.patch 
b/sci-astronomy/kstars/files/kstars-3.6.5-gsl.patch
new file mode 100644
index 000000000000..1aaa348ba8c1
--- /dev/null
+++ b/sci-astronomy/kstars/files/kstars-3.6.5-gsl.patch
@@ -0,0 +1,59 @@
+From b83de34310d13920e1be5e980d0774f35c1d9a2a Mon Sep 17 00:00:00 2001
+From: Heiko Becker <[email protected]>
+Date: Wed, 31 May 2023 21:19:12 +0200
+Subject: [PATCH] Fix build without INDI
+
+Without INDI present I get the following error:
+
+"x86_64-pc-linux-gnu-ld: ../lib/libKStarsLib.a(robuststatistics.cpp.o):
+in function `Mathematics::GSLHelpers::gslMedianFromSortedData(
+double const*, unsigned long, unsigned long)':
+.../work/kstars-3.6.5/kstars/auxiliary/gslhelpers.h:306: undefined
+reference to `gsl_stats_median_from_sorted_data'"
+
+That is the case because Mathematics::RobustStatistics is used
+unconditionally, which pulls in gslhelpers and the need to link with
+GSL.
+
+Also drop the duplicate linking of KF5::Notifications, KStarsLib already
+links to it in the NOT ANDROID case.
+---
+ kstars/CMakeLists.txt | 8 ++++----
+ 1 file changed, 4 insertions(+), 4 deletions(-)
+
+diff --git a/kstars/CMakeLists.txt b/kstars/CMakeLists.txt
+index 747ce79a95..b755be5737 100644
+--- a/kstars/CMakeLists.txt
++++ b/kstars/CMakeLists.txt
+@@ -1169,6 +1169,8 @@ set(kstars_SRCS ${kstars_SRCS} ${fits2_SRCS} ${sep_SRCS} 
${gpg_SRCS} ${hough_SRC
+ set(kstarslite_SRCS ${kstarslite_SRCS} ${fits_klite_SRCS} ${sep_SRCS} 
${hough_SRCS} ${fits2_klite_SRCS} ${kstarslite_libtess_SRC})
+ 
+ IF (NOT ANDROID)
++    # GSL
++    find_package(GSL REQUIRED)
+     qt5_add_dbus_adaptor(kstars_SRCS org.kde.kstars.xml kstars.h KStars)
+     qt5_add_dbus_adaptor(kstars_SRCS org.kde.kstars.SimClock.xml simclock.h 
SimClock)
+     qt5_add_dbus_adaptor(kstars_SRCS org.kde.kstars.FOV.xml fov.h FOV)
+@@ -1243,6 +1245,7 @@ IF (NOT ANDROID)
+         Qt5::WebSockets
+         ${ZLIB_LIBRARIES}
+         Eigen3::Eigen
++        GSL::gsl
+         )
+ 
+     if (Qt5Keychain_FOUND)
+@@ -1313,10 +1316,7 @@ if(INDI_FOUND)
+     ## Linux + MacOS Lite: Requires INDI Qt5 Client
+     ## Android: Requires INDI Qt5 Client built for Android
+     if (NOT ANDROID)
+-        # GSL
+-        find_package(GSL REQUIRED)
+-        include_directories(${GSL_INCLUDE_DIRS})
+-        target_link_libraries(KStarsLib ${GSL_LIBRARIES} 
${CMAKE_THREAD_LIBS_INIT} KF5::Notifications)
++        target_link_libraries(KStarsLib ${CMAKE_THREAD_LIBS_INIT})
+         # StellarSolver
+         target_link_libraries(KStarsLib StellarSolver::stellarsolver)
+     endif ()
+-- 
+GitLab
+

diff --git a/sci-astronomy/kstars/kstars-3.6.5.ebuild 
b/sci-astronomy/kstars/kstars-3.6.5.ebuild
index 795566f25b35..79f688b6c33e 100644
--- a/sci-astronomy/kstars/kstars-3.6.5.ebuild
+++ b/sci-astronomy/kstars/kstars-3.6.5.ebuild
@@ -74,8 +74,11 @@ RDEPEND="${COMMON_DEPEND}
        >=dev-qt/qtquickcontrols2-${QTMIN}:5
 "
 
-# https://invent.kde.org/education/kstars/-/issues/251
-PATCHES=( "${FILESDIR}/${P}-buildfix.patch" )
+PATCHES=(
+       # https://invent.kde.org/education/kstars/-/issues/251
+       "${FILESDIR}/${P}-buildfix.patch"
+       "${FILESDIR}/${P}-gsl.patch" # bug 911199
+)
 
 src_configure() {
        local mycmakeargs=(

Reply via email to