Skip to content

Commit

Permalink
update vpx version for macos and windows. remove unneeded vpx patches
Browse files Browse the repository at this point in the history
  • Loading branch information
zoff99 committed Nov 6, 2023
1 parent 8e8e2bf commit 939fd3c
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 208 deletions.
30 changes: 21 additions & 9 deletions buildscripts/build_vpx.sh
Original file line number Diff line number Diff line change
Expand Up @@ -33,16 +33,12 @@ fi

"${SCRIPT_DIR}/download/download_vpx.sh"

if [ "${SCRIPT_ARCH}" == "macos" ]; then
patch -Np1 < "${SCRIPT_DIR}/patches/vpx-macos.patch"
else
patch -Np1 < "${SCRIPT_DIR}/patches/vpx-windows.patch"
fi

CFLAGS="${ARCH_FLAGS} ${CROSS_CFLAG}" \
CPPFLAGS="${CROSS_CPPFLAG}" \
LDFLAGS="${CROSS_LDFLAG}" \
CROSS="${CROSS_ARG}" \
if [ "${SCRIPT_ARCH}" == "macos" ]; then
CFLAGS="${ARCH_FLAGS} ${CROSS_CFLAG}" \
CPPFLAGS="${CROSS_CPPFLAG}" \
LDFLAGS="${CROSS_LDFLAG}" \
CROSS="${CROSS_ARG}" \
./configure \
${TARGET_ARG} \
"--prefix=${DEP_PREFIX}" \
Expand All @@ -53,6 +49,22 @@ CROSS="${CROSS_ARG}" \
--disable-tools \
--disable-docs \
--disable-unit-tests
else
CFLAGS="${ARCH_FLAGS} ${CROSS_CFLAG}" \
CPPFLAGS="${CROSS_CPPFLAG}" \
LDFLAGS="${CROSS_LDFLAG}" \
CROSS="${CROSS_ARG}" \
./configure \
${TARGET_ARG} \
"--prefix=${DEP_PREFIX}" \
--disable-shared \
--enable-static \
--enable-runtime-cpu-detect \
--disable-examples \
--disable-tools \
--disable-docs \
--disable-unit-tests
fi

make -j "${MAKE_JOBS}"
make install
Expand Down
2 changes: 1 addition & 1 deletion buildscripts/docker/Dockerfile.windows_builder
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,7 @@ RUN mkdir /export && \
cp /windows/bin/libcrypto-*.dll /export && \
cp /windows/bin/libtoxcore.dll /export && \
cp /windows/bin/libopus-*.dll /export && \
cp /windows/lib/libvpx.dll /export && \
cp /windows/lib/libvpx.a /export && \
cp /windows/bin/OpenAL32.dll /export && \
cp /windows/bin/libssl-*.dll /export && \
cp /windows/bin/libsnore-qt5.dll /export && \
Expand Down
4 changes: 2 additions & 2 deletions buildscripts/download/download_vpx.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@

set -euo pipefail

VPX_VERSION=1.11.0
VPX_HASH=965e51c91ad9851e2337aebcc0f517440c637c506f3a03948062e3d5ea129a83
VPX_VERSION=1.13.1
VPX_HASH=00dae80465567272abd077f59355f95ac91d7809a2d3006f9ace2637dd429d14

source "$(dirname "$(realpath "$0")")/common.sh"

Expand Down
74 changes: 0 additions & 74 deletions buildscripts/patches/vpx-macos.patch
Original file line number Diff line number Diff line change
@@ -1,74 +0,0 @@
diff -ruN libvpx/build/make/configure.sh patched/build/make/configure.sh
--- libvpx/build/make/configure.sh 2022-01-08 21:54:57.787015678 -0800
+++ patched/build/make/configure.sh 2022-01-08 21:55:09.227106767 -0800
@@ -869,70 +869,6 @@
;;
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"
- ;;
- *-darwin20-*)
- add_cflags "-mmacosx-version-min=10.16 -arch ${toolchain%%-*}"
- add_ldflags "-mmacosx-version-min=10.16 -arch ${toolchain%%-*}"
- ;;
- *-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-*)
122 changes: 0 additions & 122 deletions buildscripts/patches/vpx-windows.patch
Original file line number Diff line number Diff line change
@@ -1,122 +0,0 @@
Fix VPX not supporting creation of dll
Modified version of https://aur.archlinux.org/cgit/aur.git/tree/configure.patch?h=mingw-w64-libvpx&id=6d658aa0f4d8409fcbd0f20be2c0adcf1e81a297

diff -ruN libvpx/build/make/configure.sh patched/build/make/configure.sh
--- libvpx/build/make/configure.sh 2019-02-13 16:56:48.972857636 +0100
+++ patched/build/make/configure.sh 2019-02-13 16:50:37.995967583 +0100
@@ -1426,11 +1426,13 @@
win32)
add_asflags -f win32
enabled debug && add_asflags -g cv8
+ add_ldflags "-Wl,-no-undefined"
EXE_SFX=.exe
;;
win64)
add_asflags -f win64
enabled debug && add_asflags -g cv8
+ add_ldflags "-Wl,-no-undefined"
EXE_SFX=.exe
;;
linux*|solaris*|android*)
diff -ruN libvpx/build/make/Makefile patched/build/make/Makefile
--- libvpx/build/make/Makefile 2019-02-13 16:56:48.972857636 +0100
+++ patched/build/make/Makefile 2019-02-13 16:50:37.995967583 +0100
@@ -304,6 +304,7 @@
$(if $(quiet),@echo " [LD] $$@")
$(qexec)$$(LD) -shared $$(LDFLAGS) \
-Wl,--no-undefined -Wl,-soname,$$(SONAME) \
+ -Wl,-out-implib,libvpx.dll.a \
-Wl,--version-script,$$(EXPORTS_FILE) -o $$@ \
$$(filter %.o,$$^) $$(extralibs)
endef
@@ -388,7 +389,7 @@
.libs: $(LIBS)
@touch $@
$(foreach lib,$(filter %_g.a,$(LIBS)),$(eval $(call archive_template,$(lib))))
-$(foreach lib,$(filter %so.$(SO_VERSION_MAJOR).$(SO_VERSION_MINOR).$(SO_VERSION_PATCH),$(LIBS)),$(eval $(call so_template,$(lib))))
+$(foreach lib,$(filter %dll,$(LIBS)),$(eval $(call so_template,$(lib))))
$(foreach lib,$(filter %$(SO_VERSION_MAJOR).dylib,$(LIBS)),$(eval $(call dl_template,$(lib))))
$(foreach lib,$(filter %$(SO_VERSION_MAJOR).dll,$(LIBS)),$(eval $(call dll_template,$(lib))))

diff -ruN libvpx/configure patched/configure
--- libvpx/configure 2019-02-13 16:56:49.162860897 +0100
+++ patched/configure 2019-02-13 16:53:03.328719607 +0100
@@ -513,23 +513,23 @@
}

process_detect() {
- if enabled shared; then
+ #if enabled shared; then
# Can only build shared libs on a subset of platforms. Doing this check
# here rather than at option parse time because the target auto-detect
# magic happens after the command line has been parsed.
- case "${tgt_os}" in
- linux|os2|solaris|darwin*|iphonesimulator*)
+ # case "${tgt_os}" in
+ # linux|os2|solaris|darwin*|iphonesimulator*)
# Supported platforms
- ;;
- *)
- if enabled gnu; then
- echo "--enable-shared is only supported on ELF; assuming this is OK"
- else
- die "--enable-shared only supported on ELF, OS/2, and Darwin for now"
- fi
- ;;
- esac
- fi
+ # ;;
+ # *)
+ # if enabled gnu; then
+ # echo "--enable-shared is only supported on ELF; assuming this is OK"
+ # else
+ # die "--enable-shared only supported on ELF, OS/2, and Darwin for now"
+ # fi
+ # ;;
+ # esac
+ #fi
if [ -z "$CC" ] || enabled external_build; then
echo "Bypassing toolchain for environment detection."
enable_feature external_build
diff -ruN libvpx/examples.mk patched/examples.mk
--- libvpx/examples.mk 2019-02-13 16:56:49.162860897 +0100
+++ patched/examples.mk 2019-02-13 16:50:37.995967583 +0100
@@ -315,7 +315,7 @@
ifneq ($(filter os2%,$(TGT_OS)),)
SHARED_LIB_SUF=_dll.a
else
-SHARED_LIB_SUF=.so
+SHARED_LIB_SUF=.dll.a
endif
endif
CODEC_LIB_SUF=$(if $(CONFIG_SHARED),$(SHARED_LIB_SUF),.a)
diff -ruN libvpx/libs.mk patched/libs.mk
--- libvpx/libs.mk 2019-02-13 16:56:48.972857636 +0100
+++ patched/libs.mk 2019-02-13 16:50:37.995967583 +0100
@@ -256,12 +256,12 @@
LIBVPX_SO_SYMLINKS :=
LIBVPX_SO_IMPLIB := libvpx_dll.a
else
-LIBVPX_SO := libvpx.so.$(SO_VERSION_MAJOR).$(SO_VERSION_MINOR).$(SO_VERSION_PATCH)
-SHARED_LIB_SUF := .so
+LIBVPX_SO := libvpx.dll
+SHARED_LIB_SUF := .dll
EXPORT_FILE := libvpx.ver
-LIBVPX_SO_SYMLINKS := $(addprefix $(LIBSUBDIR)/, \
- libvpx.so libvpx.so.$(SO_VERSION_MAJOR) \
- libvpx.so.$(SO_VERSION_MAJOR).$(SO_VERSION_MINOR))
+LIBVPX_SO_SYMLINKS :=
+
+
endif
endif
endif
@@ -271,7 +271,7 @@
$(if $(LIBVPX_SO_IMPLIB), $(BUILD_PFX)$(LIBVPX_SO_IMPLIB))
$(BUILD_PFX)$(LIBVPX_SO): $(LIBVPX_OBJS) $(EXPORT_FILE)
$(BUILD_PFX)$(LIBVPX_SO): extralibs += -lm
-$(BUILD_PFX)$(LIBVPX_SO): SONAME = libvpx.so.$(SO_VERSION_MAJOR)
+$(BUILD_PFX)$(LIBVPX_SO): SONAME = libvpx.dll
$(BUILD_PFX)$(LIBVPX_SO): EXPORTS_FILE = $(EXPORT_FILE)

libvpx.def: $(call enabled,CODEC_EXPORTS)

0 comments on commit 939fd3c

Please sign in to comment.