diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index c959a45..9621d44 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -20,7 +20,7 @@ jobs: alpine-aarch64, alpine-arm32v7, alpine-x86_64, - darwin-arm64, +# darwin-arm64, darwin-x86_64, windows-x86_64 ] @@ -55,8 +55,8 @@ jobs: TARGET_OS: alpine # Build for Apple Silicon macOS environments. - - name: darwin-arm64 - os: macos-13-large +# - name: darwin-arm64 +# os: macos-13-large # Build for Intel macOS environments. - name: darwin-x86_64 diff --git a/README.md b/README.md index 658a7a2..ce397fa 100644 --- a/README.md +++ b/README.md @@ -25,7 +25,7 @@ Specifically, we provide: |-------------------------------------|--------------------------------| | FreeBSD | x86_64 | | Linux | x86_64, armv7l, aarch64 | -| macOS (10.14 (Mojave) or newer) | x86_64, arm64 (Apple Silicon) | +| macOS 13.0 (Ventura) or newer | x86_64, arm64 (Apple Silicon) | | Raspberry Pi 3 or better (Raspbian) | armv7l, aarch64 | | Windows 10 or newer | x86_64 | diff --git a/build-ffmpeg b/build-ffmpeg index a46a7b9..9b97468 100755 --- a/build-ffmpeg +++ b/build-ffmpeg @@ -508,7 +508,7 @@ fi if build "giflib" "5.2.1"; then - download "https://netcologne.dl.sourceforge.net/project/giflib/giflib-5.2.1.tar.gz" + download "https://downloads.sourceforge.net/project/giflib/giflib-5.2.1.tar.gz" if [[ "${TARGET_OS}" == "darwin" ]]; then @@ -870,7 +870,7 @@ EOF if [ -n "${LDEXEFLAGS}" ]; then - sed -i.backup 's/-lgcc_s/-lgcc_eh/g' "${WORKSPACE}/lib/pkgconfig/x265.pc" # The -i.backup is intended and required on MacOS: https://stackoverflow.com/questions/5694228/sed-in-place-flag-that-works-both-on-mac-bsd-and-linux + sed -i.backup 's/-lgcc_s/-lgcc_eh/g' "${WORKSPACE}/lib/pkgconfig/x265.pc" # The -i.backup is intended and required on macOS: https://stackoverflow.com/questions/5694228/sed-in-place-flag-that-works-both-on-mac-bsd-and-linux fi build_done "x265" "latest" @@ -887,8 +887,8 @@ if build "libvpx" "1.13.0"; then if [[ "${TARGET_OS}" == "darwin" ]]; 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 + 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 fi execute ./configure --prefix="${WORKSPACE}" --disable-unit-tests --disable-shared --disable-examples --as=yasm --enable-vp9-highbitdepth @@ -1036,7 +1036,7 @@ if command_exists "python3"; then if build "pcre" "8.45"; then - download "https://altushost-swe.dl.sourceforge.net/project/pcre/pcre/8.45/pcre-8.45.tar.gz" "pcre-8.45.tar.gz" + download "https://downloads.sourceforge.net/project/pcre/pcre/8.45/pcre-8.45.tar.gz" "pcre-8.45.tar.gz" execute ./configure --prefix="${WORKSPACE}" --disable-shared --enable-static execute make -j ${MJOBS} @@ -1089,7 +1089,7 @@ if ! isLinux; then if build "opencore" "0.1.6"; then - download "https://netactuate.dl.sourceforge.net/project/opencore-amr/opencore-amr/opencore-amr-0.1.6.tar.gz" "opencore-amr-0.1.6.tar.gz" + download "https://downloads.sourceforge.net/project/opencore-amr/opencore-amr/opencore-amr-0.1.6.tar.gz" "opencore-amr-0.1.6.tar.gz" execute ./configure --prefix="${WORKSPACE}" --disable-shared --enable-static execute make -j ${MJOBS} @@ -1105,7 +1105,7 @@ if ! isLinux; then if build "lame" "3.100"; then - download "https://sourceforge.net/projects/lame/files/lame/3.100/lame-3.100.tar.gz/download?use_mirror=gigenet" "lame-3.100.tar.gz" + download "https://downloads.sourceforge.net/project/lame/lame/3.100/lame-3.100.tar.gz" "lame-3.100.tar.gz" execute ./configure --prefix="${WORKSPACE}" --disable-shared --enable-static execute make -j ${MJOBS} @@ -1147,6 +1147,11 @@ if ! isLinux; then download "https://ftp.osuosl.org/pub/xiph/releases/vorbis/libvorbis-1.3.7.tar.gz" + if [[ "${TARGET_OS}" == "darwin" ]]; then + + sed -i.backup 's/-force_cpusubtype_ALL //g' configure # The -i.backup is intended and required on macOS: https://stackoverflow.com/questions/5694228/sed-in-place-flag-that-works-both-on-mac-bsd-and-linux + fi + execute ./configure --prefix="${WORKSPACE}" --with-ogg-libraries="${WORKSPACE}"/lib --with-ogg-includes="${WORKSPACE}"/include/ --enable-static --disable-shared --disable-oggtest execute make -j ${MJOBS} execute make install @@ -1163,7 +1168,7 @@ if ! isLinux; then download "https://ftp.osuosl.org/pub/xiph/releases/theora/libtheora-1.1.1.tar.gz" - sed "s/-fforce-addr//g" configure >configure.patched + sed "s/-fforce-addr//g" configure > configure.patched chmod +x configure.patched mv configure.patched configure @@ -1201,7 +1206,7 @@ if ${NONFREE_AND_GPL}; then if build "fdk_aac" "2.0.2"; then - download "https://sourceforge.net/projects/opencore-amr/files/fdk-aac/fdk-aac-2.0.2.tar.gz/download?use_mirror=gigenet" "fdk-aac-2.0.2.tar.gz" + download "https://downloads.sourceforge.net/project/opencore-amr/fdk-aac/fdk-aac-2.0.2.tar.gz" "fdk-aac-2.0.2.tar.gz" execute ./configure --prefix="${WORKSPACE}" --disable-shared --enable-static --enable-pic execute make -j ${MJOBS} @@ -1235,7 +1240,7 @@ if ! isLinux; then if build "libpng" "1.6.39"; then - download "https://gigenet.dl.sourceforge.net/project/libpng/libpng16/1.6.39/libpng-1.6.39.tar.gz" "libpng-1.6.39.tar.gz" + download "https://downloads.sourceforge.net/project/libpng/libpng16/1.6.39/libpng-1.6.39.tar.gz" "libpng-1.6.39.tar.gz" export LDFLAGS="${LDFLAGS}" export CPPFLAGS="${CFLAGS}" @@ -1307,7 +1312,7 @@ if ${NONFREE_AND_GPL}; then if [ -n "${LDEXEFLAGS}" ]; then - sed -i.backup 's/-lgcc_s/-lgcc_eh/g' "${WORKSPACE}"/lib/pkgconfig/srt.pc # The -i.backup is intended and required on MacOS: https://stackoverflow.com/questions/5694228/sed-in-place-flag-that-works-both-on-mac-bsd-and-linux + sed -i.backup 's/-lgcc_s/-lgcc_eh/g' "${WORKSPACE}"/lib/pkgconfig/srt.pc # The -i.backup is intended and required on macOS: https://stackoverflow.com/questions/5694228/sed-in-place-flag-that-works-both-on-mac-bsd-and-linux fi build_done "srt" "1.5.1" diff --git a/build-macOS.sh b/build-macOS.sh index c791320..209a213 100755 --- a/build-macOS.sh +++ b/build-macOS.sh @@ -1,26 +1,24 @@ -#!/bin/sh - +#!/bin/zsh set -e -WORKDIR=$(pwd) -BUILD_TARGET=/Users/Shared/ffmpeg-for-homebridge +# Get the operating system and architecture to create the target in system-arch form. +TARGET="$(uname -s | awk '{print tolower($0)}')-$(uname -m)" -if [ ! -f "$WORKDIR/build-ffmpeg" ]; then - echo "Execute this script from inside the ffmpeg-for-homebridge project directory." - exit 1 -fi +# Create our workspace. +rm -rf "${TARGET}" +mkdir -p "${TARGET}" +cd ${TARGET} -mkdir -p $BUILD_TARGET -cd $BUILD_TARGET +# Build FFmpeg. +SKIPINSTALL=yes VERBOSE=yes ../build-ffmpeg --build --enable-gpl-and-non-free -export SKIPINSTALL=yes +# Package FFmpeg. +echo "Packaging FFmpeg." +mkdir -p package/usr/local/bin/ -$WORKDIR/build-ffmpeg --build --enable-gpl-and-non-free +# Emulate the filesystem hierarchy so it's easily discoverable in a user's path environment variable. +cp workspace/bin/ffmpeg package/usr/local/bin/ffmpeg -rm -rf $BUILD_TARGET/upload -mkdir -p $BUILD_TARGET/upload/usr/bin/local -cp $BUILD_TARGET/workspace/bin/ffmpeg upload/usr/bin/local/ -tar -C $BUILD_TARGET/upload -zcvf ffmpeg-darwin-$(uname -m).tar.gz . -cp ffmpeg-darwin-$(uname -m).tar.gz $WORKDIR/ +# Now we package it all up. +tar -C package -zcvf ffmpeg-${TARGET}.tar.gz . -echo "File to upload at $WORKDIR/ffmpeg-darwin-$(uname -m).tar.gz" \ No newline at end of file diff --git a/install.js b/install.js index 73372e5..915bb00 100755 --- a/install.js +++ b/install.js @@ -38,7 +38,7 @@ async function getDownloadFileName() { case "darwin": - if (parseInt(os.release()) >= 18) { + if (parseInt(os.release()) >= 22) { switch (process.arch) { @@ -191,9 +191,9 @@ async function install() { if (!ffmpegDownloadFileName) { - if (os.platform() === "darwin" && parseInt(os.release()) < 18) { + if (os.platform() === "darwin" && parseInt(os.release()) < 22) { - console.log("ffmpeg-for-homebridge: macOS versions older than 10.14 (Mojave) are not supported, you will need to install a working version of FFmpeg manually."); + console.log("ffmpeg-for-homebridge: macOS versions older than 13 (Ventura) are not supported, you will need to install a working version of FFmpeg manually."); } else { console.log("ffmpeg-for-homebridge: %s %s is not supported, you will need to install a working version of FFmpeg manually.", os.platform, process.arch); diff --git a/package-lock.json b/package-lock.json index 2bc0c7c..7f2e26e 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "ffmpeg-for-homebridge", - "version": "2.0.0-beta1", + "version": "2.1.1", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "ffmpeg-for-homebridge", - "version": "2.0.0-beta1", + "version": "2.1.1", "hasInstallScript": true, "dependencies": { "dotenv": "^16.3.1", diff --git a/package.json b/package.json index a98aafd..b62b5dc 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "ffmpeg-for-homebridge", - "version": "2.1.0", + "version": "2.1.1", "description": "Static FFmpeg binaries for Homebridge with support for audio (libfdk-aac) and hardware encoding (h264_v4l2m2m and h264_qsv).", "author": { "name": "The Homebridge Team",