File chromaprint-ffmpeg-pkgconfig.patch of Package chromaprint

---
 cmake/modules/FindFFmpeg.cmake |   71 ++++-------------------------------------
 1 file changed, 8 insertions(+), 63 deletions(-)

Index: chromaprint-1.3.1/cmake/modules/FindFFmpeg.cmake
===================================================================
--- chromaprint-1.3.1.orig/cmake/modules/FindFFmpeg.cmake
+++ chromaprint-1.3.1/cmake/modules/FindFFmpeg.cmake
@@ -25,50 +25,15 @@
 # example: FFMPEG_FIND(AVFORMAT avformat avformat.h)
 MACRO(FFMPEG_FIND varname shortname headername)
 
-	FIND_PATH(FFMPEG_${varname}_INCLUDE_DIRS lib${shortname}/${headername}
-		PATHS
-		${FFMPEG_ROOT}/include
-		$ENV{FFMPEG_DIR}/include
-		~/Library/Frameworks
-		/Library/Frameworks
-		/usr/local/include
-		/usr/include/
-		/sw/include # Fink
-		/opt/local/include # DarwinPorts
-		/opt/csw/include # Blastwave
-		/opt/include
-		/usr/freeware/include
-		NO_DEFAULT_PATH
-		PATH_SUFFIXES ffmpeg
-		DOC "Location of FFMPEG Headers"
-	)
-	FIND_PATH(FFMPEG_${varname}_INCLUDE_DIRS lib${shortname}/${headername}
-		PATH_SUFFIXES ffmpeg
-		DOC "Location of FFMPEG Headers"
-	)
+    PKG_CHECK_MODULES(PC_${shortname} QUIET lib${shortname})
+
+    set(FFMPEG_${varname}_INCLUDE_DIRS ${PC_${shortname}_INCLUDE_DIRS})
+    set(FFMPEG_${varname}_LIB_DIRS ${PC_${shortname}_LIBDIR})
 
     FIND_LIBRARY(FFMPEG_${varname}_LIBRARIES
         NAMES ${shortname}
-        PATHS
-        ${FFMPEG_ROOT}/lib
-        $ENV{FFMPEG_DIR}/lib
-        ~/Library/Frameworks
-        /Library/Frameworks
-        /usr/local/lib
-        /usr/local/lib64
-        /usr/lib
-        /usr/lib64
-        /sw/lib
-        /opt/local/lib
-        /opt/csw/lib
-        /opt/lib
-        /usr/freeware/lib64
-		NO_DEFAULT_PATH
-        DOC "Location of FFMPEG Libraries"
-    )
-    FIND_LIBRARY(FFMPEG_${varname}_LIBRARIES
-        NAMES ${shortname}
-        DOC "Location of FFMPEG Libraries"
+        PATHS FFMPEG_${varname}_LIB_DIRS
+        DOC "Location of FFMPEG ${shortname} Libraries"
     )
 
     IF (FFMPEG_${varname}_LIBRARIES AND FFMPEG_${varname}_INCLUDE_DIRS)
@@ -77,38 +42,18 @@ MACRO(FFMPEG_FIND varname shortname head
 
 ENDMACRO(FFMPEG_FIND)
 
-SET(FFMPEG_ROOT "$ENV{FFMPEG_DIR}" CACHE PATH "Location of FFMPEG")
-
-# find stdint.h
-FIND_PATH(FFMPEG_STDINT_INCLUDE_DIR stdint.h
-    PATHS
-    ${FFMPEG_ROOT}/include
-    $ENV{FFMPEG_DIR}/include
-    ~/Library/Frameworks
-    /Library/Frameworks
-    /usr/local/include
-    /usr/include
-    /sw/include # Fink
-    /opt/local/include # DarwinPorts
-    /opt/csw/include # Blastwave
-    /opt/include
-    /usr/freeware/include
-    PATH_SUFFIXES ffmpeg
-    DOC "Location of FFMPEG stdint.h Header"
-)
+find_package(PkgConfig)
 
 FFMPEG_FIND(LIBAVFORMAT avformat avformat.h)
-FFMPEG_FIND(LIBAVDEVICE avdevice avdevice.h)
 FFMPEG_FIND(LIBAVCODEC  avcodec  avcodec.h)
 FFMPEG_FIND(LIBAVCODEC_FFT  avcodec  avfft.h)
 FFMPEG_FIND(LIBAVUTIL   avutil   avutil.h)
-FFMPEG_FIND(LIBSWSCALE  swscale  swscale.h)  # not sure about the header to look for here.
 FFMPEG_FIND(LIBSWRESAMPLE  swresample  swresample.h)  # not sure about the header to look for here.
 FFMPEG_FIND(LIBAVRESAMPLE  avresample  avresample.h)
 
 SET(FFMPEG_FOUND "NO")
 # Note we don't check FFMPEG_LIBSWSCALE_FOUND here, it's optional.
-IF   (FFMPEG_LIBAVFORMAT_FOUND AND FFMPEG_LIBAVDEVICE_FOUND AND FFMPEG_LIBAVCODEC_FOUND AND FFMPEG_LIBAVUTIL_FOUND AND FFMPEG_STDINT_INCLUDE_DIR)
+IF   (FFMPEG_LIBAVFORMAT_FOUND AND FFMPEG_LIBAVDEVICE_FOUND AND FFMPEG_LIBAVCODEC_FOUND AND FFMPEG_LIBAVUTIL_FOUND)
 
     SET(FFMPEG_FOUND "YES")