[x264] Update to 0.164.3108, use official upstream (#39460)

This commit is contained in:
Kai Pastor 2024-06-26 08:26:31 +02:00 committed by GitHub
parent 2e7fd315d7
commit 467f9a6a27
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
8 changed files with 97 additions and 55 deletions

View File

@ -1,10 +0,0 @@
diff --git a/configure b/configure
index c987491..f29c3c1 100755
--- a/configure
+++ b/configure
@@ -1,4 +1,5 @@
#!/bin/bash
+test "${AS:-:}" = ":" && unset AS
if test x"$1" = x"-h" -o x"$1" = x"--help" ; then
cat <<EOF

View File

@ -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

View File

@ -1,23 +1,30 @@
vcpkg_from_github(
OUT_SOURCE_PATH SOURCE_PATH
REPO mirror/x264
REF eaa68fad9e5d201d42fde51665f2d137ae96baf0 # 0.164.3107 in pc file, to be updated below
SHA512 9181b222e7f8bbde4331141ff399e1ef20d3e2e7a8f939b373fbe08df6f3caa99b992afb0e559cc19f78c96f0105b88b2eb4e4b935484e25b2c15da7903d179b
HEAD_REF stable
PATCHES
uwp-cflags.patch
parallel-install.patch
allow-clang-cl.patch
configure-as.patch # Ignore ':' from `vcpkg_configure_make`
)
vcpkg_replace_string("${SOURCE_PATH}/configure" [[/bin/bash]] [[/usr/bin/env bash]])
# 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.
# This must be fixed here because vcpkg uses a GH tarball instead of cloning the source.
# (The binary releases on https://artifacts.videolan.org/x264/ are named x264-r<N>-<COMMIT>.)
vcpkg_replace_string("${SOURCE_PATH}/version.sh" [[ver="x"]] [[ver="3095"]])
# 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
PATCHES
"${CURRENT_BUILDTREES_DIR}/src/version-${VERSION}.diff"
uwp-cflags.patch
parallel-install.patch
allow-clang-cl.patch
configure.patch
)
# Ensure that 'ENV{PATH}' leads to tool 'name' exactly at 'filepath'.
function(ensure_tool_in_path name filepath)
@ -47,9 +54,6 @@ transform_path_no_space(VCPKG_DETECTED_CMAKE_C_COMPILER)
set(ENV{CC} "${VCPKG_DETECTED_CMAKE_C_COMPILER}")
vcpkg_list(SET OPTIONS)
if(VCPKG_DETECTED_CMAKE_C_COMPILER MATCHES "([^\/]*-)gcc$")
vcpkg_list(APPEND OPTIONS "--cross-prefix=${CMAKE_MATCH_1}")
endif()
vcpkg_list(SET EXTRA_ARGS)
set(nasm_archs x86 x64)
@ -89,10 +93,6 @@ if(VCPKG_TARGET_IS_UWP)
list(APPEND OPTIONS --extra-cflags=-D_WIN32_WINNT=0x0A00)
endif()
if(VCPKG_TARGET_IS_LINUX)
list(APPEND OPTIONS --enable-pic)
endif()
vcpkg_configure_make(
SOURCE_PATH "${SOURCE_PATH}"
NO_ADDITIONAL_PATHS
@ -100,6 +100,7 @@ vcpkg_configure_make(
${EXTRA_ARGS}
OPTIONS
${OPTIONS}
--enable-pic
--disable-lavf
--disable-swscale
--disable-avs

View File

@ -1,7 +1,6 @@
{
"name": "x264",
"version": "0.164.3107",
"port-version": 1,
"version": "0.164.3108",
"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",
@ -13,29 +12,23 @@
}
],
"default-features": [
"default-features"
{
"name": "asm",
"platform": "!(arm32 & windows)"
},
{
"name": "gpl",
"platform": "!(arm32 & windows)"
}
],
"features": {
"asm": {
"description": "Enable platform-specific assembly optimizations",
"supports": "x86 | x64 | (arm & !windows) | arm64"
"supports": "!(arm32 & windows)"
},
"chroma-format-all": {
"description": "Output all chroma formats"
},
"default-features": {
"description": "Default set of features",
"dependencies": [
{
"name": "x264",
"features": [
"asm",
"gpl"
],
"platform": "x86 | x64 | (arm & !windows) | arm64"
}
]
},
"gpl": {
"description": "Allow use of GPL code, the resulting libs and binaries will be under GPL"
},

View File

@ -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)))"

View File

@ -1235,8 +1235,6 @@ workflow:x64-uwp=fail
wpilib:arm-neon-android=fail # requires full c++20 support
wpilib:arm64-android=fail # requires full c++20 support
wpilib:x64-android=fail # requires full c++20 support
x264:arm-neon-android=fail
x264:arm64-android=fail
# No xorg-macros available on osx
xbitmaps:arm-neon-android=fail
xbitmaps:arm64-android=fail

View File

@ -9477,8 +9477,8 @@
"port-version": 0
},
"x264": {
"baseline": "0.164.3107",
"port-version": 1
"baseline": "0.164.3108",
"port-version": 0
},
"x265": {
"baseline": "3.6",

View File

@ -1,5 +1,10 @@
{
"versions": [
{
"git-tree": "1e1d8374cc8a7fe139d82433d27e64e972365517",
"version": "0.164.3108",
"port-version": 0
},
{
"git-tree": "d6d192464ad7d9b953f43c13b7edcc618ce6e690",
"version": "0.164.3107",