Skip to content

Split/x264 overlay workaround#1137

Open
selimsandal wants to merge 3 commits into
MrNeRF:masterfrom
selimsandal:split/x264-overlay-workaround
Open

Split/x264 overlay workaround#1137
selimsandal wants to merge 3 commits into
MrNeRF:masterfrom
selimsandal:split/x264-overlay-workaround

Conversation

@selimsandal
Copy link
Copy Markdown
Contributor

No description provided.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR introduces a Linux-only vcpkg overlay port for x264 and wires it into the top-level CMake configuration so Linux builds use the overlay while other platforms can continue using the upstream vcpkg port.

Changes:

  • Add a Linux-guarded VCPKG_OVERLAY_PORTS entry in the root CMakeLists.txt.
  • Add a full x264 overlay port under .github/overlays/linux/x264 (portfile, manifest, and patches).
  • Patch x264 build/version scripts via vcpkg patches to address the targeted workaround(s).

Reviewed changes

Copilot reviewed 9 out of 9 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
CMakeLists.txt Adds conditional configuration to enable the Linux overlay port directory.
.github/overlays/linux/x264/portfile.cmake Defines the overlay x264 port build logic and applies patches.
.github/overlays/linux/x264/vcpkg.json Declares the overlay port metadata, features, and dependencies.
.github/overlays/linux/x264/version.diff.in Template patch to adjust x264 version string in vcpkg builds.
.github/overlays/linux/x264/configure.patch Adjusts configure behavior (shell/env + flags handling + Android guard).
.github/overlays/linux/x264/srcpath-relative-path.patch Fixes relative path computation in configure for certain layouts.
.github/overlays/linux/x264/parallel-install.patch Adjusts install target generation to support parallel installs.
.github/overlays/linux/x264/allow-clang-cl.patch Expands compiler detection to accept clang-cl.
.github/overlays/linux/x264/uwp-cflags.patch Tweaks WinRT/UWP-specific flags in configure.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread CMakeLists.txt
Comment on lines +14 to +18
if(CMAKE_HOST_SYSTEM_NAME STREQUAL "Linux")
# Keep the x264 workaround Linux-only so Windows continues to use the
# upstream vcpkg port unchanged.
list(APPEND VCPKG_OVERLAY_PORTS "${CMAKE_CURRENT_SOURCE_DIR}/.github/overlays/linux")
endif()
Copy link

Copilot AI Apr 22, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The Linux-only gating uses CMAKE_HOST_SYSTEM_NAME, so a cross-compile configured on a Linux host (e.g., targeting Windows via a toolchain/triplet) would still pick up this x264 overlay. That contradicts the intent stated in the comment (keeping Windows on the upstream vcpkg port). Consider gating on the target platform instead (e.g., CMAKE_SYSTEM_NAME STREQUAL "Linux" when defined, with a fallback to host only when CMAKE_SYSTEM_NAME is unset), or gate on the vcpkg target triplet once available.

Copilot uses AI. Check for mistakes.
Comment on lines +5 to +8
# The pc file exports "0.164.<N>" where 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.
Copy link

Copilot AI Apr 22, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Spelling/accuracy in the versioning note: the script is version.sh (not versions.sh), and the sentence "exports "0.164." where is the number of commits" is missing a word (e.g., "where N is..."). Updating these comments will prevent confusion when maintaining this overlay.

Suggested change
# The pc file exports "0.164.<N>" where 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.
# The pc file exports "0.164.<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 `version.sh`.
# With vcpkg_from_gitlab, we modify `version.sh` accordingly.

Copilot uses AI. Check for mistakes.
@MrNeRF
Copy link
Copy Markdown
Owner

MrNeRF commented Apr 22, 2026

See my comment #1128 (comment)

@shadygm
Copy link
Copy Markdown
Collaborator

shadygm commented May 8, 2026

@selimsandal, can you check the previous comment. Thanks (:

@selimsandal
Copy link
Copy Markdown
Contributor Author

selimsandal commented May 8, 2026

@MrNeRF @shadygm i’ve checked the upstream for x264, seems like they host on a private git server and the account I tried to register with 2 weeks ago is still not verified by the administrators of videolan so I cannot send a patch to that repo. If you are in contact with videolan maybe we can ask directly?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants