1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85
|
Description: Use sox and ffmpeg from system
Author: Shengqi Chen <harry@debian.org>
Forwarded: not-needed
Last-Update: 2025-02-19
---
This patch header follows DEP-3: http://dep.debian.net/deps/dep3/
--- a/setup.py
+++ b/setup.py
@@ -76,7 +76,8 @@
for dest, url in src:
if not dest.exists():
print(f" --- Fetching {os.path.basename(dest)}")
- torch.hub.download_url_to_file(url, dest, progress=False)
+ #torch.hub.download_url_to_file(url, dest, progress=False)
+ print(f" --- Fetching skipped for Debian build")
def _main():
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -167,7 +167,8 @@
add_subdirectory(src/libtorchaudio)
if (BUILD_SOX)
- add_subdirectory(third_party/sox)
+ find_package(PkgConfig REQUIRED)
+ pkg_check_modules(SOX REQUIRED IMPORTED_TARGET sox)
add_subdirectory(src/libtorchaudio/sox)
endif()
if (USE_FFMPEG)
--- a/src/libtorchaudio/sox/CMakeLists.txt
+++ b/src/libtorchaudio/sox/CMakeLists.txt
@@ -10,7 +10,7 @@
libtorchaudio_sox
"${sources}"
""
- "torch;sox"
+ "torch;PkgConfig::SOX"
""
)
--- a/version.txt
+++ b/version.txt
@@ -1 +1 @@
-2.6.0a0
+2.6.0
--- a/third_party/ffmpeg/single/CMakeLists.txt
+++ b/third_party/ffmpeg/single/CMakeLists.txt
@@ -6,31 +6,17 @@
message(FATAL_ERROR "Environment variable FFMPEG_ROOT is not set.")
endif()
-set(_root $ENV{FFMPEG_ROOT})
-set(lib_dirs "${_root}/lib" "${_root}/bin")
-set(include_dir "${_root}/include")
-
+find_package(PkgConfig REQUIRED)
add_library(ffmpeg INTERFACE)
-target_include_directories(ffmpeg INTERFACE "${include_dir}")
function (_find_ffmpeg_lib component)
- find_path("${component}_header"
- NAMES "lib${component}/${component}.h"
- PATHS "${include_dir}"
- DOC "The include directory for ${component}"
- REQUIRED
- NO_DEFAULT_PATH)
- find_library("lib${component}"
- NAMES "${component}"
- PATHS ${lib_dirs}
- DOC "${component} library"
- REQUIRED
- NO_DEFAULT_PATH)
- message(STATUS "Found ${component}: ${lib${component}}")
+ pkg_check_modules("${component}" REQUIRED "lib${component}")
+ message(STATUS "Found ${component}: ${component}")
+ target_include_directories(ffmpeg INTERFACE "${component}_INCLUDE_DIRS")
target_link_libraries(
ffmpeg
INTERFACE
- ${lib${component}})
+ "${component}_LIBRARIES")
endfunction ()
_find_ffmpeg_lib(avutil)
|