From 7640c504fab723af0a2ce23cdae0f5f571457591 Mon Sep 17 00:00:00 2001 From: ReenigneArcher <42013603+ReenigneArcher@users.noreply.github.com> Date: Sat, 30 Dec 2023 17:36:36 -0500 Subject: [PATCH] build(deps): use a single submodule for ffmpeg (#1952) --- .gitmodules | 28 ++++------------------------ cmake/dependencies/common.cmake | 12 ++++++------ docs/Doxyfile | 2 +- packaging/linux/Arch/PKGBUILD | 23 +---------------------- third-party/build-deps | 1 + third-party/ffmpeg-linux-aarch64 | 1 - third-party/ffmpeg-linux-powerpc64le | 1 - third-party/ffmpeg-linux-x86_64 | 1 - third-party/ffmpeg-macos-aarch64 | 1 - third-party/ffmpeg-macos-x86_64 | 1 - third-party/ffmpeg-windows-x86_64 | 1 - 11 files changed, 13 insertions(+), 59 deletions(-) create mode 160000 third-party/build-deps delete mode 160000 third-party/ffmpeg-linux-aarch64 delete mode 160000 third-party/ffmpeg-linux-powerpc64le delete mode 160000 third-party/ffmpeg-linux-x86_64 delete mode 160000 third-party/ffmpeg-macos-aarch64 delete mode 160000 third-party/ffmpeg-macos-x86_64 delete mode 160000 third-party/ffmpeg-windows-x86_64 diff --git a/.gitmodules b/.gitmodules index 92820c24..108269ff 100644 --- a/.gitmodules +++ b/.gitmodules @@ -22,26 +22,6 @@ path = third-party/TPCircularBuffer url = https://github.com/michaeltyson/TPCircularBuffer branch = master -[submodule "third-party/ffmpeg-windows-x86_64"] - path = third-party/ffmpeg-windows-x86_64 - url = https://github.com/LizardByte/build-deps - branch = ffmpeg-windows-x86_64 -[submodule "third-party/ffmpeg-macos-x86_64"] - path = third-party/ffmpeg-macos-x86_64 - url = https://github.com/LizardByte/build-deps - branch = ffmpeg-macos-x86_64 -[submodule "third-party/ffmpeg-linux-x86_64"] - path = third-party/ffmpeg-linux-x86_64 - url = https://github.com/LizardByte/build-deps - branch = ffmpeg-linux-x86_64 -[submodule "third-party/ffmpeg-linux-aarch64"] - path = third-party/ffmpeg-linux-aarch64 - url = https://github.com/LizardByte/build-deps - branch = ffmpeg-linux-aarch64 -[submodule "third-party/ffmpeg-macos-aarch64"] - path = third-party/ffmpeg-macos-aarch64 - url = https://github.com/LizardByte/build-deps - branch = ffmpeg-macos-aarch64 [submodule "third-party/nanors"] path = third-party/nanors url = https://github.com/sleepybishop/nanors.git @@ -54,10 +34,6 @@ path = third-party/nvapi-open-source-sdk url = https://github.com/LizardByte/nvapi-open-source-sdk branch = sdk -[submodule "third-party/ffmpeg-linux-powerpc64le"] - path = third-party/ffmpeg-linux-powerpc64le - url = https://github.com/LizardByte/build-deps - branch = ffmpeg-linux-powerpc64le [submodule "third-party/wayland-protocols"] path = third-party/wayland-protocols url = https://gitlab.freedesktop.org/wayland/wayland-protocols @@ -66,3 +42,7 @@ path = third-party/wlr-protocols url = https://gitlab.freedesktop.org/wlroots/wlr-protocols branch = master +[submodule "third-party/build-deps"] + path = third-party/build-deps + url = https://github.com/LizardByte/build-deps.git + branch = dist diff --git a/cmake/dependencies/common.cmake b/cmake/dependencies/common.cmake index 34ea09f7..316de3f9 100644 --- a/cmake/dependencies/common.cmake +++ b/cmake/dependencies/common.cmake @@ -23,12 +23,12 @@ if(WIN32) message(FATAL_ERROR "Unsupported system processor:" ${CMAKE_SYSTEM_PROCESSOR}) endif() set(FFMPEG_PLATFORM_LIBRARIES mfplat ole32 strmiids mfuuid vpl) - set(FFMPEG_PREPARED_BINARIES "${CMAKE_CURRENT_SOURCE_DIR}/third-party/ffmpeg-windows-x86_64") + set(FFMPEG_PREPARED_BINARIES "${CMAKE_CURRENT_SOURCE_DIR}/third-party/build-deps/ffmpeg/windows-x86_64") elseif(APPLE) if(CMAKE_SYSTEM_PROCESSOR STREQUAL "x86_64") - set(FFMPEG_PREPARED_BINARIES "${CMAKE_CURRENT_SOURCE_DIR}/third-party/ffmpeg-macos-x86_64") + set(FFMPEG_PREPARED_BINARIES "${CMAKE_CURRENT_SOURCE_DIR}/third-party/build-deps/ffmpeg/macos-x86_64") elseif(CMAKE_SYSTEM_PROCESSOR STREQUAL "arm64") - set(FFMPEG_PREPARED_BINARIES "${CMAKE_CURRENT_SOURCE_DIR}/third-party/ffmpeg-macos-aarch64") + set(FFMPEG_PREPARED_BINARIES "${CMAKE_CURRENT_SOURCE_DIR}/third-party/build-deps/ffmpeg/macos-aarch64") elseif(CMAKE_SYSTEM_PROCESSOR STREQUAL "powerpc") message(FATAL_ERROR "PowerPC is not supported on macOS") else() @@ -38,13 +38,13 @@ elseif(UNIX) set(FFMPEG_PLATFORM_LIBRARIES va va-drm va-x11 vdpau X11) if(CMAKE_SYSTEM_PROCESSOR STREQUAL "x86_64") list(APPEND FFMPEG_PLATFORM_LIBRARIES mfx) - set(FFMPEG_PREPARED_BINARIES "${CMAKE_CURRENT_SOURCE_DIR}/third-party/ffmpeg-linux-x86_64") + set(FFMPEG_PREPARED_BINARIES "${CMAKE_CURRENT_SOURCE_DIR}/third-party/build-deps/ffmpeg/linux-x86_64") set(CPACK_DEB_PLATFORM_PACKAGE_DEPENDS "libmfx1,") set(CPACK_RPM_PLATFORM_PACKAGE_REQUIRES "intel-mediasdk >= 22.3.0,") elseif(CMAKE_SYSTEM_PROCESSOR STREQUAL "aarch64") - set(FFMPEG_PREPARED_BINARIES "${CMAKE_CURRENT_SOURCE_DIR}/third-party/ffmpeg-linux-aarch64") + set(FFMPEG_PREPARED_BINARIES "${CMAKE_CURRENT_SOURCE_DIR}/third-party/build-deps/ffmpeg/linux-aarch64") elseif(CMAKE_SYSTEM_PROCESSOR STREQUAL "ppc64le" OR CMAKE_SYSTEM_PROCESSOR STREQUAL "ppc64") - set(FFMPEG_PREPARED_BINARIES "${CMAKE_CURRENT_SOURCE_DIR}/third-party/ffmpeg-linux-powerpc64le") + set(FFMPEG_PREPARED_BINARIES "${CMAKE_CURRENT_SOURCE_DIR}/third-party/build-deps/ffmpeg/linux-powerpc64le") else() message(FATAL_ERROR "Unsupported system processor:" ${CMAKE_SYSTEM_PROCESSOR}) endif() diff --git a/docs/Doxyfile b/docs/Doxyfile index 5d909b53..d6e79cd2 100644 --- a/docs/Doxyfile +++ b/docs/Doxyfile @@ -2355,7 +2355,7 @@ SEARCH_INCLUDES = YES # RECURSIVE has no effect here. # This tag requires that the tag SEARCH_INCLUDES is set to YES. -INCLUDE_PATH = ../third-party/ffmpeg-linux-x86_64/include/ +INCLUDE_PATH = ../third-party/build-deps/ffmpeg/linux-x86_64/include/ # You can use the INCLUDE_FILE_PATTERNS tag to specify one or more wildcard # patterns (like *.h and *.hpp) to filter out the header-files in the diff --git a/packaging/linux/Arch/PKGBUILD b/packaging/linux/Arch/PKGBUILD index 68cbecb8..c14b40db 100644 --- a/packaging/linux/Arch/PKGBUILD +++ b/packaging/linux/Arch/PKGBUILD @@ -45,28 +45,7 @@ sha256sums=('SKIP') prepare() { cd "$pkgname" - # Skip submodules that we don't want - if [[ $CARCH == "x86_64" ]]; then - git -c submodule."ffmpeg-macos-x86_64".update=none \ - -c submodule."ffmpeg-windows-x86_64".update=none \ - -c submodule."ffmpeg-linux-aarch64".update=none \ - -c submodule."ffmpeg-macos-aarch64".update=none \ - submodule update --recursive --init - elif [[ $CARCH == "aarch64" ]]; then - git -c submodule."ffmpeg-macos-x86_64".update=none \ - -c submodule."ffmpeg-windows-x86_64".update=none \ - -c submodule."ffmpeg-linux-x86_64".update=none \ - -c submodule."ffmpeg-macos-aarch64".update=none \ - submodule update --recursive --init - - # It's unlikely that someone could get this far on a system with an incorrect arch, but we should handle it anyway - # Pull linux ffmpeg submodules - else - git -c submodule."ffmpeg-macos-x86_64".update=none \ - -c submodule."ffmpeg-windows-x86_64".update=none \ - -c submodule."ffmpeg-macos-aarch64".update=none \ - submodule update --recursive --init - fi + git submodule update --recursive --init } build() { diff --git a/third-party/build-deps b/third-party/build-deps new file mode 160000 index 00000000..6e23b580 --- /dev/null +++ b/third-party/build-deps @@ -0,0 +1 @@ +Subproject commit 6e23b580e653595df1e6f680062fa08d6eff3dfe diff --git a/third-party/ffmpeg-linux-aarch64 b/third-party/ffmpeg-linux-aarch64 deleted file mode 160000 index 801ace9c..00000000 --- a/third-party/ffmpeg-linux-aarch64 +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 801ace9c3c9b9e6e9a0bd97fbcb5fd0259a30d9b diff --git a/third-party/ffmpeg-linux-powerpc64le b/third-party/ffmpeg-linux-powerpc64le deleted file mode 160000 index c244d56b..00000000 --- a/third-party/ffmpeg-linux-powerpc64le +++ /dev/null @@ -1 +0,0 @@ -Subproject commit c244d56b5664618b5b0b3d821a4f35dea4c49d8f diff --git a/third-party/ffmpeg-linux-x86_64 b/third-party/ffmpeg-linux-x86_64 deleted file mode 160000 index 7f69cc20..00000000 --- a/third-party/ffmpeg-linux-x86_64 +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 7f69cc20eb8e5888ba7d92177e662a0c81963fae diff --git a/third-party/ffmpeg-macos-aarch64 b/third-party/ffmpeg-macos-aarch64 deleted file mode 160000 index afaa3221..00000000 --- a/third-party/ffmpeg-macos-aarch64 +++ /dev/null @@ -1 +0,0 @@ -Subproject commit afaa32210e45de2255097be6f51dd692f3da7188 diff --git a/third-party/ffmpeg-macos-x86_64 b/third-party/ffmpeg-macos-x86_64 deleted file mode 160000 index afc6772c..00000000 --- a/third-party/ffmpeg-macos-x86_64 +++ /dev/null @@ -1 +0,0 @@ -Subproject commit afc6772ce850b2f548b894c797723015533fade9 diff --git a/third-party/ffmpeg-windows-x86_64 b/third-party/ffmpeg-windows-x86_64 deleted file mode 160000 index c9dc6e93..00000000 --- a/third-party/ffmpeg-windows-x86_64 +++ /dev/null @@ -1 +0,0 @@ -Subproject commit c9dc6e931aa6e2faf87c0003ca4abff6fdf4c846