commit:     43387f0cbb30a5eef90cd97855ece1e9841711d0
Author:     Nicolas PARLANT <nicolas.parlant <AT> parhuet <DOT> fr>
AuthorDate: Mon Nov 24 12:17:40 2025 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Wed Nov 26 02:21:38 2025 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=43387f0c

media-libs/chromaprint: restore ffmpeg, unbundle gtest

update metadata : repo is on github, rm googletest

restore ffmpeg (bug 833821) if tools is enabled
remove definition for AUDIO_PROCESSOR_LIB because libavsamplerate is no
longer checked
for FFT_LIB, use avtx instead of avfft, removed in ffmpeg-8.0

remove 3rdparty :
unbundle gtest (and set gnu++17 for that)
remove kissfft, unused and with QA_CMAKE warn

rm custom multilib_src_test, unneeded to launch the testsuite

Bug: https://bugs.gentoo.org/833821
Closes: https://bugs.gentoo.org/938521
Closes: https://bugs.gentoo.org/965538
Closes: https://bugs.gentoo.org/965539
Signed-off-by: Nicolas PARLANT <nicolas.parlant <AT> parhuet.fr>
Part-of: https://github.com/gentoo/gentoo/pull/44757
Signed-off-by: Sam James <sam <AT> gentoo.org>

 media-libs/chromaprint/chromaprint-1.6.0-r1.ebuild | 53 ++++++++++++++++++++++
 .../files/chromaprint-1.6.0-unbundle_gtest.patch   | 41 +++++++++++++++++
 media-libs/chromaprint/metadata.xml                |  3 +-
 3 files changed, 95 insertions(+), 2 deletions(-)

diff --git a/media-libs/chromaprint/chromaprint-1.6.0-r1.ebuild 
b/media-libs/chromaprint/chromaprint-1.6.0-r1.ebuild
new file mode 100644
index 000000000000..20a3df6f81d6
--- /dev/null
+++ b/media-libs/chromaprint/chromaprint-1.6.0-r1.ebuild
@@ -0,0 +1,53 @@
+# Copyright 1999-2025 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+inherit cmake-multilib
+
+DESCRIPTION="Library implementing a custom algorithm for extracting audio 
fingerprints"
+HOMEPAGE="https://acoustid.org/chromaprint";
+SRC_URI="https://github.com/acoustid/${PN}/releases/download/v${PV}/${P}.tar.gz";
+
+LICENSE="LGPL-2.1"
+SLOT="0/1"
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~mips ~ppc ~ppc64 ~riscv ~sparc ~x86"
+IUSE="test tools"
+RESTRICT="!test? ( test )"
+
+# - Default to fftw to avoid awkward circular dependency w/ ffmpeg
+# See bug #833821 for an example
+RDEPEND="
+       tools? ( >=media-video/ffmpeg-5:=[${MULTILIB_USEDEP}] )
+       !tools? ( sci-libs/fftw:=[${MULTILIB_USEDEP}] )
+"
+DEPEND="
+       ${RDEPEND}
+       test? ( dev-cpp/gtest[${MULTILIB_USEDEP}] )
+"
+
+DOCS=( NEWS.txt README.md )
+
+PATCHES=(
+       "${FILESDIR}"/${PN}-1.6.0-unbundle_gtest.patch
+)
+
+src_prepare() {
+       # remove gtest (unbundled) and fftkiss (unused)
+       rm -r src/3rdparty || die
+       cmake_src_prepare
+}
+
+multilib_src_configure() {
+       local mycmakeargs=(
+               -DBUILD_TESTS=$(usex test)
+               -DBUILD_TOOLS=$(multilib_native_usex tools)
+               -DFFT_LIB=$(usex tools 'avtx' 'fftw3')
+               # Automagicallyish looks for ffmpeg, but there's no point
+               # even doing the check unless we're building with tools
+               # (=> without fftw3, and with ffmpeg).
+               -DCMAKE_DISABLE_FIND_PACKAGE_FFmpeg=$(multilib_native_usex 
!tools)
+       )
+
+       cmake_src_configure
+}

diff --git 
a/media-libs/chromaprint/files/chromaprint-1.6.0-unbundle_gtest.patch 
b/media-libs/chromaprint/files/chromaprint-1.6.0-unbundle_gtest.patch
new file mode 100644
index 000000000000..4c0c7b67a8c7
--- /dev/null
+++ b/media-libs/chromaprint/files/chromaprint-1.6.0-unbundle_gtest.patch
@@ -0,0 +1,41 @@
+unbundle gtest
+set gnu++17 for >=gtest-1.17
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -27,7 +27,7 @@ find_package(Threads)
+ 
+ option(BUILD_SHARED_LIBS "Build shared libraries" ON)
+ 
+-set(CMAKE_CXX_STANDARD 14)
++set(CMAKE_CXX_STANDARD 17)
+ 
+ if(BUILD_SHARED_LIBS)
+   set(CMAKE_C_VISIBILITY_PRESET hidden)
+--- a/tests/CMakeLists.txt
++++ b/tests/CMakeLists.txt
+@@ -1,13 +1,3 @@
+-include(GoogleTest)
+-
+-set(BUILD_GMOCK OFF CACHE BOOL "" FORCE)
+-set(INSTALL_GTEST OFF CACHE BOOL "" FORCE)
+-mark_as_advanced(BUILD_GMOCK INSTALL_GTEST GTEST_HAS_ABSL)
+-
+-set(gtest_force_shared_crt ON CACHE BOOL "" FORCE)
+-
+-add_subdirectory("${PROJECT_SOURCE_DIR}/src/3rdparty/googletest" 
"test/3rdparty/googletest")
+-
+ add_executable(all_tests 
+   $<TARGET_OBJECTS:chromaprint_objs>
+   main.cpp
+@@ -35,8 +25,10 @@ add_executable(all_tests
+   ../src/utils/rolling_integral_image_test.cpp
+ )
+ 
++find_package(GTest REQUIRED)
++include(GoogleTest)
+ target_include_directories(all_tests PRIVATE ${CMAKE_CURRENT_SOURCE_DIR})
+-target_link_libraries(all_tests PRIVATE chromaprint gtest gtest_main)
++target_link_libraries(all_tests PRIVATE chromaprint GTest::gtest_main)
+ 
+ if(BUILD_TOOLS)
+   target_sources(all_tests PRIVATE ../src/audio/ffmpeg_audio_reader_test.cpp)

diff --git a/media-libs/chromaprint/metadata.xml 
b/media-libs/chromaprint/metadata.xml
index 3f7ed8ab0115..a32f60f1d72f 100644
--- a/media-libs/chromaprint/metadata.xml
+++ b/media-libs/chromaprint/metadata.xml
@@ -9,7 +9,6 @@
     <flag name="tools">Build and install fpcalc and fpcollect tools</flag>
   </use>
   <upstream>
-    <remote-id type="bitbucket">acoustid/chromaprint</remote-id>
-    <remote-id type="github">google/googletest</remote-id>
+    <remote-id type="github">acoustid/chromaprint</remote-id>
   </upstream>
 </pkgmetadata>

Reply via email to