nixpkgs/pkgs/servers/sunshine/ffmpeg.diff
2022-12-22 16:04:44 -06:00

49 lines
1.7 KiB
Diff

diff --git a/CMakeLists.txt b/CMakeLists.txt
index fad60ef..64b68ae 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -212,6 +212,8 @@ else()
set(WAYLAND_FOUND OFF)
endif()
+ find_package(FFMPEG REQUIRED)
+
if(X11_FOUND)
add_compile_definitions(SUNSHINE_BUILD_X11)
include_directories(${X11_INCLUDE_DIR})
@@ -372,35 +374,6 @@ set(SUNSHINE_TARGET_FILES
set_source_files_properties(src/upnp.cpp PROPERTIES COMPILE_FLAGS -Wno-pedantic)
-# Pre-compiled binaries
-if(WIN32)
- set(FFMPEG_PREPARED_BINARIES "${CMAKE_CURRENT_SOURCE_DIR}/third-party/ffmpeg-windows-x86_64")
- set(FFMPEG_PLATFORM_LIBRARIES mfplat ole32 strmiids mfuuid)
-elseif(APPLE)
- set(FFMPEG_PREPARED_BINARIES "${CMAKE_CURRENT_SOURCE_DIR}/third-party/ffmpeg-macos-x86_64")
-else()
- if (CMAKE_SYSTEM_PROCESSOR STREQUAL "aarch64")
- set(FFMPEG_PREPARED_BINARIES "${CMAKE_CURRENT_SOURCE_DIR}/third-party/ffmpeg-linux-aarch64")
- else()
- set(FFMPEG_PREPARED_BINARIES "${CMAKE_CURRENT_SOURCE_DIR}/third-party/ffmpeg-linux-x86_64")
- endif()
- set(FFMPEG_PLATFORM_LIBRARIES va va-drm va-x11 vdpau X11)
-endif()
-set(FFMPEG_INCLUDE_DIRS
- ${FFMPEG_PREPARED_BINARIES}/include)
-if(EXISTS ${FFMPEG_PREPARED_BINARIES}/lib/libhdr10plus.a)
- set(HDR10_PLUS_LIBRARY
- ${FFMPEG_PREPARED_BINARIES}/lib/libhdr10plus.a)
-endif()
-set(FFMPEG_LIBRARIES
- ${FFMPEG_PREPARED_BINARIES}/lib/libavcodec.a
- ${FFMPEG_PREPARED_BINARIES}/lib/libavutil.a
- ${FFMPEG_PREPARED_BINARIES}/lib/libswscale.a
- ${FFMPEG_PREPARED_BINARIES}/lib/libx264.a
- ${FFMPEG_PREPARED_BINARIES}/lib/libx265.a
- ${HDR10_PLUS_LIBRARY}
- ${FFMPEG_PLATFORM_LIBRARIES})
-
include_directories(
${CMAKE_CURRENT_SOURCE_DIR}
${CMAKE_CURRENT_SOURCE_DIR}/third-party