-
Notifications
You must be signed in to change notification settings - Fork 385
Fix x264 build and GNOME window decorations, linux #1128
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,15 @@ | ||
| 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" |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,40 @@ | ||
| diff --git a/configure b/configure | ||
| index e242e73c..e0d1df76 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 | ||
| @@ -837,6 +840,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*) | ||
| @@ -855,6 +859,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) | ||
| @@ -1354,8 +1359,10 @@ if [ $SYS = WINDOWS -a $ARCH = X86 -a $compiler = GNU ] ; then | ||
| fi | ||
|
|
||
| if cc_check "stdio.h" "" "fseeko(stdin,0,0);" ; then | ||
| + if cc_check "" "" "#if defined(__ANDROID_API__) && __ANDROID_API__ < 24\n#error\n#endif\n" ; then | ||
| define fseek fseeko | ||
| define ftell ftello | ||
| + fi | ||
| elif cc_check "stdio.h" "" "fseeko64(stdin,0,0);" ; then | ||
| define fseek fseeko64 | ||
| define ftell ftello64 |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,14 @@ | ||
| 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 |
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
| @@ -0,0 +1,133 @@ | ||||||
| # The latest ref in branch stable | ||||||
| set(ref 31e19f92f00c7003fa115047ce50978bc98c3a0d) | ||||||
|
|
||||||
| # Note on x264 versioning: | ||||||
| # 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. | ||||||
| # 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_gitlab( | ||||||
| GITLAB_URL https://code.videolan.org/ | ||||||
| OUT_SOURCE_PATH SOURCE_PATH | ||||||
| REPO videolan/x264 | ||||||
| REF "${ref}" | ||||||
| SHA512 707ff486677a1b5502d6d8faa588e7a03b0dee45491c5cba89341be4be23d3f2e48272c3b11d54cfc7be1b8bf4a3dfc3c3bb6d9643a6b5a2ed77539c85ecf294 | ||||||
| HEAD_REF master | ||||||
|
||||||
| HEAD_REF master | |
| HEAD_REF stable |
Copilot
AI
Apr 21, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
vcpkg_make_configure() is called with DISABLE_CPPFLAGS and a comment that the build isn't using CPPFLAGS, but this port also applies configure.patch which explicitly prepends ${CPPFLAGS} to CFLAGS/ASFLAGS. Consider removing DISABLE_CPPFLAGS (or updating the patch/portfile) so CPPFLAGS from the toolchain actually flow into the build as intended.
| DISABLE_CPPFLAGS # Build is not using CPP/CPPFLAGS |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,28 @@ | ||
| diff --git a/configure b/configure | ||
| index 36c4f7af..8c01ca2b 100755 | ||
| --- a/configure | ||
| +++ b/configure | ||
| @@ -345,16 +345,20 @@ rm -rf conftest* | ||
| # Construct a path to the specified directory relative to the working directory | ||
| relative_path() { | ||
| local base="${PWD%/}" | ||
| - local path="$(cd "$1" >/dev/null; printf '%s/.' "${PWD%/}")" | ||
| + local path="$(cd "$1" >/dev/null; printf '%s' "${PWD%/}")" | ||
| local up='' | ||
|
|
||
| - while [[ $path != "$base/"* ]]; do | ||
| + while [[ $path != "$base" && $path != "$base/"* ]]; do | ||
| base="${base%/*}" | ||
| up="../$up" | ||
| done | ||
|
|
||
| - dirname "$up${path#"$base/"}" | ||
| + if [[ $path = "$base" ]]; then | ||
| + printf '.\n' | ||
| + else | ||
| + printf '%s\n' "$up${path#"$base/"}" | ||
| + fi | ||
| } | ||
|
|
||
| SRCPATH="$(relative_path "$(dirname "$0")")" | ||
| echo "$SRCPATH" | grep -q ' ' && die "Out of tree builds are impossible with whitespace in source path." |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,12 @@ | ||
| 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" |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,41 @@ | ||
| { | ||
| "name": "x264", | ||
| "version": "0.164.3108", | ||
| "port-version": 2, | ||
| "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" | ||
| } | ||
| } | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,15 @@ | ||
| 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)))" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The x264 versioning comment refers to
versions.sh, but the script being patched/used isversion.sh. This is likely to confuse future maintainers; update the comment to the correct script name (and wording if needed).