[vlc-commits] [Git][videolan/vlc][3.0.x] 15 commits: contrib: x264: Use a unique file name for the x264 snapshot tarball download

Steve Lhomme (@robUx4) gitlab at videolan.org
Thu Oct 17 09:24:01 UTC 2024



Steve Lhomme pushed to branch 3.0.x at VideoLAN / VLC


Commits:
e8caa1de by Martin Storsjö at 2024-10-17T08:36:59+00:00
contrib: x264: Use a unique file name for the x264 snapshot tarball download

Treat x264 as an (almost) normal package to download, except for not
checking for the download in http://downloads.videolan.org/pub/contrib.

This fixes building contribs with a prepopulated tarballs directory,
even if the x264 snapshot version changes.

Alternatively, the x264 contrib could be changed to use download_git
with proper support for pinning to a specific git hash.

(Not touching the x262 part since that doesn't seem to be working
at all right now. Downloading x262 fails since it tries to download
from an undefined X262_SNAPURL.)

(cherry picked from commit 0845207525933a4da28238b56ef7e77daff00c54) (rebased)
rebased:
- 3.0 uses tar xvjfo

- - - - -
297ea7b6 by Steve Lhomme at 2024-10-17T08:36:59+00:00
contrib: x264: enable Winstore builds without MSVC

(cherry picked from commit ec0b6bdc91024fef63cebfb6a07cc14f889ed6d8)

- - - - -
9bc0a8a0 by David Fuhrmann at 2024-10-17T08:36:59+00:00
contrib: x264: Fix build by using UNPACK_DIR

UNPACK_DIR instead of x264-git is expected for the following
contrib macros (UPDATE_AUTOCONFIG, APPLY).

Fixes build on macOS.

Signed-off-by: Steve Lhomme <robux4 at ycbcr.xyz>
(cherry picked from commit f87092a889ea00f60e6c34140a5fbf807eac0626)

- - - - -
e4368812 by Steve Lhomme at 2024-10-17T08:36:59+00:00
contrib: x262: clean build dependencies to use the git source

It doesn't build but at least we get the sources to build properly.

(cherry picked from commit 2792169a9702a3f2c5025e5cd67e67e074a28277)

- - - - -
e31969d3 by Steve Lhomme at 2024-10-17T08:36:59+00:00
contrib: x262: move the x262 target in its own folder

It doesn't have any depedency with x264 nor anything shared.

(cherry picked from commit 9b9447af810905a760246a4e2a04547267f9938f) (edited)
edited:
- 3.0 already has the HOSTCONF after configure

- - - - -
84793061 by Steve Lhomme at 2024-10-17T08:36:59+00:00
contrib: use UNPACK in targets using --strip-components=1

They don't actually need some special treatment. They extract properly in the
expected folder given their tarball name.

(cherry picked from commit 018f006925eb402c3f29063bd83c079ceba5b4b7) (edited)
edited:
- 3.0 has slightly different tarball naming for ffmpeg
- 3.0 doesn't have bitstream, fxc2, glslang, medialibrary

- - - - -
1a009d1f by Thomas Guillem at 2024-10-17T08:36:59+00:00
contrib: x264: with build with Android NDK25

Cross tools changed from ${ARCH}-linux-android${API}-${TOOL} to
llvm-${TOOL).

Example: aarch64-linux-android21-strings to llvm-strings.
(cherry picked from commit 9e4252a513e6b0314b364ad2cba1b65b97a585b8)

- - - - -
66807617 by Thomas Guillem at 2024-10-17T08:36:59+00:00
contrib: x264: enable back x86_64 asm on Android

Since relocation issues are now fixed.

(cherry picked from commit 047cc58ad8111ebc8bf7cc4c213bdfdc41b59c43)

- - - - -
f76013b6 by Steve Lhomme at 2024-10-17T08:36:59+00:00
contrib: x264: remove configure setting found in HOSTCONF

(cherry picked from commit 2b45932a6bcebf12d2292dad6759aa91a5a9062d)

- - - - -
5ecded35 by Martin Storsjö at 2024-10-17T08:36:59+00:00
contrib: x264: Update to the latest version from code.videolan.org

This allows dropping some portability workarounds.

(cherry picked from commit 426ff68ea89c7a98d90b7b20e359e54955a4959e) (edited)
edited:
- X264_AS was exporting variables on 3.0
- 3.0 doesn't use MAKECONFIGURE yet

- - - - -
9f45e0b8 by Steve Lhomme at 2024-10-17T08:36:59+00:00
contrib: x264: fix build when x264 is in the include path

(cherry picked from commit 117561315447fa25425bc09f9168e9692cb9a561)

- - - - -
97b885cc by Steve Lhomme at 2024-10-17T08:36:59+00:00
contrib: x264: fix fseeko detection on older 32-bit Android

It's not supported [1]. NDK 26 will emit an error if you try to use it.

Upstream patch: https://code.videolan.org/videolan/x264/-/merge_requests/150

[1] https://android.googlesource.com/platform/bionic/+/main/docs/32-bit-abi.md

(cherry picked from commit e750fb576b5d2c7b1341c71697e26bad79bb5460)

- - - - -
ea663d54 by Steve Lhomme at 2024-10-17T08:36:59+00:00
contrib: x264: only set --cross-prefix once

(cherry picked from commit 8bfcb80dbe1e36641878205c0f927d00f56094a9)

- - - - -
4b3fa640 by Steve Lhomme at 2024-10-17T08:36:59+00:00
contrib: x264: fix android aarch64/arm cross prefix

"aarch64" is turned into "ach64 " and "arm" into "m".

ld is not found in the path to LD:
/sdk/android-ndk/toolchains/llvm/prebuilt/linux-aarch64/bin/aarch64-linux-android-ld

(cherry picked from commit 27d993252ccd7548578e0986b30c4e970863397f)

- - - - -
9cf50d17 by Steve Lhomme at 2024-10-17T08:36:59+00:00
contrib: x264: don't validate the checksum of the local tarball

Different versions of xz may produce different checksums.
Ref. #28825

(cherry picked from commit 704097649a53a33b21780275fa03ebedea7088c0)

- - - - -


6 changed files:

- contrib/src/ffmpeg/rules.mak
- + contrib/src/x262/rules.mak
- + contrib/src/x264/0001-configure-set-_FILE_OFFSET_BITS-to-detect-fseeko.patch
- + contrib/src/x264/0001-osdep-use-direct-path-to-internal-x264.h.patch
- contrib/src/x264/rules.mak
- + contrib/src/x264/x264-winstore.patch


Changes:

=====================================
contrib/src/ffmpeg/rules.mak
=====================================
@@ -239,9 +239,7 @@ $(TARBALLS)/ffmpeg-$(FFMPEG_VERSION).tar.xz:
 .sum-ffmpeg: ffmpeg-$(FFMPEG_VERSION).tar.xz
 
 ffmpeg: ffmpeg-$(FFMPEG_VERSION).tar.xz .sum-ffmpeg
-	rm -Rf $@ $@-$(FFMPEG_VERSION)
-	mkdir -p $@-$(FFMPEG_VERSION)
-	tar xvJfo "$<" --strip-components=1 -C $@-$(FFMPEG_VERSION)
+	$(UNPACK)
 ifdef USE_FFMPEG
 	$(APPLY) $(SRC)/ffmpeg/armv7_fixup.patch
 	$(APPLY) $(SRC)/ffmpeg/dxva_vc1_crash.patch


=====================================
contrib/src/x262/rules.mak
=====================================
@@ -0,0 +1,38 @@
+# x262
+
+X262_GITURL := git://git.videolan.org/x262.git
+X262_HASH := bb887aa4c0a4da955524aa220b62998c3b50504e
+
+# ifdef BUILD_ENCODERS
+# ifdef GPL
+# PKGS += x262
+# endif
+# endif
+
+#ifeq ($(call need_pkg,"x262"),)
+#PKGS_FOUND += x262
+#endif
+
+$(TARBALLS)/x262-git.tar.xz:
+	$(call download_git,$(X262_GITURL),,$(X262_HASH))
+
+.sum-x262: $(TARBALLS)/x262-git.tar.xz
+	$(call check_githash,$(X262_HASH))
+	touch $@
+
+x262: $(TARBALLS)/x262-git.tar.xz .sum-x262
+	$(UNPACK)
+	$(UPDATE_AUTOCONFIG)
+	$(MOVE)
+
+.x262: x262
+	$(REQUIRE_GPL)
+	cd $< && sed -i -e 's/x264/x262/g' configure
+	cd $< && sed -i -e 's/x264_config/x262_config/g' *.h Makefile *.c
+	cd $< && $(HOSTVARS) ./configure $(HOSTCONF) $(X264CONF)
+	cd $< && sed -i -e 's/x264.pc/x262.pc/g' Makefile
+	cd $< && sed -i -e 's/x264.h/x262.h/g' Makefile
+	cd $< && $(MAKE)
+	cd $< && cp x264.h x262.h
+	cd $< && $(MAKE) install
+	touch $@


=====================================
contrib/src/x264/0001-configure-set-_FILE_OFFSET_BITS-to-detect-fseeko.patch
=====================================
@@ -0,0 +1,26 @@
+From dc69fefa49726021d75e6a764357779a4b4d0800 Mon Sep 17 00:00:00 2001
+From: Steve Lhomme <robux4 at ycbcr.xyz>
+Date: Mon, 22 Apr 2024 14:03:02 +0200
+Subject: [PATCH] configure: set _FILE_OFFSET_BITS to detect fseeko
+
+On Android fseeko is not detected properly if if _FILE_OFFSET_BITS is not set.
+---
+ configure | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/configure b/configure
+index c1fb599f..60ad229b 100755
+--- a/configure
++++ b/configure
+@@ -1369,7 +1369,7 @@ if [ $SYS = WINDOWS -a $ARCH = X86 -a $compiler = GNU ] ; then
+     cc_check '' -fno-zero-initialized-in-bss && CFLAGS="$CFLAGS -fno-zero-initialized-in-bss"
+ fi
+ 
+-if cc_check "stdio.h" "" "fseeko(stdin,0,0);" ; then
++if cc_check "stdio.h" "#define _FILE_OFFSET_BITS 64" "fseeko(stdin,0,0);" ; then
+     define fseek fseeko
+     define ftell ftello
+ elif cc_check "stdio.h" "" "fseeko64(stdin,0,0);" ; then
+-- 
+2.37.3.windows.1
+


=====================================
contrib/src/x264/0001-osdep-use-direct-path-to-internal-x264.h.patch
=====================================
@@ -0,0 +1,26 @@
+From 2597083bc24f3d3172ecc4fc336face1fcc0c4e2 Mon Sep 17 00:00:00 2001
+From: Steve Lhomme <robux4 at ycbcr.xyz>
+Date: Thu, 21 Sep 2023 11:44:40 +0200
+Subject: [PATCH] osdep: use direct path to internal x264.h
+
+This fixes issues when a previous x264.h is found in the include path.
+---
+ common/osdep.h | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/common/osdep.h b/common/osdep.h
+index dfa4aaec..f3cd5822 100644
+--- a/common/osdep.h
++++ b/common/osdep.h
+@@ -49,7 +49,7 @@
+ #include <io.h>
+ #endif
+ 
+-#include "x264.h"
++#include "../x264.h"
+ 
+ #if !HAVE_LOG2F
+ #define log2f(x) (logf(x)/0.693147180559945f)
+-- 
+2.38.1.windows.1
+


=====================================
contrib/src/x264/rules.mak
=====================================
@@ -1,8 +1,8 @@
 # x264
 
-X264_GITURL := git://git.videolan.org/x264.git
-X264_SNAPURL := http://download.videolan.org/pub/videolan/x264/snapshots/x264-snapshot-20180324-2245.tar.bz2
-X262_GITURL := git://git.videolan.org/x262.git
+X264_HASH := e067ab0b530395f90b578f6d05ab0a225e2efdf9
+X264_VERSION := $(X264_HASH)
+X264_GITURL := https://code.videolan.org/videolan/x264.git
 
 ifdef BUILD_ENCODERS
 ifdef GPL
@@ -18,14 +18,9 @@ ifeq ($(call need_pkg,"x264 >= 0.153"),)
 PKGS_FOUND += x26410b
 endif
 
-#ifeq ($(call need_pkg,"x262"),)
-#PKGS_FOUND += x262
-#endif
-
 PKGS_ALL += x26410b
 
-X264CONF = --prefix="$(PREFIX)" --host="$(HOST)" \
-	--enable-static \
+X264CONF = \
 	--disable-avs \
 	--disable-lavf \
 	--disable-cli \
@@ -39,90 +34,46 @@ X264CONF += --enable-win32thread
 else
 X264CONF += --disable-win32thread
 endif
-ifeq ($(ARCH), arm)
-X264_AS = AS="./tools/gas-preprocessor.pl -arch arm -as-type clang -force-thumb -- $(CC) -mimplicit-it=always"
-endif
-ifeq ($(ARCH),aarch64)
-# Configure defaults to gas-preprocessor + armasm64 for this target,
-# unless overridden.
-X264_AS = AS="$(CC)"
-endif
 endif
 ifdef HAVE_CROSS_COMPILE
 ifndef HAVE_DARWIN_OS
+ifdef HAVE_ANDROID
+X264CONF += --cross-prefix="$(subst ld,,$(LD))"
+else
 X264CONF += --cross-prefix="$(HOST)-"
 endif
+endif
 ifdef HAVE_ANDROID
 # broken text relocations
 ifeq ($(ANDROID_ABI), x86)
 X264CONF += --disable-asm
 endif
-ifeq ($(ANDROID_ABI), x86_64)
-X264CONF += --disable-asm
-endif
-endif
 endif
-ifdef HAVE_DARWIN_OS
-ifeq ($(ARCH),aarch64)
-X264CONF += --extra-asflags="-arch $(PLATFORM_SHORT_ARCH)"
 endif
-endif
-
-$(TARBALLS)/x262-git.tar.xz:
-	$(call download_git,$(X262_GITURL))
-
-$(TARBALLS)/x262-git.tar.gz:
-	$(call download,$(X262_SNAPURL))
 
-$(TARBALLS)/x264-git.tar.xz:
-	$(call download_git,$(X264_GITURL))
-
-$(TARBALLS)/x264-git.tar.bz2:
-	$(call download,$(X264_SNAPURL))
-
-.sum-x262: x262-git.tar.gz
-	$(warning $@ not implemented)
-	touch $@
+$(TARBALLS)/x264-$(X264_VERSION).tar.xz:
+	$(call download_git,$(X264_GITURL),,$(X264_HASH))
 
 .sum-x26410b: .sum-x264
 	touch $@
 
-.sum-x264: x264-git.tar.bz2
-	$(warning $@ not implemented)
+.sum-x264: x264-$(X264_VERSION).tar.xz
+	$(call check_githash,$(X264_VERSION))
 	touch $@
 
-x264 x26410b: %: x264-git.tar.bz2 .sum-%
-	rm -Rf $*-git
-	mkdir -p $*-git
-	tar xvjfo "$<" --strip-components=1 -C $*-git
-	$(UPDATE_AUTOCONFIG)
-	mv $*-git $*
-
-x262: x262-git.tar.gz .sum-x262
-	rm -Rf $@-git
-	mkdir -p $@-git
-	tar xvzfo "$<" --strip-components=1 -C $@-git
+x264 x26410b: %: x264-$(X264_VERSION).tar.xz .sum-%
+	$(UNPACK)
 	$(UPDATE_AUTOCONFIG)
+	$(APPLY) $(SRC)/x264/x264-winstore.patch
+	$(APPLY) $(SRC)/x264/0001-osdep-use-direct-path-to-internal-x264.h.patch
+	$(APPLY) $(SRC)/x264/0001-configure-set-_FILE_OFFSET_BITS-to-detect-fseeko.patch
 	$(MOVE)
 
-
 .x264: x264
 	$(REQUIRE_GPL)
-	cd $< && $(HOSTVARS) ./configure $(HOSTCONF) $(X264_AS) $(X264CONF)
+	cd $< && $(HOSTVARS) ./configure $(HOSTCONF) $(X264CONF)
 	cd $< && $(MAKE) install
 	touch $@
 
 .x26410b: .x264
 	touch $@
-
-.x262: x262
-	$(REQUIRE_GPL)
-	cd $< && sed -i -e 's/x264/x262/g' configure
-	cd $< && sed -i -e 's/x264_config/x262_config/g' *.h Makefile *.c
-	cd $< && $(HOSTVARS) ./configure $(HOSTCONF) $(X264CONF)
-	cd $< && sed -i -e 's/x264.pc/x262.pc/g' Makefile
-	cd $< && sed -i -e 's/x264.h/x262.h/g' Makefile
-	cd $< && $(MAKE)
-	cd $< && cp x264.h x262.h
-	cd $< && $(MAKE) install
-	touch $@


=====================================
contrib/src/x264/x264-winstore.patch
=====================================
@@ -0,0 +1,23 @@
+--- x264/configure.winstore	2019-03-07 12:42:19.238431200 +0100
++++ x264/configure	2019-03-07 12:42:30.238709600 +0100
+@@ -841,15 +841,15 @@ if [ $SYS = WINDOWS ]; then
+     fi
+ 
+     if cpp_check "winapifamily.h" "" "!WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP)" ; then
+-        [ $compiler = CL ] || die "WinRT requires MSVC"
++        #~ [ $compiler = CL ] || die "WinRT requires MSVC"
+         define HAVE_WINRT
+-        CFLAGS="$CFLAGS -MD"
++        #~ 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"
+-        elif cpp_check "" "" "_WIN32_WINNT >= 0x0A00" ; then
+-            # Universal Windows Platform (Windows 10)
+-            LDFLAGS="$LDFLAGS -lWindowsApp"
++        #~ elif cpp_check "" "" "_WIN32_WINNT >= 0x0A00" ; then
++            #~ # Universal Windows Platform (Windows 10)
++            #~ LDFLAGS="$LDFLAGS -lWindowsApp"
+         fi
+         cli="no"
+         opencl="no"



View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/5cdb9b25440ec1d295e76bc866227a6f91502d55...9cf50d17c666ffe39cf5fcbf7d682a796f1f9dd2

-- 
View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/5cdb9b25440ec1d295e76bc866227a6f91502d55...9cf50d17c666ffe39cf5fcbf7d682a796f1f9dd2
You're receiving this email because of your account on code.videolan.org.


VideoLAN code repository instance


More information about the vlc-commits mailing list