public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-commits] repo/gentoo:master commit in: profiles/base/, sci-libs/flann/, sci-libs/flann/files/
@ 2025-01-06 21:32 Sam James
  0 siblings, 0 replies; only message in thread
From: Sam James @ 2025-01-06 21:32 UTC (permalink / raw
  To: gentoo-commits

commit:     4db46c950246613586189689f3f05e5c6e7e0717
Author:     Paul Zander <negril.nx+gentoo <AT> gmail <DOT> com>
AuthorDate: Mon Jan  6 19:29:46 2025 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Mon Jan  6 21:32:03 2025 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=4db46c95

sci-libs/flann: add 1.9.2_p20221027, drop 1.9.2

uses latest upstream commit

update cmake code, handle warnings
use enable_language for cuda and fix warnings in code
use find_package(Python) instead of PythonInterp
fix erroneous dependency for doc, unmask the flag

Closes: https://bugs.gentoo.org/947608
Closes: https://bugs.gentoo.org/947602
Closes: https://bugs.gentoo.org/946465
Closes: https://bugs.gentoo.org/829080
Bug: https://bugs.gentoo.org/830013
Signed-off-by: Paul Zander <negril.nx+gentoo <AT> gmail.com>
Signed-off-by: Sam James <sam <AT> gentoo.org>

 profiles/base/package.use.mask                     |  3 +-
 sci-libs/flann/Manifest                            |  3 +-
 .../flann/files/flann-1.9.2-system-gtest.patch     | 36 +++++++++
 ...n-1.9.2.ebuild => flann-1.9.2_p20221027.ebuild} | 88 ++++++++++++++++------
 4 files changed, 105 insertions(+), 25 deletions(-)

diff --git a/profiles/base/package.use.mask b/profiles/base/package.use.mask
index 980738cff4e7..9095e9ee0e6f 100644
--- a/profiles/base/package.use.mask
+++ b/profiles/base/package.use.mask
@@ -516,7 +516,8 @@ dev-util/rizin test
 # Sam James <sam@gentoo.org> (2021-12-27)
 # Doc building is broken and no new releases in a long time.
 # bug #830013
-sci-libs/flann doc
+# fixed in sci-libs/flann-1.9.2-20221027
+<=sci-libs/flann-1.9.2 doc
 
 # Joonas Niilola <juippis@gentoo.org> (2021-12-20)
 # Broken, upstream issue/PR open since 2021-05 without reply.

diff --git a/sci-libs/flann/Manifest b/sci-libs/flann/Manifest
index 96227eff8fec..14d4573ca58f 100644
--- a/sci-libs/flann/Manifest
+++ b/sci-libs/flann/Manifest
@@ -1,2 +1,3 @@
 DIST flann-1.9.1.tar.gz 485391 BLAKE2B bf1e1e7feb33e939e1d0586db593bea3fdf66726fbadec63df9ed9c7bdb678babb11001769f0d041a7a569186b3d700db8b96af5eb9740615f6dfd880460f68b SHA512 0da78bb14111013318160dd3dee1f93eb6ed077b18439fd6496017b62a8a6070cc859cfb3e08dad4c614e48d9dc1da5f7c4a21726ee45896d360506da074a6f7
-DIST flann-1.9.2.tar.gz 34641759 BLAKE2B 92a31ac2c39e4e41c9d985735c318f800fbf65053784a3afe8301df7529cb0203f7fdde2544d0615add56fa823f7123b09ae9b3ca5277250a5a7e9c5108f6f97 SHA512 e1235383e4e3919607cd1417738220c1601342dcf908071a6f75039c45116bd558d9f0534be037b1a8ac5b4ba5b0be5b62bf1d96e44911f14b34f73d941addb2
+DIST flann-1.9.2_p20221027-patches.tar.xz 10232 BLAKE2B 197dd8b81f4a7a43472e440de58a6eb7349e247514ac32a4de9d5c4ea9304da2ab6991f9561dd15fd005a4a55b14f40e4de05b324c55c50632fe9b8cd1f18371 SHA512 04bb6ff3d645ead761b37aa1e8873dc39cc8f910112fc64a55a941a4c0ab9d70a37caf018f1cc649debff04f0ac7cbbd0eb439a8a8d03b879bcddb73979e91c3
+DIST flann-1.9.2_p20221027.tar.gz 34644592 BLAKE2B 822afa518a1efcfd552cee7c9bd9e14587a450d5ddae50c4d225453ab56d7297ca73f5b5bda153aea9ff37e736942057ae071ac41e3d26ac1aeb03a408171162 SHA512 14cd7d3249109ce66c43258f8b9d158efa3b57f654708e76751290eba25e2cb7fc8044a1d882c6b24d0cda1a8b206709acdb5338086ca1f2d60fef35f0fa85be

diff --git a/sci-libs/flann/files/flann-1.9.2-system-gtest.patch b/sci-libs/flann/files/flann-1.9.2-system-gtest.patch
new file mode 100644
index 000000000000..f825cf3d529b
--- /dev/null
+++ b/sci-libs/flann/files/flann-1.9.2-system-gtest.patch
@@ -0,0 +1,36 @@
+From 4001b11f20ccfc291a355c52a090fa16e2f5a5f1 Mon Sep 17 00:00:00 2001
+From: Paul Zander <negril.nx+gentoo@gmail.com>
+Date: Mon, 6 Jan 2025 16:13:09 +0100
+Subject: [PATCH] system gtest
+
+Signed-off-by: Paul Zander <negril.nx+gentoo@gmail.com>
+
+diff --git a/cmake/flann_utils.cmake b/cmake/flann_utils.cmake
+index e02a6ff..544f87a 100644
+--- a/cmake/flann_utils.cmake
++++ b/cmake/flann_utils.cmake
+@@ -41,6 +41,13 @@ macro(find_hdf5)
+ endmacro(find_hdf5)
+ 
+ 
++if(BUILD_TESTS)
++enable_testing()
++find_package(GTest)
++if(GTest_FOUND)
++    set(googletest_LIBRARIES GTest::gtest)
++    add_library(googletest ALIAS GTest::gtest)
++else()
+ # Enable ExternalProject CMake module
+ include(ExternalProject)
+ 
+@@ -69,6 +76,8 @@ set(googletest_INCLUDE_DIRS ${source_dir}/googletest/include)
+ ExternalProject_Get_Property(googletest binary_dir)
+ set(googletest_LIBRARIES ${binary_dir}/lib/libgtest.a)
+ include_directories(${googletest_INCLUDE_DIRS})
++endif()
++endif()
+ 
+ 
+ macro(flann_add_gtest exe src)
+-- 
+2.47.1

diff --git a/sci-libs/flann/flann-1.9.2.ebuild b/sci-libs/flann/flann-1.9.2_p20221027.ebuild
similarity index 52%
rename from sci-libs/flann/flann-1.9.2.ebuild
rename to sci-libs/flann/flann-1.9.2_p20221027.ebuild
index f08ec70da1b4..d628a4efa00f 100644
--- a/sci-libs/flann/flann-1.9.2.ebuild
+++ b/sci-libs/flann/flann-1.9.2_p20221027.ebuild
@@ -7,36 +7,51 @@ inherit cmake cuda toolchain-funcs
 
 DESCRIPTION="Fast approximate nearest neighbor searches in high dimensional spaces"
 HOMEPAGE="https://github.com/flann-lib/flann"
-SRC_URI="https://github.com/flann-lib/${PN}/archive/${PV}.tar.gz -> ${P}.tar.gz"
+COMMIT="f9caaf609d8b8cb2b7104a85cf59eb92c275a25d"
+SRC_URI="
+	https://github.com/flann-lib/${PN}/archive/${COMMIT}.tar.gz
+		-> ${P}.tar.gz
+	https://dev.gentoo.org/~sam/distfiles/${CATEGORY}/${PN}/${P}-patches.tar.xz
+"
+S="${WORKDIR}/${PN}-${COMMIT}"
 
 LICENSE="BSD"
 SLOT="0"
 KEYWORDS="~amd64 ~arm ~arm64 ~ppc ~x86 ~amd64-linux ~x86-linux"
-IUSE="cuda doc examples mpi octave openmp"
+IUSE="cuda doc examples mpi octave openmp test"
+RESTRICT="!test? ( test )"
 
 BDEPEND="
-	app-arch/unzip
-	doc? ( dev-tex/latex2html )
-	mpi? ( app-admin/chrpath )
+	doc? (
+		dev-tex/latex2html
+	)
+	mpi? (
+		app-admin/chrpath
+	)
 "
 DEPEND="
 	app-arch/lz4:=
-	cuda? ( >=dev-util/nvidia-cuda-toolkit-5.5 )
+	cuda? (
+		dev-util/nvidia-cuda-toolkit:=
+	)
+	examples? (
+		sci-libs/hdf5:=[mpi?]
+	)
 	mpi? (
 		dev-libs/boost:=[mpi]
-		sci-libs/hdf5:=[mpi=]
+		sci-libs/hdf5[mpi]
+	)
+	octave? (
+		>=sci-mathematics/octave-3.6.4-r1:=
 	)
-	octave? ( >=sci-mathematics/octave-3.6.4-r1:= )
 "
 RDEPEND="${DEPEND}"
-# TODO:
-# readd dependencies for test suite,
-# requires multiple ruby dependencies
 
 PATCHES=(
 	"${FILESDIR}"/${PN}-1.9.1-build-oct-rather-than-mex-files-for-octave.patch # bug 830424
 	"${FILESDIR}"/${PN}-1.9.2-asio-boost187.patch
 	"${FILESDIR}"/${PN}-1.9.2-boost-config.patch
+	"${FILESDIR}"/${PN}-1.9.2-system-gtest.patch
 )
 
 pkg_pretend() {
@@ -51,39 +66,66 @@ src_prepare() {
 	# bug #302621
 	use mpi && export CXX=mpicxx
 
-	use cuda && cuda_src_prepare
-
 	cmake_src_prepare
+	for patch in "${WORKDIR}/${P}-patches"/*; do
+		eapply "${patch}"
+	done
 }
 
 src_configure() {
+
 	# python bindings are split off into dev-python/pyflann
 	local mycmakeargs=(
 		-DCMAKE_CXX_STANDARD=17
-		-DBUILD_C_BINDINGS=ON
-		-DBUILD_PYTHON_BINDINGS=OFF
+		-DBUILD_C_BINDINGS="yes"
+		-DBUILD_PYTHON_BINDINGS="no"
 		-DBUILD_CUDA_LIB="$(usex cuda)"
 		-DBUILD_EXAMPLES="$(usex examples)"
 		-DBUILD_DOC="$(usex doc)"
-		-DBUILD_TESTS=OFF
+		-DBUILD_TESTS="$(usex test)"
 		-DBUILD_MATLAB_BINDINGS="$(usex octave)"
-		-DUSE_MPI="$(usex mpi)"
+		-DUSE_MPI="$(usex test "$(usex mpi)")"
 		-DUSE_OPENMP="$(usex openmp)"
+		-DCMAKE_BUILD_STATIC_LIBS="no"
 	)
 
-	# einfo "NVCCFLAGS ${NVCCFLAGS}"
-	use cuda && mycmakeargs+=(
-		# -DCUDA_NVCC_FLAGS="${NVCCFLAGS} --linker-options \"-arsch\""
-		-DCUDA_NVCC_FLAGS="--compiler-bindir;$(cuda_gccdir)"
-	)
+	if use cuda; then
+		cuda_add_sandbox -w
+
+		mycmakeargs+=(
+			-DCMAKE_CUDA_FLAGS="-Xcudafe \"--diag_suppress=partial_override\""
+		)
+		export CUDAHOSTCXX="$(cuda_gccdir)"
+		export CUDAHOSTLD="$(tc-getCXX)"
+	fi
+
 	use doc && mycmakeargs+=( -DDOCDIR="share/doc/${PF}" )
 
 	cmake_src_configure
 }
 
+src_compile() {
+	local targets=( "all" )
+
+	use doc && targets+=( "doc" )
+
+	if use test; then
+		targets+=( "flann_gtests" )
+		if use cuda; then
+			targets+=( "flann_cuda_test" )
+		fi
+	fi
+
+	cmake_src_compile "${targets[@]}"
+}
+
+src_test() {
+	# some fail when run in parallel
+	cmake_src_test -j1
+}
+
 src_install() {
 	cmake_src_install
-	find "${ED}" -name 'lib*.a' -delete || die
 
 	# bug 795828; mpicc voluntarily adds some runpaths
 	if use mpi; then


^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2025-01-06 21:32 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-01-06 21:32 [gentoo-commits] repo/gentoo:master commit in: profiles/base/, sci-libs/flann/, sci-libs/flann/files/ Sam James

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox