ALL: Add libvpx library

This commit is contained in:
Le Philousophe
2023-03-11 10:33:34 +00:00
parent 6626ed8078
commit e51ba89d98
25 changed files with 367 additions and 0 deletions
+2
View File
@@ -72,6 +72,8 @@ local_package(libmpeg2)
local_package(liba52)
local_package(libvpx)
local_package(libopenssl)
# Needed by precompiled libcurl
+13
View File
@@ -0,0 +1,13 @@
#! /bin/sh
PACKAGE_DIR=$(CDPATH= cd -- "$(dirname -- "$0")" && pwd)
HELPERS_DIR=$PACKAGE_DIR/../..
. $HELPERS_DIR/functions.sh
do_make_bdir
do_lha_fetch graphics/libvpx "SDK"
do_lha_install
do_clean_bdir
@@ -0,0 +1,25 @@
From cebce96d91c2e04bc07025f04ef093438a0f99dd Mon Sep 17 00:00:00 2001
From: Le Philousophe <lephilousophe@users.noreply.github.com>
Date: Sun, 12 Mar 2023 16:36:43 +0100
Subject: [PATCH 3/3] Fix Android build on x86
---
build/make/configure.sh | 2 ++
1 file changed, 2 insertions(+)
diff --git a/build/make/configure.sh b/build/make/configure.sh
index 890be135b..8dfda7da7 100644
--- a/build/make/configure.sh
+++ b/build/make/configure.sh
@@ -1378,6 +1378,8 @@ EOF
add_asflags -f elf${bits}
enabled debug && [ "${AS}" = yasm ] && add_asflags -g dwarf2
enabled debug && [ "${AS}" = nasm ] && add_asflags -g
+ # x86 uses nasm which hasn't __ANDROID__ defined
+ [ "${AS##*/}" = nasm ] && add_asflags "-D__ANDROID__"
[ "${AS##*/}" = nasm ] && check_asm_align
;;
darwin*)
--
2.39.2
@@ -0,0 +1,209 @@
From 63615b5abe9bc0c2e7a6700922f18648cc3a4800 Mon Sep 17 00:00:00 2001
From: Le Philousophe <lephilousophe@users.noreply.github.com>
Date: Sat, 11 Mar 2023 14:17:09 +0100
Subject: [PATCH 3/3] Remove Darwin special treatment
We don't use Xcode
iOS and AppleTV don't support linking
---
build/make/configure.sh | 155 ++--------------------------------------
1 file changed, 4 insertions(+), 151 deletions(-)
diff --git a/build/make/configure.sh b/build/make/configure.sh
index 890be135b..ad1ffcf1c 100644
--- a/build/make/configure.sh
+++ b/build/make/configure.sh
@@ -739,7 +739,7 @@ process_common_toolchain() {
gcctarget="${CHOST:-$($CC -dumpmachine 2> /dev/null)}"
# detect tgt_isa
case "$gcctarget" in
- aarch64*)
+ aarch64*|arm64*)
tgt_isa=arm64
;;
armv7*-hardfloat* | armv7*-gnueabihf | arm-*-gnueabihf)
@@ -772,8 +772,10 @@ process_common_toolchain() {
# detect tgt_os
case "$gcctarget" in
+ *arm*-darwin*)
+ tgt_os=darwin
+ ;;
*darwin1[0-9]*)
- tgt_isa=x86_64
tgt_os=`echo $gcctarget | sed 's/.*\(darwin1[0-9]\).*/\1/'`
;;
x86_64*mingw32*)
@@ -837,96 +839,6 @@ process_common_toolchain() {
# PIC is probably what we want when building shared libs
enabled shared && soft_enable pic
- # Minimum iOS version for all target platforms (darwin and iphonesimulator).
- # Shared library framework builds are only possible on iOS 8 and later.
- if enabled shared; then
- IOS_VERSION_OPTIONS="--enable-shared"
- IOS_VERSION_MIN="8.0"
- else
- IOS_VERSION_OPTIONS=""
- IOS_VERSION_MIN="7.0"
- fi
-
- # Handle darwin variants. Newer SDKs allow targeting older
- # platforms, so use the newest one available.
- case ${toolchain} in
- arm*-darwin*)
- add_cflags "-miphoneos-version-min=${IOS_VERSION_MIN}"
- iphoneos_sdk_dir="$(show_darwin_sdk_path iphoneos)"
- if [ -d "${iphoneos_sdk_dir}" ]; then
- add_cflags "-isysroot ${iphoneos_sdk_dir}"
- add_ldflags "-isysroot ${iphoneos_sdk_dir}"
- fi
- ;;
- x86*-darwin*)
- osx_sdk_dir="$(show_darwin_sdk_path macosx)"
- if [ -d "${osx_sdk_dir}" ]; then
- add_cflags "-isysroot ${osx_sdk_dir}"
- add_ldflags "-isysroot ${osx_sdk_dir}"
- fi
- ;;
- esac
-
- case ${toolchain} in
- *-darwin8-*)
- add_cflags "-mmacosx-version-min=10.4"
- add_ldflags "-mmacosx-version-min=10.4"
- ;;
- *-darwin9-*)
- add_cflags "-mmacosx-version-min=10.5"
- add_ldflags "-mmacosx-version-min=10.5"
- ;;
- *-darwin10-*)
- add_cflags "-mmacosx-version-min=10.6"
- add_ldflags "-mmacosx-version-min=10.6"
- ;;
- *-darwin11-*)
- add_cflags "-mmacosx-version-min=10.7"
- add_ldflags "-mmacosx-version-min=10.7"
- ;;
- *-darwin12-*)
- add_cflags "-mmacosx-version-min=10.8"
- add_ldflags "-mmacosx-version-min=10.8"
- ;;
- *-darwin13-*)
- add_cflags "-mmacosx-version-min=10.9"
- add_ldflags "-mmacosx-version-min=10.9"
- ;;
- *-darwin14-*)
- add_cflags "-mmacosx-version-min=10.10"
- add_ldflags "-mmacosx-version-min=10.10"
- ;;
- *-darwin15-*)
- add_cflags "-mmacosx-version-min=10.11"
- add_ldflags "-mmacosx-version-min=10.11"
- ;;
- *-darwin16-*)
- add_cflags "-mmacosx-version-min=10.12"
- add_ldflags "-mmacosx-version-min=10.12"
- ;;
- *-darwin17-*)
- add_cflags "-mmacosx-version-min=10.13"
- add_ldflags "-mmacosx-version-min=10.13"
- ;;
- *-darwin18-*)
- add_cflags "-mmacosx-version-min=10.14"
- add_ldflags "-mmacosx-version-min=10.14"
- ;;
- *-darwin19-*)
- add_cflags "-mmacosx-version-min=10.15"
- add_ldflags "-mmacosx-version-min=10.15"
- ;;
- *-iphonesimulator-*)
- add_cflags "-miphoneos-version-min=${IOS_VERSION_MIN}"
- add_ldflags "-miphoneos-version-min=${IOS_VERSION_MIN}"
- iossim_sdk_dir="$(show_darwin_sdk_path iphonesimulator)"
- if [ -d "${iossim_sdk_dir}" ]; then
- add_cflags "-isysroot ${iossim_sdk_dir}"
- add_ldflags "-isysroot ${iossim_sdk_dir}"
- fi
- ;;
- esac
-
# Handle Solaris variants. Solaris 10 needs -lposix4
case ${toolchain} in
sparc-solaris-*)
@@ -1090,62 +1002,6 @@ EOF
;;
darwin*)
- if ! enabled external_build; then
- XCRUN_FIND="xcrun --sdk iphoneos --find"
- CXX="$(${XCRUN_FIND} clang++)"
- CC="$(${XCRUN_FIND} clang)"
- AR="$(${XCRUN_FIND} ar)"
- AS="$(${XCRUN_FIND} as)"
- STRIP="$(${XCRUN_FIND} strip)"
- NM="$(${XCRUN_FIND} nm)"
- RANLIB="$(${XCRUN_FIND} ranlib)"
- AS_SFX=.S
- LD="${CXX:-$(${XCRUN_FIND} ld)}"
-
- # ASFLAGS is written here instead of using check_add_asflags
- # because we need to overwrite all of ASFLAGS and purge the
- # options that were put in above
- ASFLAGS="-arch ${tgt_isa} -g"
-
- add_cflags -arch ${tgt_isa}
- add_ldflags -arch ${tgt_isa}
-
- alt_libc="$(show_darwin_sdk_path iphoneos)"
- if [ -d "${alt_libc}" ]; then
- add_cflags -isysroot ${alt_libc}
- fi
-
- if [ "${LD}" = "${CXX}" ]; then
- add_ldflags -miphoneos-version-min="${IOS_VERSION_MIN}"
- else
- add_ldflags -ios_version_min "${IOS_VERSION_MIN}"
- fi
-
- for d in lib usr/lib usr/lib/system; do
- try_dir="${alt_libc}/${d}"
- [ -d "${try_dir}" ] && add_ldflags -L"${try_dir}"
- done
-
- case ${tgt_isa} in
- armv7|armv7s|armv8|arm64)
- if enabled neon && ! check_xcode_minimum_version; then
- soft_disable neon
- log_echo " neon disabled: upgrade Xcode (need v6.3+)."
- if enabled neon_asm; then
- soft_disable neon_asm
- log_echo " neon_asm disabled: upgrade Xcode (need v6.3+)."
- fi
- fi
- ;;
- esac
-
- if [ "$(show_darwin_sdk_major_version iphoneos)" -gt 8 ]; then
- check_add_cflags -fembed-bitcode
- check_add_asflags -fembed-bitcode
- check_add_ldflags -fembed-bitcode
- fi
- fi
-
asm_conversion_cmd="${source_path}/build/make/ads2gas_apple.pl"
;;
@@ -1382,9 +1238,6 @@ EOF
;;
darwin*)
add_asflags -f macho${bits}
- enabled x86 && darwin_arch="-arch i386" || darwin_arch="-arch x86_64"
- add_cflags ${darwin_arch}
- add_ldflags ${darwin_arch}
# -mdynamic-no-pic is still a bit of voodoo -- it was required at
# one time, but does not seem to be now, and it breaks some of the
# code that still relies on inline assembly.
--
2.39.2
+3
View File
@@ -72,6 +72,9 @@ helpers_package(mpeg2dec)
# No a52dec in the original toolchain build ours statically
helpers_package(a52dec)
# No libvpx in the original toolchain build ours statically
helpers_package(libvpx)
# Use same version as official toolchain
local_package(freetype)
+17
View File
@@ -0,0 +1,17 @@
#! /bin/sh
PACKAGE_DIR=$(CDPATH= cd -- "$(dirname -- "$0")" && pwd)
HELPERS_DIR=$PACKAGE_DIR/../..
. $HELPERS_DIR/functions.sh
do_make_bdir
do_pkg_fetch libvpx
do_configure --disable-examples --disable-tools --disable-docs --disable-unit-tests --disable-install-bins --disable-install-srcs \
--size-limit=16384x16384 --disable-vp8-encoder --disable-vp9-encoder \
"$@"
do_make
do_make install
do_clean_bdir
@@ -0,0 +1,25 @@
From dd8b17714488f64fa28e1ff354eac59d73e61af3 Mon Sep 17 00:00:00 2001
From: Le Philousophe <lephilousophe@users.noreply.github.com>
Date: Sat, 11 Mar 2023 14:16:19 +0100
Subject: [PATCH 1/3] Ignore --bindir and --host
---
build/make/configure.sh | 2 ++
1 file changed, 2 insertions(+)
diff --git a/build/make/configure.sh b/build/make/configure.sh
index 206b54f77..e3f86654b 100644
--- a/build/make/configure.sh
+++ b/build/make/configure.sh
@@ -653,6 +653,8 @@ process_common_cmdline() {
--help|-h)
show_help
;;
+ --host=*|--bindir=*)
+ ;;
*)
die_unknown $opt
;;
--
2.39.2
@@ -0,0 +1,29 @@
From 33981cf102f3a9b48ee70b87b54df40e42e31dd5 Mon Sep 17 00:00:00 2001
From: Le Philousophe <lephilousophe@users.noreply.github.com>
Date: Sat, 11 Mar 2023 14:16:49 +0100
Subject: [PATCH 2/3] Use CC to determine target platform
In this case, don't check link as it may not work on some platforms
---
build/make/configure.sh | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/build/make/configure.sh b/build/make/configure.sh
index e3f86654b..890be135b 100644
--- a/build/make/configure.sh
+++ b/build/make/configure.sh
@@ -733,7 +733,10 @@ check_xcode_minimum_version() {
process_common_toolchain() {
if [ -z "$toolchain" ]; then
- gcctarget="${CHOST:-$(gcc -dumpmachine 2> /dev/null)}"
+ if [ -n "$CC" ]; then
+ check_ld() { true; }
+ fi
+ gcctarget="${CHOST:-$($CC -dumpmachine 2> /dev/null)}"
# detect tgt_isa
case "$gcctarget" in
aarch64*)
--
2.39.2
+3
View File
@@ -61,6 +61,9 @@ helpers_package(mpeg2dec)
helpers_package(a52dec)
# Multithreading is not functional (and it's only one core anyway)
helpers_package(libvpx, --disable-multithread)
# curl is already installed in original toolchain
# freetype is already installed in original toolchain
+3
View File
@@ -78,6 +78,9 @@ helpers_package(mpeg2dec, , CFLAGS="$CFLAGS -mno-altivec")
helpers_package(a52dec)
# Multithreading is not functional (and it's only one core anyway)
helpers_package(libvpx, --disable-multithread)
# curl
# freetype is already installed in original-toolchain
+2
View File
@@ -73,6 +73,8 @@ helpers_package(mpeg2dec)
helpers_package(a52dec)
# libvpx is already installed in original toolchain
# curl is already installed in original toolchain
# freetype is already installed in original toolchain
+3
View File
@@ -84,6 +84,9 @@ helpers_package(mpeg2dec)
# No a52dec in the original toolchain build ours statically
helpers_package(a52dec)
# No libvpx in the original toolchain build ours statically
helpers_package(libvpx)
# Use same version as official toolchain
local_package(freetype)
+5
View File
@@ -28,6 +28,11 @@ helpers_package(mpeg2dec)
helpers_package(a52dec)
# --as is used for x86* and overrides AS environment variable: exactly what we want
# Fix build with nasm
COPY --from=android-helpers /lib-helpers/packages/libvpx lib-helpers/packages/libvpx
helpers_package(libvpx, --as=nasm)
android_package(openssl)
helpers_package(curl)
+2
View File
@@ -131,6 +131,8 @@ helpers_package(mpeg2dec)
ports_package(a52dec)
ports_package(libvpx)
# No curl as it's provided in SDK
# Ports package is linked with brotli and fails to link statically because of
+5
View File
@@ -117,6 +117,11 @@ helpers_package(mpeg2dec)
helpers_package(a52dec)
# libvpx thinks that darwin means xcode and adds too many flags
# disable this treatment
COPY --from=apple-common /lib-helpers/packages/libvpx lib-helpers/packages/libvpx
helpers_package(libvpx)
# Force -miphoneos-version-min as it gets added by curl if not already defined
# In this case curl uses 10.8, this behaviour has been removed in curl 7.76.1
# Undo patch by Debian which makes use of specific linker flags
+2
View File
@@ -58,6 +58,8 @@ helpers_package(mpeg2dec)
helpers_package(a52dec)
helpers_package(libvpx)
# curl is already installed in original toolchain
# freetype is already installed in original toolchain
+2
View File
@@ -83,6 +83,8 @@ local_mxe_package(libmpeg2)
mxe_package(a52dec)
mxe_package(libvpx)
local_mxe_package(curl-light)
mxe_package(freetype-bootstrap)
+2
View File
@@ -54,6 +54,8 @@ helpers_package(mpeg2dec)
helpers_package(a52dec)
helpers_package(libvpx)
# No curl support in configure
# freetype is already installed in original toolchain
+3
View File
@@ -78,6 +78,9 @@ helpers_package(mpeg2dec)
# No a52dec in the original toolchain build ours statically
helpers_package(a52dec)
# No libvpx in the original toolchain build ours statically
helpers_package(libvpx)
# Use same version as official toolchain
local_package(freetype)
+3
View File
@@ -73,6 +73,9 @@ helpers_package(mpeg2dec)
# No a52dec in the original toolchain build ours statically
helpers_package(a52dec)
# No libvpx in the original toolchain build ours statically
helpers_package(libvpx)
# Use same version as official toolchain
local_package(freetype)
+1
View File
@@ -40,6 +40,7 @@ multistrap_package(libsndio-dev)
multistrap_package(libspeechd-dev)
multistrap_package(libtheora-dev)
multistrap_package(libvorbis-dev)
multistrap_package(libvpx-dev)
multistrap_package(libwxgtk3.0-gtk3-dev)
multistrap_package(zlib1g-dev)
+2
View File
@@ -90,6 +90,8 @@ helpers_package(mpeg2dec)
helpers_package(a52dec)
helpers_package(libvpx)
# helpers_package(openssl)
# helpers_package(curl)
+2
View File
@@ -54,6 +54,8 @@ vdpm_package(libmpeg2)
helpers_package(a52dec)
vdpm_package(libvpx)
vdpm_package(openssl)
vdpm_package(curl)
+3
View File
@@ -70,6 +70,9 @@ helpers_package(mpeg2dec)
COPY packages/a52dec lib-helpers/packages/a52dec/
helpers_package(a52dec)
# Windows 95 doesn't handle well SSE
helpers_package(libvpx, --as=nasm --disable-sse)
# TODO: mbedTLS
# TODO: curl
+1
View File
@@ -25,6 +25,7 @@ RUN apt-get update && \
libtheora-dev`'APT_ARCH \
libunity-dev`'APT_ARCH \
libvorbis-dev`'APT_ARCH \
libvpx-dev`'APT_ARCH \
libwxgtk3.0-gtk3-dev`'APT_ARCH \
zlib1g-dev`'APT_ARCH \
&& \