chromium,chromedriver: 129.0.6668.91 -> 129.0.6668.100
[NixPkgs.git] / pkgs / by-name / mu / musly / 0004-Use-pkg-config-to-find-libresample-and-kissfft.patch
blobc7f893a6a866b784292bfeaaa4d67d38edac0a6b
1 From e4a0d0b48905bb949831c30c941e921da0b6f09c Mon Sep 17 00:00:00 2001
2 From: Emily <hello@emily.moe>
3 Date: Sat, 3 Aug 2024 12:21:12 +0100
4 Subject: [PATCH 4/4] Use pkg-config to find libresample and kissfft
6 ---
7 .travis.yml | 2 ++
8 CMakeLists.txt | 12 ++++++++++++
9 libmusly/CMakeLists.txt | 12 +++---------
10 libmusly/powerspectrum.h | 2 +-
11 libmusly/resampler.h | 2 +-
12 5 files changed, 19 insertions(+), 11 deletions(-)
14 diff --git a/.travis.yml b/.travis.yml
15 index b051004..b354641 100644
16 --- a/.travis.yml
17 +++ b/.travis.yml
18 @@ -31,3 +31,5 @@ addons:
19 - libavcodec-dev
20 - libavformat-dev
21 - libavutil-dev
22 + - libresample-dev
23 + - libkissfft-dev
24 diff --git a/CMakeLists.txt b/CMakeLists.txt
25 index 8d8bf0e..c5b0d2c 100644
26 --- a/CMakeLists.txt
27 +++ b/CMakeLists.txt
28 @@ -60,6 +60,18 @@ pkg_check_modules(FFMPEG REQUIRED IMPORTED_TARGET
29 libavcodec
30 libavformat
31 libavutil)
32 +pkg_check_modules(LIBRESAMPLE REQUIRED IMPORTED_TARGET libresample)
33 +pkg_search_module(KISSFFT REQUIRED IMPORTED_TARGET
34 + kissfft-simd
35 + kissfft-double
36 + kissfft-float
37 + kissfft-int32_t
38 + kissfft-int16_t
39 + kissfft-simd-openmp
40 + kissfft-double-openmp
41 + kissfft-float-openmp
42 + kissfft-int32_t-openmp
43 + kissfft-int16_t-openmp)
45 include_directories(
46 "${PROJECT_SOURCE_DIR}/include")
47 diff --git a/libmusly/CMakeLists.txt b/libmusly/CMakeLists.txt
48 index b9f6d11..6f8c8e9 100644
49 --- a/libmusly/CMakeLists.txt
50 +++ b/libmusly/CMakeLists.txt
51 @@ -13,19 +13,11 @@ if(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/external")
52 PROPERTIES COMPILE_FLAGS "-DLIBMUSLY_EXTERNAL ${LIBMUSLY_EXTERNAL_FLAGS}")
53 endif()
55 -if(USE_OPENMP AND OPENMP_FOUND)
56 - # disable OpenMP for kiss FFT, it slows things down terribly
57 - set_source_files_properties(kissfft/kiss_fft.c
58 - PROPERTIES COMPILE_FLAGS "-U_OPENMP")
59 -endif()
61 include_directories(
62 ${LIBMUSLY_INCLUDE}
63 ${CMAKE_CURRENT_SOURCE_DIR})
65 add_library(libmusly
66 - kissfft/kiss_fft.c
67 - kissfft/kiss_fftr.c
68 methods/mandelellis.cpp
69 methods/timbre.cpp
70 decoders/libav.cpp
71 @@ -56,7 +48,9 @@ set_target_properties(libmusly
72 target_link_libraries(libmusly
73 ${LIBMUSLY_LIBS}
74 PkgConfig::EIGEN3
75 - PkgConfig::FFMPEG)
76 + PkgConfig::FFMPEG
77 + PkgConfig::LIBRESAMPLE
78 + PkgConfig::KISSFFT)
79 if(WIN32 OR MINGW)
80 # link against winsock2 for ntohl() and htonl()
81 target_link_libraries(libmusly ws2_32)
82 diff --git a/libmusly/powerspectrum.h b/libmusly/powerspectrum.h
83 index 6957db4..096fc31 100644
84 --- a/libmusly/powerspectrum.h
85 +++ b/libmusly/powerspectrum.h
86 @@ -14,7 +14,7 @@
88 #include <Eigen/Core>
89 extern "C" {
90 - #include "kissfft/kiss_fftr.h"
91 + #include <kissfft/kiss_fftr.h>
95 diff --git a/libmusly/resampler.h b/libmusly/resampler.h
96 index df8aaa4..f48e22a 100644
97 --- a/libmusly/resampler.h
98 +++ b/libmusly/resampler.h
99 @@ -14,7 +14,7 @@
101 #include <vector>
102 extern "C" {
103 - #include "libresample/libresample.h"
104 + #include <libresample.h>
107 namespace musly {
109 2.45.2