commit:     dae7a28fc5396b340b9d337600d7be3ed4e95098
Author:     Andreas Sturmlechner <asturm <AT> gentoo <DOT> org>
AuthorDate: Tue Sep  9 15:57:09 2025 +0000
Commit:     Andreas Sturmlechner <asturm <AT> gentoo <DOT> org>
CommitDate: Tue Sep  9 18:00:27 2025 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=dae7a28f

sci-libs/stellarsolver: add 2.7

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

 sci-libs/stellarsolver/Manifest                    |  1 +
 .../stellarsolver-2.7-file-descriptor-leak.patch   | 23 ++++++++++++++
 sci-libs/stellarsolver/stellarsolver-2.7.ebuild    | 37 ++++++++++++++++++++++
 3 files changed, 61 insertions(+)

diff --git a/sci-libs/stellarsolver/Manifest b/sci-libs/stellarsolver/Manifest
index e3e3e3ee8cbb..1b16c0af5c5d 100644
--- a/sci-libs/stellarsolver/Manifest
+++ b/sci-libs/stellarsolver/Manifest
@@ -1 +1,2 @@
 DIST stellarsolver-2.6.tar.gz 26565848 BLAKE2B 
35cceedca14b6fc062d963a47954b1c06ef908f4f8572776ca4de6a4b618eb72445cf05aefc5c62fa7a0a55e3719e6201f5734a827fc2fe752b919a30bd9c0cc
 SHA512 
28c15e1cbc4e5d9b852001b80e8183ea98557ef0bdf0c9b3a238485d9594058bbd7003abc77cb41caf6717c809c7a3d1babd236adbeac6bb0e383f5a73815e95
+DIST stellarsolver-2.7.tar.gz 26567114 BLAKE2B 
cacf5fad2055ad3e4e30b623be1f07742076939d59dca17854d0e0a8fec7862464b235690e1681daf72ea17f11fa9446c38c1bbb44004cd55c7ef6d47edd5e61
 SHA512 
f666023bcc4e5c83d5a88224ebe524a490852d7b2aab89a52f596aa891f965367a6057997592eab50035f55565e330cf0a48074d2bf339fbaa78afdf56fda876

diff --git 
a/sci-libs/stellarsolver/files/stellarsolver-2.7-file-descriptor-leak.patch 
b/sci-libs/stellarsolver/files/stellarsolver-2.7-file-descriptor-leak.patch
new file mode 100644
index 000000000000..e0f3e5230688
--- /dev/null
+++ b/sci-libs/stellarsolver/files/stellarsolver-2.7-file-descriptor-leak.patch
@@ -0,0 +1,23 @@
+From 9abe16cd615715ec961f6b2e61870d480861c93d Mon Sep 17 00:00:00 2001
+From: John Evans <[email protected]>
+Date: Mon, 16 Jun 2025 07:46:38 +0100
+Subject: [PATCH] fix file descriptor leak on index files
+
+---
+ stellarsolver/astrometry/qfits-an/qfits_rw.c | 3 +++
+ 1 file changed, 3 insertions(+)
+
+diff --git a/stellarsolver/astrometry/qfits-an/qfits_rw.c 
b/stellarsolver/astrometry/qfits-an/qfits_rw.c
+index e388a33..20746cf 100644
+--- a/stellarsolver/astrometry/qfits-an/qfits_rw.c
++++ b/stellarsolver/astrometry/qfits-an/qfits_rw.c
+@@ -229,6 +229,9 @@ int qfits_is_fits(const char * filename)
+     magic = qfits_calloc(FITS_MAGIC_SZ+1, sizeof(char));
+     if (fread(magic, 1, FITS_MAGIC_SZ, fp) != FITS_MAGIC_SZ) {
+               qfits_error("failed to read file [%s]: %s", filename, 
strerror(errno));
++        // Tidy up to avoid leaking file descriptors
++        fclose(fp);
++        qfits_free(magic);
+               return -1;
+       }
+     fclose(fp);

diff --git a/sci-libs/stellarsolver/stellarsolver-2.7.ebuild 
b/sci-libs/stellarsolver/stellarsolver-2.7.ebuild
new file mode 100644
index 000000000000..4ea069830719
--- /dev/null
+++ b/sci-libs/stellarsolver/stellarsolver-2.7.ebuild
@@ -0,0 +1,37 @@
+# Copyright 1999-2025 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+inherit cmake flag-o-matic
+
+DESCRIPTION="Cross-platform Sextractor and Astrometry.net-Based internal 
astrometric solver"
+HOMEPAGE="https://github.com/rlancaste/stellarsolver";
+SRC_URI="https://github.com/rlancaste/${PN}/archive/${PV}.tar.gz -> 
${P}.tar.gz"
+
+LICENSE="BSD GPL-3"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE=""
+
+RDEPEND="
+       dev-qt/qtbase:6[concurrent,gui,network,widgets]
+       sci-libs/cfitsio:=
+       sci-libs/gsl:=
+       sci-astronomy/wcslib:=
+"
+DEPEND="${RDEPEND}"
+
+PATCHES=( "${FILESDIR}/${P}-file-descriptor-leak.patch" )
+
+src_configure() {
+       # bug #862930
+       filter-lto
+
+       local mycmakeargs=(
+               -DUSE_QT5=OFF
+               -DBUILD_CLI=OFF # nothing is installed (yet?)
+       )
+
+       cmake_src_configure
+}

Reply via email to