contribs: chromaprint: more fixes for .pc file.
[vlc.git] / contrib / src / chromaprint / linklibs.patch
1 diff -urN chromaprint.orig/CMakeLists.txt chromaprint/CMakeLists.txt
2 --- chromaprint.orig/CMakeLists.txt     2016-12-28 21:10:42.000000000 +0100
3 +++ chromaprint/CMakeLists.txt  2017-12-08 14:59:39.000000000 +0100
4 @@ -135,12 +135,16 @@
5  if(FFT_LIB STREQUAL "vdsp")
6         if(ACCELERATE_LIBRARIES)
7                 set(USE_VDSP ON)
8 +               set(CHROMAPRINT_ADDITIONAL_LIBS "-F${ACCELERATE_LIBRARIES} -framework Accelerate")
9         else()
10                 message(FATAL_ERROR "Selected ${FFT_LIB} for FFT calculations, but the library is not found")
11         endif()
12  elseif(FFT_LIB STREQUAL "avfft")
13         if(FFMPEG_LIBAVCODEC_FFT_FOUND)
14                 set(USE_AVFFT ON)
15 +               find_package(PkgConfig)
16 +               pkg_check_modules(AVFFT REQUIRED libavcodec libavutil)
17 +               string(REPLACE ";" " " CHROMAPRINT_ADDITIONAL_LIBS "${AVFFT_LDFLAGS}")
18         else()
19                 message(FATAL_ERROR "Selected ${FFT_LIB} for FFT calculations, but the library is not found")
20         endif()
21 diff -urN chromaprint.orig/libchromaprint.pc.cmake chromaprint/libchromaprint.pc.cmake
22 --- chromaprint.orig/libchromaprint.pc.cmake    2016-12-28 21:10:42.000000000 +0100
23 +++ chromaprint/libchromaprint.pc.cmake 2017-12-08 14:56:22.000000000 +0100
24 @@ -7,6 +7,6 @@
25  Description: Audio fingerprint library
26  URL: http://acoustid.org/chromaprint
27  Version: ${PROJECT_VERSION}
28 -Libs: -L${LIB_INSTALL_DIR} -lchromaprint
29 +Libs: -L${LIB_INSTALL_DIR} -lchromaprint ${CHROMAPRINT_ADDITIONAL_LIBS}
30  Cflags: -I${INCLUDE_INSTALL_DIR}
31  
32 diff -urN chromaprint.orig/src/fft_lib_avfft.h chromaprint/src/fft_lib_avfft.h
33 --- chromaprint.orig/src/fft_lib_avfft.h        2016-12-28 21:10:42.000000000 +0100
34 +++ chromaprint/src/fft_lib_avfft.h     2017-12-08 14:55:35.000000000 +0100
35 @@ -5,6 +5,7 @@
36  #define CHROMAPRINT_FFT_LIB_AVFFT_H_
37  
38  extern "C" {
39 +#include <libavutil/mem.h>
40  #include <libavcodec/avcodec.h>
41  #include <libavcodec/avfft.h>
42  #include <libavutil/mem.h>