From e23e58117bbd9fb755dc8dcacba43d351d9edf32 Mon Sep 17 00:00:00 2001
From: Wiki Wong <wikiw@molok.cc>
Date: Tue, 17 Dec 2024 09:29:57 +0800
Subject: [PATCH] [ffmpeg] fix static build (#42676)

---
 ports/ffmpeg/FindFFMPEG.cmake.in | 6 +++---
 ports/ffmpeg/vcpkg.json          | 2 +-
 versions/baseline.json           | 2 +-
 versions/f-/ffmpeg.json          | 5 +++++
 4 files changed, 10 insertions(+), 5 deletions(-)

diff --git a/ports/ffmpeg/FindFFMPEG.cmake.in b/ports/ffmpeg/FindFFMPEG.cmake.in
index 1b36f1779101b3..1b67dab02ab863 100644
--- a/ports/ffmpeg/FindFFMPEG.cmake.in
+++ b/ports/ffmpeg/FindFFMPEG.cmake.in
@@ -45,17 +45,17 @@ function(append_dependencies out)
     cmake_parse_arguments(PARSE_ARGV 1 "arg" "DEBUG" "NAMES" "")
     if(${arg_DEBUG})
         set(config DEBUG)
-        set(path "${CURRENT_INSTALLED_DIR}/debug/lib/")
+        set(path "${SEARCH_PATH}/debug/lib/")
     else()
         set(config RELEASE)
-        set(path "${CURRENT_INSTALLED_DIR}/lib/")
+        set(path "${SEARCH_PATH}/lib/")
     endif()
     if("${CMAKE_CXX_IMPLICIT_LINK_LIBRARIES}" STREQUAL "")
         enable_language(CXX)
     endif()
     set(pass_through
         ${CMAKE_CXX_IMPLICIT_LINK_LIBRARIES}
-        bcrypt gdi32 mfuuid ole32 oleaut32 psapi secur32 shlwapi strmiids user32 uuid vfw32 ws2_32
+        advapi32 bcrypt crypt32 gdi32 mfuuid ole32 oleaut32 psapi secur32 shlwapi strmiids user32 uuid vfw32 ws2_32
         -pthread -pthreads pthread atomic m
     )
     cmake_policy(SET CMP0057 NEW)
diff --git a/ports/ffmpeg/vcpkg.json b/ports/ffmpeg/vcpkg.json
index de90c54006e760..6d9e7638fc419f 100644
--- a/ports/ffmpeg/vcpkg.json
+++ b/ports/ffmpeg/vcpkg.json
@@ -1,7 +1,7 @@
 {
   "name": "ffmpeg",
   "version": "7.1",
-  "port-version": 1,
+  "port-version": 2,
   "description": [
     "A library to decode, encode, transcode, mux, demux, stream, filter and play pretty much anything that humans and machines have created.",
     "FFmpeg is the leading multimedia framework, able to decode, encode, transcode, mux, demux, stream, filter and play pretty much anything that humans and machines have created. It supports the most obscure ancient formats up to the cutting edge. No matter if they were designed by some standards committee, the community or a corporation. It is also highly portable: FFmpeg compiles, runs, and passes our testing infrastructure FATE across Linux, Mac OS X, Microsoft Windows, the BSDs, Solaris, etc. under a wide variety of build environments, machine architectures, and configurations."
diff --git a/versions/baseline.json b/versions/baseline.json
index d2e397802716dc..2a9b9478bdfb96 100644
--- a/versions/baseline.json
+++ b/versions/baseline.json
@@ -2762,7 +2762,7 @@
     },
     "ffmpeg": {
       "baseline": "7.1",
-      "port-version": 1
+      "port-version": 2
     },
     "ffnvcodec": {
       "baseline": "12.2.72.0",
diff --git a/versions/f-/ffmpeg.json b/versions/f-/ffmpeg.json
index 9afce4e5e4578c..0dc5687d750a46 100644
--- a/versions/f-/ffmpeg.json
+++ b/versions/f-/ffmpeg.json
@@ -1,5 +1,10 @@
 {
   "versions": [
+    {
+      "git-tree": "88c48d9d8743bb6641072c4aa50e1da155c2eb50",
+      "version": "7.1",
+      "port-version": 2
+    },
     {
       "git-tree": "8bf6bad9b522d47e259a13d9033a825a6abd41a9",
       "version": "7.1",