[vlc-commits] contribs: chromaprint: more fixes for .pc file.

Konstantin Pavlov git at videolan.org
Sat Dec 9 08:54:13 CET 2017


vlc/vlc-3.0 | branch: master | Konstantin Pavlov <thresh at videolan.org> | Fri Dec  8 12:12:30 2017 +0000| [23dc5ff50abcaedbc947a9a03302b16f61d2e56e] | committer: Konstantin Pavlov

contribs: chromaprint: more fixes for .pc file.

- Moved AVFFT check: FFMPEG_LIBRARIES might be unset even if
all needed FFmpeg libraries were found.
- Added an ability to link with VDSP/Accelerate Framework on macOS.

(cherry picked from commit f1c8cc80325c0a108e31d1aa7fec947ef880992d)
Signed-off-by: Konstantin Pavlov <thresh at videolan.org>

> http://git.videolan.org/gitweb.cgi/vlc/vlc-3.0.git/?a=commit;h=23dc5ff50abcaedbc947a9a03302b16f61d2e56e
---

 contrib/src/chromaprint/avutil.patch   | 32 --------------------------
 contrib/src/chromaprint/linklibs.patch | 42 ++++++++++++++++++++++++++++++++++
 contrib/src/chromaprint/rules.mak      |  2 +-
 3 files changed, 43 insertions(+), 33 deletions(-)

diff --git a/contrib/src/chromaprint/avutil.patch b/contrib/src/chromaprint/avutil.patch
deleted file mode 100644
index 8055cd91c2..0000000000
--- a/contrib/src/chromaprint/avutil.patch
+++ /dev/null
@@ -1,32 +0,0 @@
---- chromaprint/src/fft_lib_avfft.h.ORIG	2016-12-28 15:10:42.000000000 -0500
-+++ chromaprint/src/fft_lib_avfft.h	2017-12-06 20:37:33.723124874 -0500
-@@ -5,6 +5,7 @@
- #define CHROMAPRINT_FFT_LIB_AVFFT_H_
- 
- extern "C" {
-+#include <libavutil/mem.h>
- #include <libavcodec/avcodec.h>
- #include <libavcodec/avfft.h>
- #include <libavutil/mem.h>
---- chromaprint/libchromaprint.pc.cmake.ORIG	2016-12-28 15:10:42.000000000 -0500
-+++ chromaprint/libchromaprint.pc.cmake	2017-12-06 21:11:55.612701955 -0500
-@@ -7,6 +7,6 @@
- Description: Audio fingerprint library
- URL: http://acoustid.org/chromaprint
- Version: ${PROJECT_VERSION}
--Libs: -L${LIB_INSTALL_DIR} -lchromaprint
-+Libs: -L${LIB_INSTALL_DIR} -lchromaprint ${CHROMAPRINT_LIBS_AVFFT}
- Cflags: -I${INCLUDE_INSTALL_DIR}
- 
---- chromaprint/CMakeLists.txt.ORIG	2016-12-28 15:10:42.000000000 -0500
-+++ chromaprint/CMakeLists.txt	2017-12-06 21:59:26.164398701 -0500
-@@ -96,6 +96,9 @@
- 	check_function_exists(av_frame_alloc HAVE_AV_FRAME_ALLOC)
- 	check_function_exists(av_frame_free HAVE_AV_FRAME_FREE)
- 	cmake_pop_check_state()
-+	find_package(PkgConfig)
-+	pkg_check_modules(AVFFT REQUIRED libavcodec libavutil)
-+	string(REPLACE ";" " " CHROMAPRINT_LIBS_AVFFT "${AVFFT_LDFLAGS}")
- endif()
- 
- if(NOT FFT_LIB OR FFT_LIB STREQUAL "fftw3" OR FFT_LIB STREQUAL "fftw3f")
diff --git a/contrib/src/chromaprint/linklibs.patch b/contrib/src/chromaprint/linklibs.patch
new file mode 100644
index 0000000000..de4fb88f8e
--- /dev/null
+++ b/contrib/src/chromaprint/linklibs.patch
@@ -0,0 +1,42 @@
+diff -urN chromaprint.orig/CMakeLists.txt chromaprint/CMakeLists.txt
+--- chromaprint.orig/CMakeLists.txt	2016-12-28 21:10:42.000000000 +0100
++++ chromaprint/CMakeLists.txt	2017-12-08 14:59:39.000000000 +0100
+@@ -135,12 +135,16 @@
+ if(FFT_LIB STREQUAL "vdsp")
+ 	if(ACCELERATE_LIBRARIES)
+ 		set(USE_VDSP ON)
++		set(CHROMAPRINT_ADDITIONAL_LIBS "-F${ACCELERATE_LIBRARIES} -framework Accelerate")
+ 	else()
+ 		message(FATAL_ERROR "Selected ${FFT_LIB} for FFT calculations, but the library is not found")
+ 	endif()
+ elseif(FFT_LIB STREQUAL "avfft")
+ 	if(FFMPEG_LIBAVCODEC_FFT_FOUND)
+ 		set(USE_AVFFT ON)
++		find_package(PkgConfig)
++		pkg_check_modules(AVFFT REQUIRED libavcodec libavutil)
++		string(REPLACE ";" " " CHROMAPRINT_ADDITIONAL_LIBS "${AVFFT_LDFLAGS}")
+ 	else()
+ 		message(FATAL_ERROR "Selected ${FFT_LIB} for FFT calculations, but the library is not found")
+ 	endif()
+diff -urN chromaprint.orig/libchromaprint.pc.cmake chromaprint/libchromaprint.pc.cmake
+--- chromaprint.orig/libchromaprint.pc.cmake	2016-12-28 21:10:42.000000000 +0100
++++ chromaprint/libchromaprint.pc.cmake	2017-12-08 14:56:22.000000000 +0100
+@@ -7,6 +7,6 @@
+ Description: Audio fingerprint library
+ URL: http://acoustid.org/chromaprint
+ Version: ${PROJECT_VERSION}
+-Libs: -L${LIB_INSTALL_DIR} -lchromaprint
++Libs: -L${LIB_INSTALL_DIR} -lchromaprint ${CHROMAPRINT_ADDITIONAL_LIBS}
+ Cflags: -I${INCLUDE_INSTALL_DIR}
+ 
+diff -urN chromaprint.orig/src/fft_lib_avfft.h chromaprint/src/fft_lib_avfft.h
+--- chromaprint.orig/src/fft_lib_avfft.h	2016-12-28 21:10:42.000000000 +0100
++++ chromaprint/src/fft_lib_avfft.h	2017-12-08 14:55:35.000000000 +0100
+@@ -5,6 +5,7 @@
+ #define CHROMAPRINT_FFT_LIB_AVFFT_H_
+ 
+ extern "C" {
++#include <libavutil/mem.h>
+ #include <libavcodec/avcodec.h>
+ #include <libavcodec/avfft.h>
+ #include <libavutil/mem.h>
diff --git a/contrib/src/chromaprint/rules.mak b/contrib/src/chromaprint/rules.mak
index 0473504d81..235b2cdd99 100644
--- a/contrib/src/chromaprint/rules.mak
+++ b/contrib/src/chromaprint/rules.mak
@@ -15,7 +15,7 @@ $(TARBALLS)/chromaprint-$(CHROMAPRINT_VERSION).tar.gz:
 
 chromaprint: chromaprint-$(CHROMAPRINT_VERSION).tar.gz .sum-chromaprint
 	$(UNPACK)
-	$(APPLY) $(SRC)/chromaprint/avutil.patch
+	$(APPLY) $(SRC)/chromaprint/linklibs.patch
 	$(MOVE)
 
 DEPS_chromaprint = ffmpeg $(DEPS_ffmpeg)



More information about the vlc-commits mailing list