ripasso-cursive: cosmetic changes (#361736)
[NixPkgs.git] / pkgs / by-name / qt / qtscrcpy / remove_vendors.patch
blobd80e1c8b2ed02b6d84678d3010e2b724b3767af4
1 diff --git a/CMakeLists.txt b/CMakeLists.txt
2 index 85c733e..02fea2c 100644
3 --- a/QtScrcpy/QtScrcpyCore/CMakeLists.txt
4 +++ b/QtScrcpy/QtScrcpyCore/CMakeLists.txt
5 @@ -139,87 +139,10 @@ target_include_directories(${QSC_PROJECT_NAME} PRIVATE ${CMAKE_CURRENT_SOURCE_DI
6 target_include_directories(${QSC_PROJECT_NAME} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/src/device/recorder)
7 target_include_directories(${QSC_PROJECT_NAME} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/src/devicemanage)
9 -#
10 -# plantform deps
13 -# windows
14 -if(CMAKE_SYSTEM_NAME STREQUAL "Windows")
15 - # ffmpeg
16 - # include
17 - target_include_directories(${QSC_PROJECT_NAME} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/src/third_party/ffmpeg/include)
18 - # link
19 - set(FFMPEG_LIB_PATH "${CMAKE_CURRENT_SOURCE_DIR}/src/third_party/ffmpeg/lib/${QSC_CPU_ARCH}")
20 - target_link_directories(${QSC_PROJECT_NAME} PUBLIC ${FFMPEG_LIB_PATH})
21 - target_link_libraries(${QSC_PROJECT_NAME} PRIVATE
22 - avformat
23 - avcodec
24 - avutil
25 - swscale
26 - )
27 - # copy
28 - set(THIRD_PARTY_PATH "${CMAKE_CURRENT_SOURCE_DIR}/src/third_party")
29 - set(FFMPEG_BIN_PATH "${THIRD_PARTY_PATH}/ffmpeg/bin/${QSC_CPU_ARCH}")
30 - add_custom_command(TARGET ${QSC_PROJECT_NAME} POST_BUILD
31 - COMMAND ${CMAKE_COMMAND} -E copy_if_different "${FFMPEG_BIN_PATH}/avcodec-58.dll" "${QSC_DEPLOY_PATH}"
32 - COMMAND ${CMAKE_COMMAND} -E copy_if_different "${FFMPEG_BIN_PATH}/avformat-58.dll" "${QSC_DEPLOY_PATH}"
33 - COMMAND ${CMAKE_COMMAND} -E copy_if_different "${FFMPEG_BIN_PATH}/avutil-56.dll" "${QSC_DEPLOY_PATH}"
34 - COMMAND ${CMAKE_COMMAND} -E copy_if_different "${FFMPEG_BIN_PATH}/swscale-5.dll" "${QSC_DEPLOY_PATH}"
35 - COMMAND ${CMAKE_COMMAND} -E copy_if_different "${FFMPEG_BIN_PATH}/swresample-3.dll" "${QSC_DEPLOY_PATH}"
36 - COMMAND ${CMAKE_COMMAND} -E copy_if_different "${THIRD_PARTY_PATH}/adb/win/adb.exe" "${QSC_DEPLOY_PATH}"
37 - COMMAND ${CMAKE_COMMAND} -E copy_if_different "${THIRD_PARTY_PATH}/adb/win/AdbWinApi.dll" "${QSC_DEPLOY_PATH}"
38 - COMMAND ${CMAKE_COMMAND} -E copy_if_different "${THIRD_PARTY_PATH}/adb/win/AdbWinUsbApi.dll" "${QSC_DEPLOY_PATH}"
39 - COMMAND ${CMAKE_COMMAND} -E copy_if_different "${THIRD_PARTY_PATH}/scrcpy-server" "${QSC_DEPLOY_PATH}"
40 - )
41 -endif()
43 -# MacOS
44 -if(CMAKE_SYSTEM_NAME STREQUAL "Darwin")
45 - # ffmpeg
46 - # include
47 - target_include_directories(${QSC_PROJECT_NAME} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/src/third_party/ffmpeg/include)
48 - # link
49 - set(FFMPEG_LIB_PATH "${CMAKE_CURRENT_SOURCE_DIR}/src/third_party/ffmpeg/lib")
50 - target_link_directories(${QSC_PROJECT_NAME} PUBLIC ${FFMPEG_LIB_PATH})
51 - target_link_libraries(${QSC_PROJECT_NAME} PRIVATE
52 - avformat.58
53 - avcodec.58
54 - avutil.56
55 - swscale.5
56 - )
58 - # copy bundle file
59 - add_custom_command(TARGET ${QSC_PROJECT_NAME} POST_BUILD
60 - # dylib,scrcpy-server,adb copy to Contents/MacOS
61 - COMMAND ${CMAKE_COMMAND} -E copy_if_different "${CMAKE_CURRENT_SOURCE_DIR}/src/third_party/ffmpeg/lib/libavcodec.58.dylib" "${QSC_DEPLOY_PATH}/MacOS"
62 - COMMAND ${CMAKE_COMMAND} -E copy_if_different "${CMAKE_CURRENT_SOURCE_DIR}/src/third_party/ffmpeg/lib/libavformat.58.dylib" "${QSC_DEPLOY_PATH}/MacOS"
63 - COMMAND ${CMAKE_COMMAND} -E copy_if_different "${CMAKE_CURRENT_SOURCE_DIR}/src/third_party/ffmpeg/lib/libavutil.56.dylib" "${QSC_DEPLOY_PATH}/MacOS"
64 - COMMAND ${CMAKE_COMMAND} -E copy_if_different "${CMAKE_CURRENT_SOURCE_DIR}/src/third_party/ffmpeg/lib/libswscale.5.dylib" "${QSC_DEPLOY_PATH}/MacOS"
65 - COMMAND ${CMAKE_COMMAND} -E copy_if_different "${CMAKE_CURRENT_SOURCE_DIR}/src/third_party/ffmpeg/lib/libswresample.3.dylib" "${QSC_DEPLOY_PATH}/MacOS"
67 - COMMAND ${CMAKE_COMMAND} -E copy_if_different "${CMAKE_CURRENT_SOURCE_DIR}/src/third_party/scrcpy-server" "${QSC_DEPLOY_PATH}/MacOS"
68 - COMMAND ${CMAKE_COMMAND} -E copy_if_different "${CMAKE_CURRENT_SOURCE_DIR}/src/third_party/adb/mac/adb" "${QSC_DEPLOY_PATH}/MacOS"
69 - )
70 -endif()
71 +find_package(PkgConfig REQUIRED)
72 +pkg_check_modules(FFMPEG REQUIRED libavcodec libavformat libavutil libswscale)
74 -# Linux
75 -if(CMAKE_SYSTEM_NAME STREQUAL "Linux")
76 - # include
77 - target_include_directories(${QSC_PROJECT_NAME} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/src/third_party/ffmpeg/include)
78 - # link
79 - set(FFMPEG_LIB_PATH "${CMAKE_CURRENT_SOURCE_DIR}/src/third_party/ffmpeg/lib")
80 - target_link_directories(${QSC_PROJECT_NAME} PUBLIC ${FFMPEG_LIB_PATH})
81 - target_link_libraries(${QSC_PROJECT_NAME} PRIVATE
82 - # ffmpeg
83 - avformat
84 - avcodec
85 - avutil
86 - swscale
87 - z
88 - )
90 - add_custom_command(TARGET ${QSC_PROJECT_NAME} POST_BUILD
91 - COMMAND ${CMAKE_COMMAND} -E copy_if_different "${CMAKE_CURRENT_SOURCE_DIR}/src/third_party/adb/linux/adb" "${QSC_DEPLOY_PATH}"
92 - COMMAND ${CMAKE_COMMAND} -E copy_if_different "${CMAKE_CURRENT_SOURCE_DIR}/src/third_party/scrcpy-server" "${QSC_DEPLOY_PATH}"
93 - )
94 -endif()
95 +target_link_libraries(${QSC_PROJECT_NAME} PRIVATE ${FFMPEG_LIBRARIES})
96 +target_include_directories(${QSC_PROJECT_NAME} PRIVATE ${FFMPEG_INCLUDE_DIRS})