From 40836730a902f5a4a6adc7d96aab7c88c3356bc1 Mon Sep 17 00:00:00 2001 From: C Van Winkle Date: Thu, 28 Oct 2021 11:39:26 -0500 Subject: [PATCH 1/7] Disable or update certain packages to get it to compile on arm64 --- .node-version | 1 - build-ffmpeg | 144 ++++++++++++++++++++++++++++---------------------- 2 files changed, 81 insertions(+), 64 deletions(-) delete mode 100644 .node-version diff --git a/.node-version b/.node-version deleted file mode 100644 index 9cd25a1f..00000000 --- a/.node-version +++ /dev/null @@ -1 +0,0 @@ -12.18.3 diff --git a/build-ffmpeg b/build-ffmpeg index dce71987..5d106aae 100755 --- a/build-ffmpeg +++ b/build-ffmpeg @@ -351,29 +351,31 @@ if build "x265"; then fi CONFIGURE_OPTIONS+=("--enable-libx265") -if build "libvpx"; then - download "https://github.com/webmproject/libvpx/archive/v1.9.0.tar.gz" "libvpx-1.9.0.tar.gz" - - EXTRA_FLAG="" - - if is_mac; then - echo "Applying Darwin patch" - sed "s/,--version-script//g" build/make/Makefile > build/make/Makefile.patched - sed "s/-Wl,--no-undefined -Wl,-soname/-Wl,-undefined,error -Wl,-install_name/g" build/make/Makefile.patched > build/make/Makefile - EXTRA_FLAG="--target=x86_64-darwin15-gcc" - fi - - - execute ./configure --prefix="${WORKSPACE}" --disable-unit-tests --enable-shared --disable-static --as=yasm "${EXTRA_FLAG}" - execute make -j $MJOBS - - set_mac_install_name "libvpx.6.dylib" - - execute make install - - build_done "libvpx" -fi -CONFIGURE_OPTIONS+=("--enable-libvpx") +# cvanwink: temporarily disable to avoid "libvpx enabled but no supported decoders found" +# +#if build "libvpx"; then +# download "https://github.com/webmproject/libvpx/archive/v1.9.0.tar.gz" "libvpx-1.9.0.tar.gz" +# +# EXTRA_FLAG="" +# +# if is_mac; then +# echo "Applying Darwin patch" +# sed "s/,--version-script//g" build/make/Makefile > build/make/Makefile.patched +# sed "s/-Wl,--no-undefined -Wl,-soname/-Wl,-undefined,error -Wl,-install_name/g" build/make/Makefile.patched > build/make/Makefile +# EXTRA_FLAG="--target=x86_64-darwin15-gcc" +# fi +# +# +# execute ./configure --prefix="${WORKSPACE}" --disable-unit-tests --enable-shared --disable-static --as=yasm "${EXTRA_FLAG}" +# execute make -j $MJOBS +# +# set_mac_install_name "libvpx.6.dylib" +# +# execute make install +# +# build_done "libvpx" +#fi +#CONFIGURE_OPTIONS+=("--enable-libvpx") if build "xvidcore"; then download "https://downloads.xvid.com/downloads/xvidcore-1.3.7.tar.gz" @@ -394,17 +396,22 @@ if build "xvidcore"; then fi CONFIGURE_OPTIONS+=("--enable-libxvid") -if build "vid_stab"; then - download "https://github.com/georgmartius/vid.stab/archive/v1.1.0.tar.gz" "vid.stab-1.1.0.tar.gz" - execute cmake -DBUILD_SHARED_LIBS=on -DCMAKE_INSTALL_PREFIX:PATH="${WORKSPACE}" -DUSE_OMP=OFF -DENABLE_SHARED=on . - execute make - execute make install - - set_mac_install_name "${WORKSPACE}/lib/libvidstab.1.1.dylib" "libvidstab.1.1.dylib" - - build_done "vid_stab" -fi -CONFIGURE_OPTIONS+=("--enable-libvidstab") +# cvanwink: no newer releases, but head revision has fix for arm64 +# +#if build "vid_stab"; then +# download "https://github.com/georgmartius/vid.stab/archive/v1.1.0.tar.gz" "vid.stab-1.1.0.tar.gz" +# echo "sleeping!\n" +# sleep 10 +# echo "awake\n" +# execute cmake -DBUILD_SHARED_LIBS=on -DCMAKE_INSTALL_PREFIX:PATH="${WORKSPACE}" -DUSE_OMP=OFF -DENABLE_SHARED=on . +# execute make +# execute make install +# +# set_mac_install_name "${WORKSPACE}/lib/libvidstab.1.1.dylib" "libvidstab.1.1.dylib" +# +# build_done "vid_stab" +#fi +#CONFIGURE_OPTIONS+=("--enable-libvidstab") if build "twolame"; then download "https://downloads.sourceforge.net/twolame/twolame-0.4.0.tar.gz" @@ -418,13 +425,13 @@ CONFIGURE_OPTIONS+=("--enable-libtwolame") if build "av1"; then - download "https://aomedia.googlesource.com/aom/+archive/430d58446e1f71ec2283af0d6c1879bc7a3553dd.tar.gz" "av1.tar.gz" "av1" + download "https://aomedia.googlesource.com/aom/+archive/287164de79516c25c8c84fd544f67752c170082a.tar.gz" "av1.tar.gz" "av1" make_dir "$PACKAGES"/aom_build cd "$PACKAGES"/aom_build || exit execute cmake -DBUILD_SHARED_LIBS=1 -DENABLE_TESTS=0 -DCMAKE_INSTALL_PREFIX="${WORKSPACE}" -DCMAKE_INSTALL_LIBDIR=lib "$PACKAGES"/av1 execute make -j $MJOBS - set_mac_install_name "libaom.2.0.0.dylib" "libaom.2.dylib" + set_mac_install_name "libaom.3.2.0.dylib" "libaom.3.dylib" execute make install @@ -432,18 +439,23 @@ if build "av1"; then fi CONFIGURE_OPTIONS+=("--enable-libaom") -if build "dav1d"; then - download "https://code.videolan.org/videolan/dav1d/-/archive/0.7.1/dav1d-0.7.1.tar.gz" - make_dir "$PACKAGES"/dav1d_build - cd "$PACKAGES"/dav1d_build || exit - execute meson --prefix="${WORKSPACE}" ../dav1d-0.7.1 - execute ninja - execute ninja install - - build_done "dav1d" -fi -CONFIGURE_OPTIONS+=("--enable-libdav1d") - +# cvanwink: arm64 asm doesn't assemble +# +#if build "dav1d"; then +# download "https://code.videolan.org/videolan/dav1d/-/archive/0.9.2/dav1d-0.9.2.tar.gz" +# make_dir "$PACKAGES"/dav1d_build +# cd "$PACKAGES"/dav1d_build || exit +# execute meson --prefix="${WORKSPACE}" --buildtype=release --wrap-mode=nofallback ../dav1d-0.9.2 > "$PACKAGES"/dav1d_build/meson.log +# execute ninja > "$PACKAGES"/dav1d_build/ninja.log +# execute ninja install +# +# build_done "dav1d" +#fi +#CONFIGURE_OPTIONS+=("--enable-libdav1d") + +# cvanwink: requires ```brew install automake``` for autoreconf +# requires ```brew install libtool``` for autoreconf +# if build "zimg"; then download "https://github.com/sekrit-twc/zimg/archive/release-3.0.1.tar.gz" execute autoreconf -i @@ -501,7 +513,9 @@ fi if build "libvorbis"; then download "https://ftp.osuosl.org/pub/xiph/releases/vorbis/libvorbis-1.3.6.tar.gz" - OGG_CFLAGS="-I${WORKSPACE}/include/ogg" OGG_LIBS="-L${WORKSPACE}/lib -logg" execute ./configure --prefix="${WORKSPACE}" --with-ogg-libraries="${WORKSPACE}"/lib --with-ogg-includes="${WORKSPACE}"/include/ --disable-static --enable-shared --disable-oggtest + #cvanwink: the environment variables are covered with the configure arguments and otherwise cause issues + #OGG_CFLAGS="-I${WORKSPACE}/include/ogg" OGG_LIBS="-L${WORKSPACE}/lib -logg" execute ./configure --prefix="${WORKSPACE}" --with-ogg-libraries="${WORKSPACE}"/lib --with-ogg-includes="${WORKSPACE}"/include/ --disable-static --enable-shared --disable-oggtest + execute ./configure --prefix="${WORKSPACE}" --with-ogg-libraries="${WORKSPACE}"/lib --with-ogg-includes="${WORKSPACE}"/include/ --disable-static --enable-shared --disable-oggtest execute make -j $MJOBS execute make install @@ -514,7 +528,9 @@ if build "libtheora"; then sed "s/-fforce-addr//g" configure > configure.patched chmod +x configure.patched mv configure.patched configure - OGG_CFLAGS="-I${WORKSPACE}/include/ogg" OGG_LIBS="-L${WORKSPACE}/lib -logg" execute ./configure --prefix="${WORKSPACE}" --with-ogg-libraries="${WORKSPACE}"/lib --with-ogg-includes="${WORKSPACE}"/include/ --with-vorbis-libraries="${WORKSPACE}"/lib --with-vorbis-includes="${WORKSPACE}"/include/ --disable-static --enable-shared --disable-oggtest --disable-vorbistest --disable-examples --disable-asm --disable-spec + #cvanwink: the environment variables are covered with the configure arguments and otherwise cause issues + #OGG_CFLAGS="-I${WORKSPACE}/include/ogg" OGG_LIBS="-L${WORKSPACE}/lib -logg" execute ./configure --prefix="${WORKSPACE}" --with-ogg-libraries="${WORKSPACE}"/lib --with-ogg-includes="${WORKSPACE}"/include/ --with-vorbis-libraries="${WORKSPACE}"/lib --with-vorbis-includes="${WORKSPACE}"/include/ --disable-static --enable-shared --disable-oggtest --disable-vorbistest --disable-examples --disable-asm --disable-spec + execute ./configure --prefix="${WORKSPACE}" --with-ogg-libraries="${WORKSPACE}"/lib --with-ogg-includes="${WORKSPACE}"/include/ --with-vorbis-libraries="${WORKSPACE}"/lib --with-vorbis-includes="${WORKSPACE}"/include/ --disable-static --enable-shared --disable-oggtest --disable-vorbistest --disable-examples --disable-asm --disable-spec execute make -j $MJOBS execute make install @@ -533,17 +549,19 @@ if build "shine"; then fi CONFIGURE_OPTIONS+=("--enable-libshine") -if build "soxr"; then - download "http://ftp.debian.org/debian/pool/main/libs/libsoxr/libsoxr_0.1.3.orig.tar.xz" "soxr-0.1.3.tar.xz" - make_dir build - cd build || exit - execute cmake .. -DWITH_OPENMP:BOOL=OFF -Wno-dev -DCMAKE_INSTALL_PREFIX="${WORKSPACE}" -DCMAKE_BUILD_TYPE=Release -DBUILD_SHARED_LIBS:BOOL=ON - execute make -j $MJOBS - execute make install - - build_done "soxr" -fi -CONFIGURE_OPTIONS+=("--enable-libsoxr") +# cvanwink: SIMD doesn't compile +# +#if build "soxr"; then +# download "http://ftp.debian.org/debian/pool/main/libs/libsoxr/libsoxr_0.1.3.orig.tar.xz" "soxr-0.1.3.tar.xz" +# make_dir build +# cd build || exit +# execute cmake .. --log-level=VERBOSE -DWITH_OPENMP:BOOL=OFF -Wno-dev -DCMAKE_INSTALL_PREFIX="${WORKSPACE}" -DCMAKE_BUILD_TYPE=Release -DBUILD_SHARED_LIBS:BOOL=ON > "$PACKAGES"/soxr.cmake.log +# execute make -j $MJOBS > "$PACKAGES"/soxr.make.log +# execute make install +# +# build_done "soxr" +#fi +#CONFIGURE_OPTIONS+=("--enable-libsoxr") if build "speex"; then download "http://downloads.us.xiph.org/releases/speex/speex-1.2.0.tar.gz" @@ -589,7 +607,7 @@ CONFIGURE_OPTIONS+=("--enable-libopenjpeg") ## if build "libsdl"; then - download "https://www.libsdl.org/release/SDL2-2.0.12.tar.gz" + download "https://www.libsdl.org/release/SDL2-2.0.16.tar.gz" execute ./configure --prefix="${WORKSPACE}" --enable-shared --disable-static execute make -j $MJOBS execute make install @@ -663,7 +681,7 @@ fi ## build "ffmpeg" -download "https://ffmpeg.org/releases/ffmpeg-4.3.1.tar.bz2" +download "https://ffmpeg.org/releases/ffmpeg-4.4.1.tar.bz2" # shellcheck disable=SC2086 ./configure "${CONFIGURE_OPTIONS[@]}" \ --disable-debug \ From f999008afbee86e52820be671ba2e24bde5ede4e Mon Sep 17 00:00:00 2001 From: C Van Winkle Date: Fri, 29 Oct 2021 12:17:35 -0500 Subject: [PATCH 2/7] Name the final .zip arm64 vs x86_64 --- build-ffmpeg | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/build-ffmpeg b/build-ffmpeg index 5d106aae..cfa5db33 100755 --- a/build-ffmpeg +++ b/build-ffmpeg @@ -749,7 +749,14 @@ cd $CWD if is_mac; then node copy_mac_libs.js cd "$WORKSPACE/mac" - execute zip --symlinks -r "ffmpeg-ffprobe-shared-darwin-x86_64.${VERSION}.zip" * + + ARCH="" + case $(uname -m) in + x86_64) ARCH="x86_64" ;; + arm64) ARCH="arm64" ;; + esac + + execute zip --symlinks -r "ffmpeg-ffprobe-shared-darwin-${ARCH}.${VERSION}.zip" * fi exit 0 From 261bc23c9852377c9960dff60934e0a829dbef8c Mon Sep 17 00:00:00 2001 From: C Van Winkle Date: Fri, 29 Oct 2021 12:20:33 -0500 Subject: [PATCH 3/7] ignore if the `mac` folder doesn't exist (which it won't when running the first time) --- copy_mac_libs.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/copy_mac_libs.js b/copy_mac_libs.js index 2edd9c93..a0a6673c 100644 --- a/copy_mac_libs.js +++ b/copy_mac_libs.js @@ -13,7 +13,7 @@ const baseLibDir = resolve(__dirname, 'workspace/lib'); const destDir = resolve(__dirname, 'workspace/mac'); try { - logAndExec(`rm -r ${destDir}`); + logAndExec(`rm -r -f ${destDir}`); } catch (err) { // } From 1cd05ea1b541fbdcd8d20667778ec3afd4d35c5b Mon Sep 17 00:00:00 2001 From: C Van Winkle Date: Fri, 29 Oct 2021 12:27:34 -0500 Subject: [PATCH 4/7] bump version --- build-ffmpeg | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build-ffmpeg b/build-ffmpeg index cfa5db33..c8482f34 100755 --- a/build-ffmpeg +++ b/build-ffmpeg @@ -4,7 +4,7 @@ # LICENSE: https://github.com/markus-perl/ffmpeg-build-script/blob/master/LICENSE PROGNAME=$(basename "$0") -VERSION=1.21.rc5 +VERSION=1.21.rc6 CWD=$(pwd) PACKAGES="$CWD/packages" WORKSPACE="$CWD/workspace" From c736c3b002e72ed9a8318a6ef96d3de710b9df59 Mon Sep 17 00:00:00 2001 From: C Van Winkle Date: Fri, 29 Oct 2021 12:35:12 -0500 Subject: [PATCH 5/7] document that we don't need vid-stab --- config-target.txt | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/config-target.txt b/config-target.txt index 12edcbef..54a0f6e3 100644 --- a/config-target.txt +++ b/config-target.txt @@ -1,3 +1,5 @@ +./build-ffmpeg -c && SKIPINSTALL=yes ./build-ffmpeg -b > ./build-ffmpeg.log + ❌ don't need ✅ already in ffmpeg-build-script build 🕒 need to add to ffmpeg-build-script @@ -30,7 +32,7 @@ Target (evermeet.cx static build) 🕒✅ --enable-libspeex - speex audio file format ✅ --enable-libtheora 🕒✅ --enable-libtwolame - mpeg2 -✅ --enable-libvidstab +❌ --enable-libvidstab - video stabilization ❌ --enable-libvmaf - perceptual video quality metric ❌ --enable-libvo-amrwbenc - VisualOn AMR-WB encoder library ✅ --enable-libvorbis From 4f1b5db74edba4d1cfcd7ec3a2dd184df0529744 Mon Sep 17 00:00:00 2001 From: C Van Winkle Date: Fri, 29 Oct 2021 14:52:37 -0500 Subject: [PATCH 6/7] update libraries to latest --- build-ffmpeg | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/build-ffmpeg b/build-ffmpeg index c8482f34..a2a82665 100755 --- a/build-ffmpeg +++ b/build-ffmpeg @@ -304,7 +304,7 @@ if build "meson"; then fi if build "cmake"; then - download "https://cmake.org/files/v3.18/cmake-3.18.4.tar.gz" + download "https://cmake.org/files/v3.21/cmake-3.21.4.tar.gz" execute ./configure --prefix="${WORKSPACE}" --system-zlib execute make -j $MJOBS execute make install @@ -354,7 +354,7 @@ CONFIGURE_OPTIONS+=("--enable-libx265") # cvanwink: temporarily disable to avoid "libvpx enabled but no supported decoders found" # #if build "libvpx"; then -# download "https://github.com/webmproject/libvpx/archive/v1.9.0.tar.gz" "libvpx-1.9.0.tar.gz" +# download "https://github.com/webmproject/libvpx/archive/v1.11.0.tar.gz" "libvpx-1.11.0.tar.gz" # # EXTRA_FLAG="" # @@ -369,7 +369,7 @@ CONFIGURE_OPTIONS+=("--enable-libx265") # execute ./configure --prefix="${WORKSPACE}" --disable-unit-tests --enable-shared --disable-static --as=yasm "${EXTRA_FLAG}" # execute make -j $MJOBS # -# set_mac_install_name "libvpx.6.dylib" +# set_mac_install_name "libvpx.11.dylib" # # execute make install # @@ -457,7 +457,7 @@ CONFIGURE_OPTIONS+=("--enable-libaom") # requires ```brew install libtool``` for autoreconf # if build "zimg"; then - download "https://github.com/sekrit-twc/zimg/archive/release-3.0.1.tar.gz" + download "https://github.com/sekrit-twc/zimg/archive/release-3.0.3.tar.gz" execute autoreconf -i execute ./configure --prefix="${WORKSPACE}" --enable-shared --disable-static execute make -j $MJOBS @@ -504,7 +504,7 @@ fi CONFIGURE_OPTIONS+=("--enable-libopus") if build "libogg"; then - download "https://ftp.osuosl.org/pub/xiph/releases/ogg/libogg-1.3.3.tar.gz" + download "https://ftp.osuosl.org/pub/xiph/releases/ogg/libogg-1.3.5.tar.gz" execute ./configure --prefix="${WORKSPACE}" --enable-shared --disable-static execute make -j $MJOBS execute make install @@ -512,7 +512,7 @@ if build "libogg"; then fi if build "libvorbis"; then - download "https://ftp.osuosl.org/pub/xiph/releases/vorbis/libvorbis-1.3.6.tar.gz" + download "https://ftp.osuosl.org/pub/xiph/releases/vorbis/libvorbis-1.3.7.tar.gz" #cvanwink: the environment variables are covered with the configure arguments and otherwise cause issues #OGG_CFLAGS="-I${WORKSPACE}/include/ogg" OGG_LIBS="-L${WORKSPACE}/lib -logg" execute ./configure --prefix="${WORKSPACE}" --with-ogg-libraries="${WORKSPACE}"/lib --with-ogg-includes="${WORKSPACE}"/include/ --disable-static --enable-shared --disable-oggtest execute ./configure --prefix="${WORKSPACE}" --with-ogg-libraries="${WORKSPACE}"/lib --with-ogg-includes="${WORKSPACE}"/include/ --disable-static --enable-shared --disable-oggtest @@ -578,7 +578,7 @@ CONFIGURE_OPTIONS+=("--enable-libspeex") ## if build "libwebp"; then - download "https://github.com/webmproject/libwebp/archive/v1.1.0.tar.gz" "libwebp-1.1.0.tar.gz" + download "https://github.com/webmproject/libwebp/archive/v1.2.1.tar.gz" "libwebp-1.2.1.tar.gz" make_dir build cd build || exit execute cmake -DCMAKE_INSTALL_PREFIX="${WORKSPACE}" -DCMAKE_INSTALL_LIBDIR=lib -DCMAKE_INSTALL_BINDIR=bin -DCMAKE_INSTALL_INCLUDEDIR=include -DENABLE_SHARED=ON -DENABLE_STATIC=OFF ../ @@ -590,7 +590,7 @@ fi CONFIGURE_OPTIONS+=("--enable-libwebp") if build "openjpeg"; then - download "https://github.com/uclouvain/openjpeg/archive/v2.3.1.tar.gz" "openjpeg-v2.3.1.tar.gz" + download "https://github.com/uclouvain/openjpeg/archive/v2.4.0.tar.gz" "openjpeg-v2.4.0.tar.gz" make_dir build cd build || exit execute cmake .. -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX="${WORKSPACE}" -DBUILD_SHARED_LIBS:bool=on @@ -616,13 +616,13 @@ if build "libsdl"; then fi if build "snappy"; then - download "https://github.com/google/snappy/archive/1.1.8.tar.gz" + download "https://github.com/google/snappy/archive/1.1.9.tar.gz" make_dir build cd build || exit - execute cmake .. -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX="${WORKSPACE}" -DBUILD_SHARED_LIBS:bool=on + execute cmake .. -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX="${WORKSPACE}" -DBUILD_SHARED_LIBS:bool=on -DSNAPPY_BUILD_TESTS=OFF -DSNAPPY_BUILD_BENCHMARKS=OFF execute make -j $MJOBS - set_mac_install_name "libsnappy.1.1.8.dylib" "libsnappy.1.dylib" + set_mac_install_name "libsnappy.1.1.9.dylib" "libsnappy.1.dylib" execute make install From 3052da9057593be553d59de90f538db0308a3ca0 Mon Sep 17 00:00:00 2001 From: C Van Winkle Date: Fri, 29 Oct 2021 15:32:13 -0500 Subject: [PATCH 7/7] conditional compile instead of commenting out code --- build-ffmpeg | 149 +++++++++++++++++++++++++++------------------------ 1 file changed, 78 insertions(+), 71 deletions(-) diff --git a/build-ffmpeg b/build-ffmpeg index a2a82665..3fd9a141 100755 --- a/build-ffmpeg +++ b/build-ffmpeg @@ -22,6 +22,14 @@ is_mac () { return 1 } +function get_mac_architecture { + if is_mac; then + echo $(uname -m) + else + echo "not_mac_os" + fi +} + # read by gcc and cmake # https://cmake.org/cmake/help/latest/variable/CMAKE_OSX_DEPLOYMENT_TARGET.html export MACOSX_DEPLOYMENT_TARGET=10.11 @@ -352,30 +360,32 @@ fi CONFIGURE_OPTIONS+=("--enable-libx265") # cvanwink: temporarily disable to avoid "libvpx enabled but no supported decoders found" -# -#if build "libvpx"; then -# download "https://github.com/webmproject/libvpx/archive/v1.11.0.tar.gz" "libvpx-1.11.0.tar.gz" -# -# EXTRA_FLAG="" -# -# if is_mac; then -# echo "Applying Darwin patch" -# sed "s/,--version-script//g" build/make/Makefile > build/make/Makefile.patched -# sed "s/-Wl,--no-undefined -Wl,-soname/-Wl,-undefined,error -Wl,-install_name/g" build/make/Makefile.patched > build/make/Makefile -# EXTRA_FLAG="--target=x86_64-darwin15-gcc" -# fi -# -# -# execute ./configure --prefix="${WORKSPACE}" --disable-unit-tests --enable-shared --disable-static --as=yasm "${EXTRA_FLAG}" -# execute make -j $MJOBS -# -# set_mac_install_name "libvpx.11.dylib" -# -# execute make install -# -# build_done "libvpx" -#fi -#CONFIGURE_OPTIONS+=("--enable-libvpx") +# ED-2726 +if [ "$(get_mac_architecture)" == "x86_64" ]; then + if build "libvpx"; then + download "https://github.com/webmproject/libvpx/archive/v1.11.0.tar.gz" "libvpx-1.11.0.tar.gz" + + EXTRA_FLAG="" + + if is_mac; then + echo "Applying Darwin patch" + sed "s/,--version-script//g" build/make/Makefile > build/make/Makefile.patched + sed "s/-Wl,--no-undefined -Wl,-soname/-Wl,-undefined,error -Wl,-install_name/g" build/make/Makefile.patched > build/make/Makefile + EXTRA_FLAG="--target=x86_64-darwin15-gcc" + fi + + + execute ./configure --prefix="${WORKSPACE}" --disable-unit-tests --enable-shared --disable-static --as=yasm "${EXTRA_FLAG}" + execute make -j $MJOBS + + set_mac_install_name "libvpx.11.dylib" + + execute make install + + build_done "libvpx" + fi + CONFIGURE_OPTIONS+=("--enable-libvpx") +fi if build "xvidcore"; then download "https://downloads.xvid.com/downloads/xvidcore-1.3.7.tar.gz" @@ -397,21 +407,20 @@ fi CONFIGURE_OPTIONS+=("--enable-libxvid") # cvanwink: no newer releases, but head revision has fix for arm64 -# -#if build "vid_stab"; then -# download "https://github.com/georgmartius/vid.stab/archive/v1.1.0.tar.gz" "vid.stab-1.1.0.tar.gz" -# echo "sleeping!\n" -# sleep 10 -# echo "awake\n" -# execute cmake -DBUILD_SHARED_LIBS=on -DCMAKE_INSTALL_PREFIX:PATH="${WORKSPACE}" -DUSE_OMP=OFF -DENABLE_SHARED=on . -# execute make -# execute make install -# -# set_mac_install_name "${WORKSPACE}/lib/libvidstab.1.1.dylib" "libvidstab.1.1.dylib" -# -# build_done "vid_stab" -#fi -#CONFIGURE_OPTIONS+=("--enable-libvidstab") +# ED-2727 +if [ "$(get_mac_architecture)" == "x86_64" ]; then + if build "vid_stab"; then + download "https://github.com/georgmartius/vid.stab/archive/v1.1.0.tar.gz" "vid.stab-1.1.0.tar.gz" + execute cmake -DBUILD_SHARED_LIBS=on -DCMAKE_INSTALL_PREFIX:PATH="${WORKSPACE}" -DUSE_OMP=OFF -DENABLE_SHARED=on . + execute make + execute make install + + set_mac_install_name "${WORKSPACE}/lib/libvidstab.1.1.dylib" "libvidstab.1.1.dylib" + + build_done "vid_stab" + fi + CONFIGURE_OPTIONS+=("--enable-libvidstab") +fi if build "twolame"; then download "https://downloads.sourceforge.net/twolame/twolame-0.4.0.tar.gz" @@ -440,18 +449,20 @@ fi CONFIGURE_OPTIONS+=("--enable-libaom") # cvanwink: arm64 asm doesn't assemble -# -#if build "dav1d"; then -# download "https://code.videolan.org/videolan/dav1d/-/archive/0.9.2/dav1d-0.9.2.tar.gz" -# make_dir "$PACKAGES"/dav1d_build -# cd "$PACKAGES"/dav1d_build || exit -# execute meson --prefix="${WORKSPACE}" --buildtype=release --wrap-mode=nofallback ../dav1d-0.9.2 > "$PACKAGES"/dav1d_build/meson.log -# execute ninja > "$PACKAGES"/dav1d_build/ninja.log -# execute ninja install -# -# build_done "dav1d" -#fi -#CONFIGURE_OPTIONS+=("--enable-libdav1d") +# ED-2724 +if [ "$(get_mac_architecture)" == "x86_64" ]; then + if build "dav1d"; then + download "https://code.videolan.org/videolan/dav1d/-/archive/0.9.2/dav1d-0.9.2.tar.gz" + make_dir "$PACKAGES"/dav1d_build + cd "$PACKAGES"/dav1d_build || exit + execute meson --prefix="${WORKSPACE}" --buildtype=release --wrap-mode=nofallback ../dav1d-0.9.2 + execute ninja + execute ninja install + + build_done "dav1d" + fi + CONFIGURE_OPTIONS+=("--enable-libdav1d") +fi # cvanwink: requires ```brew install automake``` for autoreconf # requires ```brew install libtool``` for autoreconf @@ -550,18 +561,20 @@ fi CONFIGURE_OPTIONS+=("--enable-libshine") # cvanwink: SIMD doesn't compile -# -#if build "soxr"; then -# download "http://ftp.debian.org/debian/pool/main/libs/libsoxr/libsoxr_0.1.3.orig.tar.xz" "soxr-0.1.3.tar.xz" -# make_dir build -# cd build || exit -# execute cmake .. --log-level=VERBOSE -DWITH_OPENMP:BOOL=OFF -Wno-dev -DCMAKE_INSTALL_PREFIX="${WORKSPACE}" -DCMAKE_BUILD_TYPE=Release -DBUILD_SHARED_LIBS:BOOL=ON > "$PACKAGES"/soxr.cmake.log -# execute make -j $MJOBS > "$PACKAGES"/soxr.make.log -# execute make install -# -# build_done "soxr" -#fi -#CONFIGURE_OPTIONS+=("--enable-libsoxr") +# ED-2725 +if [ "$(get_mac_architecture)" == "x86_64" ]; then + if build "soxr"; then + download "http://ftp.debian.org/debian/pool/main/libs/libsoxr/libsoxr_0.1.3.orig.tar.xz" "soxr-0.1.3.tar.xz" + make_dir build + cd build || exit + execute cmake .. --log-level=VERBOSE -DWITH_OPENMP:BOOL=OFF -Wno-dev -DCMAKE_INSTALL_PREFIX="${WORKSPACE}" -DCMAKE_BUILD_TYPE=Release -DBUILD_SHARED_LIBS:BOOL=ON + execute make -j $MJOBS + execute make install + + build_done "soxr" + fi + CONFIGURE_OPTIONS+=("--enable-libsoxr") +fi if build "speex"; then download "http://downloads.us.xiph.org/releases/speex/speex-1.2.0.tar.gz" @@ -749,14 +762,8 @@ cd $CWD if is_mac; then node copy_mac_libs.js cd "$WORKSPACE/mac" - - ARCH="" - case $(uname -m) in - x86_64) ARCH="x86_64" ;; - arm64) ARCH="arm64" ;; - esac - - execute zip --symlinks -r "ffmpeg-ffprobe-shared-darwin-${ARCH}.${VERSION}.zip" * + + execute zip --symlinks -r "ffmpeg-ffprobe-shared-darwin-$(get_mac_architecture).${VERSION}.zip" * fi exit 0