commit:     f747ba062e648f090c223540ad9d3266fcfe2e7e
Author:     NHOrus <jy6x2b32pie9 <AT> yahoo <DOT> com>
AuthorDate: Tue Mar 25 18:29:00 2025 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Sat Apr 12 20:54:20 2025 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=f747ba06

sci-mathematics/fann: update EAPI 7 -> 8, other fixes

Patch out bundled GTest, fix install directory for pkg-config files

Closes: https://bugs.gentoo.org/951922
Closes: https://bugs.gentoo.org/863050
Signed-off-by: NHOrus <jy6x2b32pie9 <AT> yahoo.com>
Closes: https://github.com/gentoo/gentoo/pull/41260
Signed-off-by: Sam James <sam <AT> gentoo.org>

 sci-mathematics/fann/fann-9999.ebuild            | 33 +++++++++++++++++++++---
 sci-mathematics/fann/files/fann-9999-cmake.patch | 23 +++++++++++++++++
 2 files changed, 52 insertions(+), 4 deletions(-)

diff --git a/sci-mathematics/fann/fann-9999.ebuild 
b/sci-mathematics/fann/fann-9999.ebuild
index e41c4a9c2643..c372b336d248 100644
--- a/sci-mathematics/fann/fann-9999.ebuild
+++ b/sci-mathematics/fann/fann-9999.ebuild
@@ -1,17 +1,42 @@
-# Copyright 1999-2022 Gentoo Authors
+# Copyright 1999-2025 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
-EAPI=7
+EAPI=8
 
 inherit cmake git-r3 toolchain-funcs
 
 DESCRIPTION="Fast Artificial Neural Network Library"
-HOMEPAGE="http://leenissen.dk/fann/wp/";
+HOMEPAGE="https://leenissen.dk";
 EGIT_REPO_URI="https://github.com/libfann/fann";
 
 LICENSE="LGPL-2.1"
 SLOT="0"
-IUSE="examples"
+IUSE="examples test"
+RESTRICT="!test? ( test )"
+
+BDEPEND="
+       test? ( dev-cpp/gtest )
+"
+
+PATCHES=(
+       "${FILESDIR}/${P}-cmake.patch"
+)
+
+src_prepare() {
+       cmake_src_prepare
+
+       if use !test; then
+               sed -i '/ADD_SUBDIRECTORY( tests )/d' CMakeLists.txt || die
+       fi
+}
+
+src_configure() {
+       local mycmakeargs=(
+               # https://bugs.gentoo.org/863050
+               -DPKGCONFIG_INSTALL_DIR="${EPREFIX}/$(get_libdir)/pkgconfig"
+       )
+       cmake_src_configure
+}
 
 src_test() {
        cd examples || die 'fails to enter examples directory'

diff --git a/sci-mathematics/fann/files/fann-9999-cmake.patch 
b/sci-mathematics/fann/files/fann-9999-cmake.patch
new file mode 100644
index 000000000000..a121cc58e0be
--- /dev/null
+++ b/sci-mathematics/fann/files/fann-9999-cmake.patch
@@ -0,0 +1,23 @@
+Bump minimum CMake version to fix build with CMake 4
+Unbundle gtest
+https://bugs.gentoo.org/863050
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -38,7 +38,7 @@
+         ENDIF()
+       ENDIF()
+ ELSE()
+-cmake_minimum_required (VERSION 2.8)
++cmake_minimum_required (VERSION 3.5)
+ 
+ if (NOT DEFINED CMAKE_BUILD_TYPE)
+     set (CMAKE_BUILD_TYPE Release CACHE STRING "Build type")
+@@ -161,8 +161,6 @@
+ 
+ ################# compile tests ################
+ 
+-ADD_SUBDIRECTORY( lib/googletest )
+-
+ if(COMPILER_SUPPORTS_CXX11)
+   ADD_SUBDIRECTORY( tests )
+ endif()

Reply via email to