ci/cd: drop vcpkg; distro packages + the project FFmpeg everywhere

Linux/macOS now follow the local-build path in CI and CD:
tooling/install-deps.sh installs the distro codec packages and
tooling/ffmpeg/build-ffmpeg.sh builds the pinned static FFmpeg into
.cache/ffmpeg, with FFMPEG_DIR/PKG_CONFIG_PATH pointing there. CI caches
the built tree keyed on the script, distro and arch (the
.build-complete marker rejects partial saves); CD rebuilds it from
scratch per its no-cache policy. Windows keeps BtbN's prebuilt shared
archive, downloaded from the release page and verified against its
checksums.sha256 — no pkg-config is needed there any more.

vcpkg.json, the release-only overlay triplets and the x264 mirror
overlay are deleted; docs/build.md describes the new flow.
This commit is contained in:
2026-09-24 18:50:00 +08:00
parent 725a1d4da0
commit 563a3625ca
17 changed files with 102 additions and 633 deletions
-23
View File
@@ -1,23 +0,0 @@
# vcpkg overlay ports
Passed to `vcpkg install` with `--overlay-ports tooling/vcpkg-ports`
(both workflows, see `.github/workflows/ci.yml` and
`.github/workflows/cd.yml`).
## x264
vcpkg's builtin x264 port downloads its source from `code.videolan.org`,
whose GitLab sits behind an anti-bot challenge: CI runners intermittently
failed the download (`curl` error 7 / HTTP 404), which made every vcpkg
install a coin flip. This overlay is a verbatim copy of the port at
baseline `771b0a2e7c473c3a6bee56553be4d5bb32bb653c` with
`vcpkg_from_gitlab` swapped for `vcpkg_from_github` against the
`mirror/x264` GitHub mirror. The mirror archive is byte-identical to
GitLab's (same SHA512), so only the fetch URL changes.
No other port in the dependency tree uses code.videolan.org (dav1d and
x265 already fetch from GitHub).
Refresh the copy (portfile, patches, `vcpkg.json`) whenever the
manifest's `builtin-baseline` moves so it keeps matching the resolved
version.
@@ -1,15 +0,0 @@
diff --git a/configure b/configure
index 6f95e2314..e677e36f4 100644
--- a/configure
+++ b/configure
@@ -606,9 +606,9 @@ if [[ $host_os = mingw* || $host_os = msys* || $host_os = cygwin* ]]; then
if cc_check '' -Qdiag-error:10006,10157 ; then
CHECK_CFLAGS="$CHECK_CFLAGS -Qdiag-error:10006,10157"
fi
- elif [[ "$cc_base" = cl || "$cc_base" = cl[\ .]* ]]; then
+ elif [[ "$cc_base" = cl || "$cc_base" = cl[\ .]* || "$cc_base" = clang-cl || "$cc_base" = clang-cl[\ .]* ]]; then
# Standard Microsoft Visual Studio
compiler=CL
compiler_style=MS
CFLAGS="$CFLAGS -nologo -GS- -DHAVE_STRING_H -I\$(SRCPATH)/extras"
cpp_check '' '' '_MSC_VER > 1800 || (_MSC_VER == 1800 && _MSC_FULL_VER >= 180030324)' || die "Microsoft Visual Studio support requires Visual Studio 2013 Update 2 or newer"
-29
View File
@@ -1,29 +0,0 @@
diff --git a/configure b/configure
index 5116bb97..e4ff41cc 100755
--- a/configure
+++ b/configure
@@ -1,4 +1,7 @@
-#!/bin/bash
+#!/usr/bin/env bash
+
+export CFLAGS="${CPPFLAGS} ${CFLAGS}"
+test "${AS:-:}" = ":" && unset AS
if test x"$1" = x"-h" -o x"$1" = x"--help" ; then
cat <<EOF
@@ -865,6 +868,7 @@ case $host_cpu in
AS="${AS-${SRCPATH}/tools/gas-preprocessor.pl -arch aarch64 -as-type armasm -- armasm64 -nologo}"
else
AS="${AS-${CC}}"
+ test "${AS}" = "${CC}" && ASFLAGS="${CPPFLAGS} ${ASFLAGS}"
fi
;;
arm*)
@@ -883,6 +887,7 @@ case $host_cpu in
AS="${AS-${SRCPATH}/tools/gas-preprocessor.pl -arch arm -as-type clang -force-thumb -- ${CC} -mimplicit-it=always}"
else
AS="${AS-${CC}}"
+ test "${AS}" = "${CC}" && ASFLAGS="${CPPFLAGS} ${ASFLAGS}"
fi
;;
s390|s390x)
@@ -1,14 +0,0 @@
diff --git a/configure b/configure
index 6f95e23..30924ba 100755
--- a/configure
+++ b/configure
@@ -1565,7 +1565,8 @@ fi
if [ "$cli" = "yes" ]; then
echo 'default: cli' >> config.mak
- echo 'install: install-cli' >> config.mak
+ echo 'install:' >> config.mak
+ echo ' $(MAKE) install-cli' >> config.mak
fi
if [ "$shared" = "yes" ]; then
-140
View File
@@ -1,140 +0,0 @@
# Oak overlay of vcpkg's x264 port (baseline 771b0a2e7c473c3a6bee56553be4d5bb32bb653c).
# The only change: the source comes from the GitHub mirror `mirror/x264`
# instead of code.videolan.org, whose GitLab serves the archive behind an
# anti-bot challenge — CI runners intermittently could not download it
# (curl 7 / 404), which made every vcpkg install a coin flip. The mirror
# archive is byte-identical (same SHA512), so only the fetch URL changes.
# The other port files are verbatim copies; refresh them when vcpkg's
# builtin baseline moves.
# The latest ref in branch stable
set(ref b35605ace3ddf7c1a5d67a2eb553f034aef41d55)
# Note on x264 versioning:
# The pc file exports "0.<ABI>.<N>" where N is the number of commits.
# The binary releases on https://artifacts.videolan.org/x264/ are named x264-r<N>-<COMMIT>.
# With a git clone, this can be determined by running `versions.sh`.
# With vcpkg_from_gitlab, we modify `versions.sh` accordingly.
# For --editable mode, use configured patch instead of vcpkg_replace_string.
string(REGEX MATCH "^......." short_ref "${ref}")
string(REGEX MATCH "[0-9]+\$" revision "${VERSION}")
configure_file("${CURRENT_PORT_DIR}/version.diff.in" "${CURRENT_BUILDTREES_DIR}/src/version-${VERSION}.diff" @ONLY)
vcpkg_from_github(
OUT_SOURCE_PATH SOURCE_PATH
REPO mirror/x264
REF "${ref}"
SHA512 bfac118da55da2fcc4587b17a3184d9ed70d6e03188bc0497f5922df22b5685fa49fa4325f9c5196c76d03e6e3f56d5906475c540d0df7e1739dc4182816eebe
HEAD_REF master
PATCHES
"${CURRENT_BUILDTREES_DIR}/src/version-${VERSION}.diff"
uwp-cflags.patch
parallel-install.patch
allow-clang-cl.patch
configure.patch
)
function(add_cross_prefix)
if(configure_env MATCHES "CC=([^\/]*-)gcc$")
vcpkg_list(APPEND arg_OPTIONS "--cross-prefix=${CMAKE_MATCH_1}")
endif()
set(arg_OPTIONS "${arg_OPTIONS}" PARENT_SCOPE)
endfunction()
set(nasm_archs x86 x64)
set(gaspp_archs arm arm64)
if(NOT "asm" IN_LIST FEATURES)
vcpkg_list(APPEND OPTIONS --disable-asm)
elseif(NOT "$ENV{AS}" STREQUAL "")
# Accept setting from triplet
elseif(VCPKG_TARGET_ARCHITECTURE IN_LIST nasm_archs)
vcpkg_find_acquire_program(NASM)
vcpkg_insert_program_into_path("${NASM}")
set(ENV{AS} "${NASM}")
elseif(VCPKG_TARGET_ARCHITECTURE IN_LIST gaspp_archs AND VCPKG_TARGET_IS_WINDOWS AND VCPKG_HOST_IS_WINDOWS)
vcpkg_find_acquire_program(GASPREPROCESSOR)
list(FILTER GASPREPROCESSOR INCLUDE REGEX gas-preprocessor)
file(INSTALL "${GASPREPROCESSOR}" DESTINATION "${SOURCE_PATH}/tools" RENAME "gas-preprocessor.pl")
endif()
vcpkg_list(SET OPTIONS_RELEASE)
if("tool" IN_LIST FEATURES)
vcpkg_list(APPEND OPTIONS_RELEASE --enable-cli)
else()
vcpkg_list(APPEND OPTIONS_RELEASE --disable-cli)
endif()
if("chroma-format-all" IN_LIST FEATURES)
vcpkg_list(APPEND OPTIONS --chroma-format=all)
endif()
if(NOT "gpl" IN_LIST FEATURES)
vcpkg_list(APPEND OPTIONS --disable-gpl)
endif()
if(VCPKG_TARGET_IS_UWP)
list(APPEND OPTIONS --extra-cflags=-D_WIN32_WINNT=0x0A00)
endif()
vcpkg_make_configure(
SOURCE_PATH "${SOURCE_PATH}"
DISABLE_CPPFLAGS # Build is not using CPP/CPPFLAGS
DISABLE_MSVC_WRAPPERS
LANGUAGES ASM C CXX # Requires NASM to compile
DISABLE_MSVC_TRANSFORMATIONS # disable warnings about unknown -Xcompiler/-Xlinker flags
PRE_CONFIGURE_CMAKE_COMMANDS
add_cross_prefix
OPTIONS
${OPTIONS}
--enable-pic
--disable-lavf
--disable-swscale
--disable-avs
--disable-ffms
--disable-gpac
--disable-lsmash
--disable-bashcompletion
OPTIONS_RELEASE
${OPTIONS_RELEASE}
--enable-strip
"--bindir=\\\${prefix}/bin"
OPTIONS_DEBUG
--enable-debug
--disable-cli
"--bindir=\\\${prefix}/bin"
)
vcpkg_make_install()
if("tool" IN_LIST FEATURES)
vcpkg_copy_tools(TOOL_NAMES x264 AUTO_CLEAN)
endif()
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include")
if(VCPKG_TARGET_IS_WINDOWS AND NOT VCPKG_TARGET_IS_MINGW)
vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/lib/pkgconfig/x264.pc" "-lx264" "-llibx264")
if(NOT VCPKG_BUILD_TYPE)
vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/debug/lib/pkgconfig/x264.pc" "-lx264" "-llibx264")
endif()
endif()
if(VCPKG_LIBRARY_LINKAGE STREQUAL "dynamic" AND VCPKG_TARGET_IS_WINDOWS AND NOT VCPKG_TARGET_IS_MINGW)
file(RENAME "${CURRENT_PACKAGES_DIR}/lib/libx264.dll.lib" "${CURRENT_PACKAGES_DIR}/lib/libx264.lib")
if (NOT VCPKG_BUILD_TYPE)
file(RENAME "${CURRENT_PACKAGES_DIR}/debug/lib/libx264.dll.lib" "${CURRENT_PACKAGES_DIR}/debug/lib/libx264.lib")
endif()
vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/include/x264.h" "#ifdef X264_API_IMPORTS" "#if 1")
elseif(VCPKG_LIBRARY_LINKAGE STREQUAL "static")
vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/include/x264.h" "defined(U_STATIC_IMPLEMENTATION)" "1" IGNORE_UNCHANGED)
file(REMOVE_RECURSE
"${CURRENT_PACKAGES_DIR}/bin"
"${CURRENT_PACKAGES_DIR}/debug/bin"
)
endif()
vcpkg_fixup_pkgconfig()
vcpkg_copy_pdbs()
vcpkg_install_copyright(FILE_LIST "${SOURCE_PATH}/COPYING")
-12
View File
@@ -1,12 +0,0 @@
diff --git a/configure b/configure
index f7b14d9..2c92b2a 100644
--- a/configure
+++ b/configure
@@ -821,7 +821,6 @@ if [ $SYS = WINDOWS ]; then
if cpp_check "winapifamily.h" "" "!WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP)" ; then
[ $compiler = CL ] || die "WinRT requires MSVC"
define HAVE_WINRT
- CFLAGS="$CFLAGS -MD"
LDFLAGS="$LDFLAGS -appcontainer"
if ! cpp_check "" "" "defined(_WIN32_WINNT) && _WIN32_WINNT >= 0x0603" ; then
die "_WIN32_WINNT must be defined to at least 0x0603 (Windows 8.1) for WinRT"
-40
View File
@@ -1,40 +0,0 @@
{
"name": "x264",
"version": "0.165.3222",
"description": "x264 is a free software library and application for encoding video streams into the H.264/MPEG-4 AVC compression format",
"homepage": "https://www.videolan.org/developers/x264.html",
"license": "GPL-2.0-or-later",
"supports": "!xbox",
"dependencies": [
{
"name": "vcpkg-make",
"host": true
}
],
"default-features": [
{
"name": "asm",
"platform": "!(arm32 & windows)"
},
{
"name": "gpl",
"platform": "!(arm32 & windows)"
}
],
"features": {
"asm": {
"description": "Enable platform-specific assembly optimizations",
"supports": "!(arm32 & windows)"
},
"chroma-format-all": {
"description": "Output all chroma formats"
},
"gpl": {
"description": "Allow use of GPL code, the resulting libs and binaries will be under GPL"
},
"tool": {
"description": "Build the command line tool",
"supports": "!uwp"
}
}
}
-15
View File
@@ -1,15 +0,0 @@
diff --git a/version.sh b/version.sh
index 178fc952..06728796 100755
--- a/version.sh
+++ b/version.sh
@@ -3,8 +3,8 @@
cd "$(dirname "$0")" >/dev/null && [ -f x264.h ] || exit 1
api="$(grep '#define X264_BUILD' < x264.h | sed 's/^.* \([1-9][0-9]*\).*$/\1/')"
-ver="x"
-version=""
+ver="@revision@ @short_ref@"
+version=" r${ver} vcpkg"
if [ -d .git ] && command -v git >/dev/null 2>&1 ; then
localver="$(($(git rev-list HEAD | wc -l)))"
-23
View File
@@ -1,23 +0,0 @@
# vcpkg overlay triplets
Small overlays over vcpkg's builtin triplets, passed to `vcpkg install`
with `--overlay-triplets <dir>` (both workflows, see
`.github/workflows/ci.yml` and `.github/workflows/cd.yml`).
`release/` pins every supported triplet to the release configuration
(`set(VCPKG_BUILD_TYPE release)`): vcpkg otherwise builds every port
twice — release and debug — which doubles the FFmpeg/port build time in
CI and CD. Our build scripts only ever consume the release layout
(`FFMPEG_DIR=<prefix>` with `<prefix>/lib/pkgconfig`, plus the linker
paths those `.pc` files carry), so the debug half was pure waste; the C
libraries' ABI is identical for the debug cargo binary CI tests.
Notes:
- The non-build-type settings mirror vcpkg's builtin triplets
(`scripts/triplets/`) so the overlay stays a drop-in replacement; a
vcpkg upgrade that changes a builtin triplet should be mirrored here.
- `VCPKG_BUILD_TYPE` must be set in the triplet: the environment
variable of the same name is ignored in manifest mode.
- Do not try `debug` here: several ports (e.g. zlib) patch files in the
release layout and fail when only the debug configuration is built.
@@ -1,12 +0,0 @@
# Oak's build-type overlay triplet for arm64-linux (see the note in
# ../README.md): the settings mirror vcpkg's builtin arm64-linux.cmake and
# only the build type is pinned. Pass this directory with
# `--overlay-triplets tooling/vcpkg-triplets/release`.
set(VCPKG_TARGET_ARCHITECTURE arm64)
set(VCPKG_CRT_LINKAGE dynamic)
set(VCPKG_LIBRARY_LINKAGE static)
set(VCPKG_CMAKE_SYSTEM_NAME Linux)
# Build only the release configuration (see x64-linux.cmake).
set(VCPKG_BUILD_TYPE release)
@@ -1,13 +0,0 @@
# Oak's build-type overlay triplet for arm64-osx (see the note in
# ../README.md): the settings mirror vcpkg's builtin arm64-osx.cmake and
# only the build type is pinned. Pass this directory with
# `--overlay-triplets tooling/vcpkg-triplets/release`.
set(VCPKG_TARGET_ARCHITECTURE arm64)
set(VCPKG_CRT_LINKAGE dynamic)
set(VCPKG_LIBRARY_LINKAGE static)
set(VCPKG_CMAKE_SYSTEM_NAME Darwin)
set(VCPKG_OSX_ARCHITECTURES arm64)
# Build only the release configuration (see x64-linux.cmake).
set(VCPKG_BUILD_TYPE release)
@@ -1,14 +0,0 @@
# Oak's build-type overlay triplet for x64-linux (see the note in
# ../README.md): the settings mirror vcpkg's builtin x64-linux.cmake and
# only the build type is pinned. Pass this directory with
# `--overlay-triplets tooling/vcpkg-triplets/release`.
set(VCPKG_TARGET_ARCHITECTURE x64)
set(VCPKG_CRT_LINKAGE dynamic)
set(VCPKG_LIBRARY_LINKAGE static)
set(VCPKG_CMAKE_SYSTEM_NAME Linux)
# Build only the release configuration. vcpkg otherwise builds every port
# twice (release + debug) and our build scripts/vcpkg caches only ever use
# the release layout (FFMPEG_DIR's lib/pkgconfig).
set(VCPKG_BUILD_TYPE release)
@@ -1,11 +0,0 @@
# Oak's build-type overlay triplet for x64-windows (see the note in
# ../README.md): the settings mirror vcpkg's builtin x64-windows.cmake and
# only the build type is pinned. Pass this directory with
# `--overlay-triplets tooling/vcpkg-triplets/release`.
set(VCPKG_TARGET_ARCHITECTURE x64)
set(VCPKG_CRT_LINKAGE dynamic)
set(VCPKG_LIBRARY_LINKAGE dynamic)
set(VCPKG_PROVIDED_FORTRAN ON)
# Build only the release configuration (see x64-linux.cmake).
set(VCPKG_BUILD_TYPE release)