[vlc-commits] [Git][videolan/vlc][master] 6 commits: contrib: live555: always apply android patches

Steve Lhomme (@robUx4) gitlab at videolan.org
Sun Apr 14 07:56:49 UTC 2024



Steve Lhomme pushed to branch master at VideoLAN / VLC


Commits:
6a3d4a36 by Steve Lhomme at 2024-04-14T07:11:12+00:00
contrib: live555: always apply android patches

They are checking for __ANDROID__ so can be used in all sources.

- - - - -
c86ce345 by Steve Lhomme at 2024-04-14T07:11:12+00:00
libplacebo: don't force the vulkan registry location

Since 19aee6c4b40724527bce1ff88fcfaa06c61bea79 it looks in 'prefix'/'datadir'
which should correspond to our PREFIX/share.

- - - - -
b0d6f9ad by Steve Lhomme at 2024-04-14T07:11:12+00:00
contrib: libplacebo: try to use the NDK vulkan registry

- - - - -
dbc272a9 by Steve Lhomme at 2024-04-14T07:11:12+00:00
contrib: put the Android NDK, ABI and API in the CMake toolchain

This is what the documentation says we should use [1].

[1] https://cmake.org/cmake/help/latest/manual/cmake-toolchains.7.html#cross-compiling-for-android-with-the-ndk

- - - - -
34c2fd1c by Steve Lhomme at 2024-04-14T07:11:12+00:00
contrib: set the NDK path to Vulkan headers

They are not guessed by libplacebo which includes extensions not found in the
prebuilt vulkan headers, but are found in that location.

- - - - -
e64f5d7c by Steve Lhomme at 2024-04-14T07:11:12+00:00
contrib: vulkan-headers: fix detection

- - - - -


6 changed files:

- contrib/src/gen-cmake-toolchain.py
- + contrib/src/libplacebo/0004-vulkan-utils_gen-try-to-locate-the-vulkan-registry-i.patch
- contrib/src/libplacebo/rules.mak
- contrib/src/live555/rules.mak
- contrib/src/main.mak
- contrib/src/vulkan-headers/rules.mak


Changes:

=====================================
contrib/src/gen-cmake-toolchain.py
=====================================
@@ -46,6 +46,9 @@ _add_environ_val('CMAKE_CXX_COMPILER', 'CXX')
 _add_environ_val('CMAKE_C_SYSROOT_FLAG', 'C_SYSROOT_FLAG')
 _add_environ_val('CMAKE_CXX_SYSROOT_FLAG', 'CXX_SYSROOT_FLAG')
 
+_add_environ_val('CMAKE_ANDROID_NDK', 'ANDROID_NDK')
+_add_environ_val('CMAKE_ANDROID_ARCH_ABI', 'ANDROID_ABI')
+_add_environ_val('CMAKE_ANDROID_API', 'ANDROID_API')
 
 _add_environ_val('CMAKE_FIND_ROOT_PATH', 'PREFIX')
 


=====================================
contrib/src/libplacebo/0004-vulkan-utils_gen-try-to-locate-the-vulkan-registry-i.patch
=====================================
@@ -0,0 +1,25 @@
+From 5acce05c63c7b0f4a952d1258153da283b95bf8a Mon Sep 17 00:00:00 2001
+From: Steve Lhomme <robux4 at ycbcr.xyz>
+Date: Fri, 12 Apr 2024 08:12:45 +0200
+Subject: [PATCH 4/4] vulkan/utils_gen: try to locate the vulkan registry in
+ the Android NDK
+
+---
+ src/vulkan/utils_gen.py | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/src/vulkan/utils_gen.py b/src/vulkan/utils_gen.py
+index 4bbe185b..4fe4a2d6 100644
+--- a/src/vulkan/utils_gen.py
++++ b/src/vulkan/utils_gen.py
+@@ -215,6 +215,7 @@ def find_registry_xml(datadir):
+         '$MINGW_PREFIX/share/vulkan/registry/vk.xml',
+         '%VULKAN_SDK%/share/vulkan/registry/vk.xml',
+         '$VULKAN_SDK/share/vulkan/registry/vk.xml',
++        '$ANDROID_NDK/sources/third_party/vulkan/src/registry/vk.xml',
+         '/usr/share/vulkan/registry/vk.xml',
+     ]
+ 
+-- 
+2.37.3.windows.1
+


=====================================
contrib/src/libplacebo/rules.mak
=====================================
@@ -5,7 +5,6 @@ PLACEBO_ARCHIVE = libplacebo-v$(PLACEBO_VERSION).tar.gz
 PLACEBO_URL := https://code.videolan.org/videolan/libplacebo/-/archive/v$(PLACEBO_VERSION)/$(PLACEBO_ARCHIVE)
 
 PLACEBOCONF := -Dpython-path=$(PYTHON_VENV)/bin/python3 \
-	-Dvulkan-registry=${PREFIX}/share/vulkan/registry/vk.xml \
 	-Dglslang=enabled \
 	-Dshaderc=disabled \
 	-Ddemos=false \
@@ -41,6 +40,7 @@ libplacebo: $(PLACEBO_ARCHIVE) .sum-libplacebo
 	$(APPLY) $(SRC)/libplacebo/0001-vulkan-meson-add-the-clang-gcc-C-runtime.patch
 	$(APPLY) $(SRC)/libplacebo/0001-meson-allow-overriding-python3-path.patch
 	$(APPLY) $(SRC)/libplacebo/0001-meson-allow-forcing-the-path-to-look-for-libraries.patch
+	$(APPLY) $(SRC)/libplacebo/0004-vulkan-utils_gen-try-to-locate-the-vulkan-registry-i.patch
 	$(MOVE)
 
 .libplacebo: libplacebo crossfile.meson .python-venv


=====================================
contrib/src/live555/rules.mak
=====================================
@@ -83,12 +83,10 @@ endif
 	$(APPLY) $(SRC)/live555/mingw-static-libs.patch
 	# FormatMessageA is available on all Windows versions, even WinRT
 	$(APPLY) $(SRC)/live555/live555-formatmessage.patch
-ifdef HAVE_ANDROID
 	# ifaddrs.h is supported since API level 24
 	$(APPLY) $(SRC)/live555/android-no-ifaddrs.patch
 	# Don't use unavailable off64_t functions
 	$(APPLY) $(SRC)/live555/file-offset-bits-64.patch
-endif
 	cd $(UNPACK_DIR) && sed -i.orig "s,LIBRARY_LINK =.*,LIBRARY_LINK = $(AR) cr ,g" config.macosx*
 	mv live.$(LIVE555_VERSION) $@ && touch $@
 


=====================================
contrib/src/main.mak
=====================================
@@ -142,6 +142,13 @@ LN_S = cp -R
 endif
 endif
 
+ifdef HAVE_ANDROID
+# Android NDK has vulkan headers but vulkan.h from the sysroot but it is not
+# the actual vulkan version from the Android NDK, the proper one is located
+# in this third_party folder
+EXTRA_CFLAGS += -isystem$(ANDROID_NDK)/sources/third_party/vulkan/src/include
+endif
+
 ifdef HAVE_SOLARIS
 ifeq ($(ARCH),x86_64)
 EXTRA_CFLAGS += -m64
@@ -470,7 +477,7 @@ ifdef HAVE_WIN32
 CMAKE += -DCMAKE_DEBUG_POSTFIX:STRING=
 endif
 ifdef HAVE_ANDROID
-CMAKE += -DANDROID:BOOL=ON -DANDROID_NDK=$(ANDROID_NDK)
+CMAKE += -DANDROID:BOOL=ON
 endif
 ifdef MSYS_BUILD
 CMAKE = PKG_CONFIG_LIBDIR="$(PKG_CONFIG_PATH)" $(CMAKE)
@@ -695,6 +702,9 @@ ifdef HAVE_CROSS_COMPILE
 	CMAKE_TOOLCHAIN_ENV += PATH_MODE_PACKAGE="ONLY"
 endif
 ifdef HAVE_ANDROID
+	CMAKE_TOOLCHAIN_ENV += ANDROID_NDK=$(ANDROID_NDK)
+	CMAKE_TOOLCHAIN_ENV += ANDROID_ABI=$(ANDROID_ABI)
+	CMAKE_TOOLCHAIN_ENV += ANDROID_ABI=$(ANDROID_API)
 # cmake will overwrite our --sysroot with a native (host) one on Darwin
 # Set it to "" right away to short-circuit this behaviour
 	CMAKE_TOOLCHAIN_ENV += CXX_SYSROOT_FLAG=


=====================================
contrib/src/vulkan-headers/rules.mak
=====================================
@@ -13,8 +13,9 @@ VULKAN_HEADERS_MIN_VERSION_NAME := $(subst $() ,_,$(wordlist 1,2,$(VULKAN_HEADER
 # VK_VERSION_X_Y header guard defines instead to detect major/minor, and
 # then use VK_HEADER_VERSION which is not defined as a cast for the patch
 # version.
-define VULKAN_HEADERS_CHECK := # include <vulkan/vulkan_core.h> \n
-# if defined(VK_VERSION_$(VULKAN_HEADERS_MIN_VERSION_NAME))) \\n
+define VULKAN_HEADERS_CHECK :=
+# include <vulkan/vulkan_core.h> \n
+# if defined(VK_VERSION_$(VULKAN_HEADERS_MIN_VERSION_NAME)) \n
 #    && VK_HEADER_VERSION >= $(lastword $(VULKAN_HEADERS_MIN_VERSION_LIST)) \n
 #  define VULKAN_HEADERS_OK \n
 # endif \n



View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/e07f88d7221c818abbd0789980a9e4b1fcb06210...e64f5d7cc3b3f3c94e5c50a536d5b20eb1e7ae74

-- 
View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/e07f88d7221c818abbd0789980a9e4b1fcb06210...e64f5d7cc3b3f3c94e5c50a536d5b20eb1e7ae74
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