Commit f1c8cc80 authored by Konstantin Pavlov's avatar 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.
parent 45aee180
--- 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 -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>
......@@ -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)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment