summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndoni Morales Alastruey <ylatuya@gmail.com>2020-11-25 15:54:16 +0000
committerTim-Philipp Müller <tim@centricular.com>2021-01-13 01:06:31 +0000
commit26c2fe7298ad08519aadd60f5668819d86029c6a (patch)
tree2589cb6682141d15ad06e26b026058bafb6ec3d9
parent7171fcd37d0ad5824186269a565d5529d24a7f68 (diff)
libvpx: add support for macOS ARM64
Part-of: <https://gitlab.freedesktop.org/gstreamer/cerbero/-/merge_requests/661>
-rw-r--r--recipes/libvpx.recipe7
-rw-r--r--recipes/libvpx/0001-configure-add-darwin20-support.patch96
2 files changed, 102 insertions, 1 deletions
diff --git a/recipes/libvpx.recipe b/recipes/libvpx.recipe
index 11bc388c..dd1b96ad 100644
--- a/recipes/libvpx.recipe
+++ b/recipes/libvpx.recipe
@@ -39,6 +39,8 @@ class Recipe(recipe.Recipe):
'libvpx/0007-remove-old-visual-studio-remnants.patch',
# From upstream git master, remove on bump
'libvpx/0008-support-visual-studio-2019-vs16.patch',
+ # From upstream git master, remove on bump
+ 'libvpx/0001-configure-add-darwin20-support.patch',
]
files_libs = ['libvpx']
@@ -69,7 +71,10 @@ class Recipe(recipe.Recipe):
if self.config.target_platform == Platform.DARWIN:
self.configure_options += '--enable-shared '
- platform = 'darwin12'
+ if self.config.target_arch == Architecture.ARM64:
+ platform = 'darwin20'
+ else:
+ platform = 'darwin12'
elif self.config.target_platform == Platform.IOS:
if self.config.target_arch == Architecture.X86 or self.config.target_arch == Architecture.X86_64:
platform = 'iphonesimulator'
diff --git a/recipes/libvpx/0001-configure-add-darwin20-support.patch b/recipes/libvpx/0001-configure-add-darwin20-support.patch
new file mode 100644
index 00000000..0c045a3a
--- /dev/null
+++ b/recipes/libvpx/0001-configure-add-darwin20-support.patch
@@ -0,0 +1,96 @@
+From 99600f91a83f0d76a28b2ace99298e83b11da65d Mon Sep 17 00:00:00 2001
+From: James Zern <jzern@google.com>
+Date: Fri, 25 Sep 2020 13:21:11 -0700
+Subject: [PATCH] configure: add darwin20 support
+
+this release will have arm64 and x86_64 support. in the future it might
+be useful to move to mac/iphone targets to help disambiguate
+arm64-darwin-gcc and arm64-darwin20-gcc.
+
+Change-Id: I1f8b145303204af316955822f5e8bab51c47f353
+---
+ README | 1 +
+ build/make/configure.sh | 14 +++++++++++---
+ configure | 1 +
+ 3 files changed, 13 insertions(+), 3 deletions(-)
+
+diff --git a/README b/README
+index 8e0da5c..eccc571 100644
+--- a/README
++++ b/README
+@@ -62,6 +62,7 @@ COMPILING THE APPLICATIONS/LIBRARIES:
+
+ arm64-android-gcc
+ arm64-darwin-gcc
++ arm64-darwin20-gcc
+ arm64-linux-gcc
+ arm64-win64-gcc
+ arm64-win64-vs15
+diff --git a/build/make/configure.sh b/build/make/configure.sh
+index 4f3b32b..273fc81 100644
+--- a/build/make/configure.sh
++++ b/build/make/configure.sh
+@@ -799,6 +799,10 @@ process_common_toolchain() {
+ tgt_isa=x86_64
+ tgt_os=darwin17
+ ;;
++ *darwin20*)
++ tgt_isa=`uname -m`
++ tgt_os=`echo $gcctarget | sed 's/.*\(darwin2[0-9]\).*/\1/'`
++ ;;
+ x86_64*mingw32*)
+ tgt_os=win64
+ ;;
+@@ -873,7 +877,7 @@ process_common_toolchain() {
+ # Handle darwin variants. Newer SDKs allow targeting older
+ # platforms, so use the newest one available.
+ case ${toolchain} in
+- arm*-darwin*)
++ arm*-darwin-*)
+ add_cflags "-miphoneos-version-min=${IOS_VERSION_MIN}"
+ iphoneos_sdk_dir="$(show_darwin_sdk_path iphoneos)"
+ if [ -d "${iphoneos_sdk_dir}" ]; then
+@@ -881,7 +885,7 @@ process_common_toolchain() {
+ add_ldflags "-isysroot ${iphoneos_sdk_dir}"
+ fi
+ ;;
+- x86*-darwin*)
++ *-darwin*)
+ osx_sdk_dir="$(show_darwin_sdk_path macosx)"
+ if [ -d "${osx_sdk_dir}" ]; then
+ add_cflags "-isysroot ${osx_sdk_dir}"
+@@ -931,6 +935,10 @@ process_common_toolchain() {
+ add_cflags "-mmacosx-version-min=10.13"
+ add_ldflags "-mmacosx-version-min=10.13"
+ ;;
++ *-darwin20-*)
++ add_cflags "-mmacosx-version-min=10.16"
++ add_ldflags "-mmacosx-version-min=10.16"
++ ;;
+ *-iphonesimulator-*)
+ add_cflags "-mios-simulator-version-min=${IOS_VERSION_MIN}"
+ add_ldflags "-mios-simulator-version-min=${IOS_VERSION_MIN}"
+@@ -1104,7 +1112,7 @@ EOF
+ soft_enable unit_tests
+ ;;
+
+- darwin*)
++ darwin)
+ XCRUN_FIND="xcrun --sdk iphoneos --find"
+ CXX="$(${XCRUN_FIND} clang++)"
+ CC="$(${XCRUN_FIND} clang)"
+diff --git a/configure b/configure
+index b681f1b..f097266 100755
+--- a/configure
++++ b/configure
+@@ -99,6 +99,7 @@ EOF
+ # alphabetically by architecture, generic-gnu last.
+ all_platforms="${all_platforms} arm64-android-gcc"
+ all_platforms="${all_platforms} arm64-darwin-gcc"
++all_platforms="${all_platforms} arm64-darwin20-gcc"
+ all_platforms="${all_platforms} arm64-linux-gcc"
+ all_platforms="${all_platforms} arm64-win64-gcc"
+ all_platforms="${all_platforms} arm64-win64-vs15"
+--
+2.23.0
+