From 2e6c6be23616eebfe6de7fa5220147a8d744ad94 Mon Sep 17 00:00:00 2001 From: Callum Moffat Date: Fri, 15 Sep 2023 17:27:42 -0400 Subject: [PATCH 01/14] encodersgpl flavor - Add fftools-ffi - Replace libressl with mbedtls (licensing) - Fix and enable assembly optimizations --- LICENSE.txt | 19 ++ Makefile | 308 ++++++++++++++++++++++- README.md | 80 ++++-- downloads.lock | 28 ++- scripts/ffmpeg/meson.build | 36 ++- scripts/ffmpeg/meson.options | 2 +- scripts/fftools-ffi/build.sh | 14 ++ scripts/frameworks/ios/build-ios.sh | 5 + scripts/frameworks/macos/build-macos.sh | 5 + scripts/libogg/build.sh | 16 ++ scripts/{libressl => libogg}/meson.build | 8 +- scripts/libressl/build.sh | 20 -- scripts/libs-arch/relink-dylibs.sh | 2 +- scripts/libvorbis/build.sh | 16 ++ scripts/libvorbis/meson.build | 17 ++ scripts/libvpx/build.sh | 15 ++ scripts/libx264/build.sh | 20 ++ scripts/libx264/meson.build | 23 ++ scripts/mbedtls/build.sh | 27 ++ 19 files changed, 602 insertions(+), 59 deletions(-) create mode 100644 scripts/fftools-ffi/build.sh create mode 100644 scripts/libogg/build.sh rename scripts/{libressl => libogg}/meson.build (58%) delete mode 100644 scripts/libressl/build.sh create mode 100644 scripts/libvorbis/build.sh create mode 100644 scripts/libvorbis/meson.build create mode 100644 scripts/libvpx/build.sh create mode 100644 scripts/libx264/build.sh create mode 100644 scripts/libx264/meson.build create mode 100644 scripts/mbedtls/build.sh diff --git a/LICENSE.txt b/LICENSE.txt index 6e60437..21bdbf1 100644 --- a/LICENSE.txt +++ b/LICENSE.txt @@ -1,3 +1,5 @@ +For the "default" and "full" flavors, the following license applies: + MIT License Copyright (c) 2023 birros @@ -19,3 +21,20 @@ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +For the "encodersgpl" flavor, the following license applies: + +Copyright (C) 2023 moffatman + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 3 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . diff --git a/Makefile b/Makefile index 8172e56..a930591 100644 --- a/Makefile +++ b/Makefile @@ -56,49 +56,68 @@ all: \ ${OUTPUT_DIR}/debug.zip \ ${OUTPUT_DIR}/libmpv-libs_${VERSION}_ios-arm64-audio-default.tar.gz \ ${OUTPUT_DIR}/libmpv-libs_${VERSION}_ios-arm64-audio-full.tar.gz \ + ${OUTPUT_DIR}/libmpv-libs_${VERSION}_ios-arm64-audio-encodersgpl.tar.gz \ ${OUTPUT_DIR}/libmpv-libs_${VERSION}_ios-arm64-video-default.tar.gz \ ${OUTPUT_DIR}/libmpv-libs_${VERSION}_ios-arm64-video-full.tar.gz \ + ${OUTPUT_DIR}/libmpv-libs_${VERSION}_ios-arm64-video-encodersgpl.tar.gz \ ${OUTPUT_DIR}/libmpv-libs_${VERSION}_iossimulator-amd64-audio-default.tar.gz \ ${OUTPUT_DIR}/libmpv-libs_${VERSION}_iossimulator-amd64-audio-full.tar.gz \ + ${OUTPUT_DIR}/libmpv-libs_${VERSION}_iossimulator-amd64-audio-encodersgpl.tar.gz \ ${OUTPUT_DIR}/libmpv-libs_${VERSION}_iossimulator-amd64-video-default.tar.gz \ ${OUTPUT_DIR}/libmpv-libs_${VERSION}_iossimulator-amd64-video-full.tar.gz \ + ${OUTPUT_DIR}/libmpv-libs_${VERSION}_iossimulator-amd64-video-encodersgpl.tar.gz \ ${OUTPUT_DIR}/libmpv-libs_${VERSION}_iossimulator-arm64-audio-default.tar.gz \ ${OUTPUT_DIR}/libmpv-libs_${VERSION}_iossimulator-arm64-audio-full.tar.gz \ + ${OUTPUT_DIR}/libmpv-libs_${VERSION}_iossimulator-arm64-audio-encodersgpl.tar.gz \ ${OUTPUT_DIR}/libmpv-libs_${VERSION}_iossimulator-arm64-video-default.tar.gz \ ${OUTPUT_DIR}/libmpv-libs_${VERSION}_iossimulator-arm64-video-full.tar.gz \ + ${OUTPUT_DIR}/libmpv-libs_${VERSION}_iossimulator-arm64-video-encodersgpl.tar.gz \ ${OUTPUT_DIR}/libmpv-libs_${VERSION}_iossimulator-universal-audio-default.tar.gz \ ${OUTPUT_DIR}/libmpv-libs_${VERSION}_iossimulator-universal-audio-full.tar.gz \ + ${OUTPUT_DIR}/libmpv-libs_${VERSION}_iossimulator-universal-audio-encodersgpl.tar.gz \ ${OUTPUT_DIR}/libmpv-libs_${VERSION}_iossimulator-universal-video-default.tar.gz \ ${OUTPUT_DIR}/libmpv-libs_${VERSION}_iossimulator-universal-video-full.tar.gz \ + ${OUTPUT_DIR}/libmpv-libs_${VERSION}_iossimulator-universal-video-encodersgpl.tar.gz \ ${OUTPUT_DIR}/libmpv-libs_${VERSION}_macos-amd64-audio-default.tar.gz \ ${OUTPUT_DIR}/libmpv-libs_${VERSION}_macos-amd64-audio-full.tar.gz \ + ${OUTPUT_DIR}/libmpv-libs_${VERSION}_macos-amd64-audio-encodersgpl.tar.gz \ ${OUTPUT_DIR}/libmpv-libs_${VERSION}_macos-amd64-video-default.tar.gz \ ${OUTPUT_DIR}/libmpv-libs_${VERSION}_macos-amd64-video-full.tar.gz \ + ${OUTPUT_DIR}/libmpv-libs_${VERSION}_macos-amd64-video-encodersgpl.tar.gz \ ${OUTPUT_DIR}/libmpv-libs_${VERSION}_macos-arm64-audio-default.tar.gz \ ${OUTPUT_DIR}/libmpv-libs_${VERSION}_macos-arm64-audio-full.tar.gz \ + ${OUTPUT_DIR}/libmpv-libs_${VERSION}_macos-arm64-audio-encodersgpl.tar.gz \ ${OUTPUT_DIR}/libmpv-libs_${VERSION}_macos-arm64-video-default.tar.gz \ ${OUTPUT_DIR}/libmpv-libs_${VERSION}_macos-arm64-video-full.tar.gz \ + ${OUTPUT_DIR}/libmpv-libs_${VERSION}_macos-arm64-video-encodersgpl.tar.gz \ ${OUTPUT_DIR}/libmpv-libs_${VERSION}_macos-universal-audio-default.tar.gz \ ${OUTPUT_DIR}/libmpv-libs_${VERSION}_macos-universal-audio-full.tar.gz \ + ${OUTPUT_DIR}/libmpv-libs_${VERSION}_macos-universal-audio-encodersgpl.tar.gz \ ${OUTPUT_DIR}/libmpv-libs_${VERSION}_macos-universal-video-default.tar.gz \ ${OUTPUT_DIR}/libmpv-libs_${VERSION}_macos-universal-video-full.tar.gz \ + ${OUTPUT_DIR}/libmpv-libs_${VERSION}_macos-universal-video-encodersgpl.tar.gz \ ${OUTPUT_DIR}/libmpv-xcframeworks_${VERSION}_ios-universal-audio-default.tar.gz \ ${OUTPUT_DIR}/libmpv-xcframeworks_${VERSION}_ios-universal-audio-full.tar.gz \ + ${OUTPUT_DIR}/libmpv-xcframeworks_${VERSION}_ios-universal-audio-encodersgpl.tar.gz \ ${OUTPUT_DIR}/libmpv-xcframeworks_${VERSION}_ios-universal-video-default.tar.gz \ ${OUTPUT_DIR}/libmpv-xcframeworks_${VERSION}_ios-universal-video-full.tar.gz \ + ${OUTPUT_DIR}/libmpv-xcframeworks_${VERSION}_ios-universal-video-encodersgpl.tar.gz \ ${OUTPUT_DIR}/libmpv-xcframeworks_${VERSION}_macos-universal-audio-default.tar.gz \ ${OUTPUT_DIR}/libmpv-xcframeworks_${VERSION}_macos-universal-audio-full.tar.gz \ + ${OUTPUT_DIR}/libmpv-xcframeworks_${VERSION}_macos-universal-audio-encodersgpl.tar.gz \ ${OUTPUT_DIR}/libmpv-xcframeworks_${VERSION}_macos-universal-video-default.tar.gz \ - ${OUTPUT_DIR}/libmpv-xcframeworks_${VERSION}_macos-universal-video-full.tar.gz + ${OUTPUT_DIR}/libmpv-xcframeworks_${VERSION}_macos-universal-video-full.tar.gz \ + ${OUTPUT_DIR}/libmpv-xcframeworks_${VERSION}_macos-universal-video-encodersgpl.tar.gz ${OUTPUT_DIR}/debug.zip: \ ${INTERMEDIATE_DIR}/tool-versions.lock \ $$(foreach OS,ios iossimulator macos, \ $$(foreach ARCH,amd64 arm64, \ $$(foreach VARIANT,audio video, \ - $$(foreach FLAVOR,default full, \ + $$(foreach FLAVOR,default full encodersgpl, \ $$(if $$(filter-out ios-amd64, $${OS}-$${ARCH}), \ ${INTERMEDIATE_DIR}/ffmpeg_$${OS}-$${ARCH}-$${VARIANT}-$${FLAVOR} \ + ${INTERMEDIATE_DIR}/fftools-ffi_$${OS}-$${ARCH}-$${VARIANT}-$${FLAVOR} \ ${INTERMEDIATE_DIR}/mpv_$${OS}-$${ARCH}-$${VARIANT} \ ) \ ) \ @@ -173,7 +192,7 @@ ${LINKS_DIR}: rm -rf ${TARGET_DIR} env \ - BINARIES="meson ninja cmake" \ + BINARIES="meson ninja cmake nasm" \ OUTPUT_DIR=${TARGET_OUTPUT_DIR} \ sh ${PROJECT_DIR}/scripts/links/build.sh @@ -257,8 +276,8 @@ ${INTERMEDIATE_DIR}/dav1d_%: \ rm -rf ${TARGET_TMP_DIR} -# libressl_- -${INTERMEDIATE_DIR}/libressl_%: \ +# mbedtls_- +${INTERMEDIATE_DIR}/mbedtls_%: \ ${DOWNLOADS_DIR} \ ${PKGCONFIG_DIR} @@ -341,10 +360,18 @@ ${INTERMEDIATE_DIR}/libxml2_%: \ ${INTERMEDIATE_DIR}/ffmpeg_%: \ ${DOWNLOADS_DIR} \ ${PKGCONFIG_DIR} \ - ${INTERMEDIATE_DIR}/libressl_$$(word 1,$$(subst -, ,$$*))-$$(word 2,$$(subst -, ,$$*)) \ + ${INTERMEDIATE_DIR}/mbedtls_$$(word 1,$$(subst -, ,$$*))-$$(word 2,$$(subst -, ,$$*)) \ + $$(if $$(filter encodersgpl, $$(word 4,$$(subst -, ,$$*))), \ + ${INTERMEDIATE_DIR}/libogg_$$(word 1,$$(subst -, ,$$*))-$$(word 2,$$(subst -, ,$$*)) \ + ${INTERMEDIATE_DIR}/libvorbis_$$(word 1,$$(subst -, ,$$*))-$$(word 2,$$(subst -, ,$$*)) \ + ) \ $$(if $$(filter video, $$(word 3,$$(subst -, ,$$*))), \ ${INTERMEDIATE_DIR}/dav1d_$$(word 1,$$(subst -, ,$$*))-$$(word 2,$$(subst -, ,$$*)) \ ${INTERMEDIATE_DIR}/libxml2_$$(word 1,$$(subst -, ,$$*))-$$(word 2,$$(subst -, ,$$*)) \ + $$(if $$(filter encodersgpl, $$(word 4,$$(subst -, ,$$*))), \ + ${INTERMEDIATE_DIR}/libvpx_$$(word 1,$$(subst -, ,$$*))-$$(word 2,$$(subst -, ,$$*)) \ + ${INTERMEDIATE_DIR}/libx264_$$(word 1,$$(subst -, ,$$*))-$$(word 2,$$(subst -, ,$$*)) \ + ) \ ) @echo "\033[32mRULE\033[0m $@" @@ -681,11 +708,273 @@ ${INTERMEDIATE_DIR}/mpv_%: \ rm -rf ${TARGET_TMP_DIR} +# fftools-ffi_-- +${INTERMEDIATE_DIR}/fftools-ffi_%: \ + ${DOWNLOADS_DIR} \ + ${PKGCONFIG_DIR} \ + ${INTERMEDIATE_DIR}/ffmpeg_$$(word 1,$$(subst -, ,$$*))-$$(word 2,$$(subst -, ,$$*))-$$(word 3,$$(subst -, ,$$*))-default + + @echo "\033[32mRULE\033[0m $@" + + $(eval TARGET_DIR=$@) + $(eval TARGET_PATTERN=$*) + $(eval TARGET_DEPS=$+) + $(eval TARGET_NAME=$(notdir ${TARGET_DIR})) + $(eval TARGET_PKGNAME=$(firstword $(subst _${TARGET_PATTERN}, ,${TARGET_NAME}))) + $(eval TARGET_TMP_DIR=${TMP_DIR}/${TARGET_NAME}) + $(eval TARGET_SRC_DIR=${TARGET_TMP_DIR}/src/${TARGET_PKGNAME}) + $(eval TARGET_OUTPUT_DIR=${PROJECT_DIR}/${TARGET_DIR}) + + $(eval ARCHIVE_FILE=$(firstword $(wildcard ${DOWNLOADS_DIR}/${TARGET_PKGNAME}-*.tar.*))) + + $(eval TARGET_OS=$(word 1, $(subst -, ,${TARGET_PATTERN}))) + $(eval TARGET_ARCH=$(word 2, $(subst -, ,${TARGET_PATTERN}))) + $(eval TARGET_VARIANT=$(word 3, $(subst -, ,${TARGET_PATTERN}))) + + $(eval TARGET_PKGS_DEPS=$(foreach DEP,${TARGET_DEPS}, \ + $(if $(findstring downloads,${DEP}),, \ + $(if $(findstring pkg-config,${DEP}),, \ + ${DEP})))) + $(eval PKG_CONFIG_PATH_LIST=$(foreach DEP,${TARGET_PKGS_DEPS},${PROJECT_DIR}/${DEP}/lib/pkgconfig)) + $(eval PKG_CONFIG_PATH=$(subst ${SPACE},${COLON},${PKG_CONFIG_PATH_LIST})) + + rm -rf ${TARGET_TMP_DIR} ${TARGET_DIR} + mkdir -p ${TARGET_TMP_DIR} + + env -i \ + PATH=${SANDBOX_PATH} \ + ARCHIVE_FILE=${ARCHIVE_FILE} \ + TARGET_DIR=${TARGET_SRC_DIR} \ + sh ${PROJECT_DIR}/scripts/extract/build.sh + + env -i \ + PATH=${SANDBOX_PATH} \ + PROJECT_DIR=${PROJECT_DIR} \ + PKG_CONFIG_PATH=${PKG_CONFIG_PATH} \ + OS=${TARGET_OS} \ + ARCH=${TARGET_ARCH} \ + VARIANT=${TARGET_VARIANT} \ + SRC_DIR=${TARGET_SRC_DIR} \ + OUTPUT_DIR=${TARGET_OUTPUT_DIR} \ + sh ${PROJECT_DIR}/scripts/${TARGET_PKGNAME}/build.sh + + rm -rf ${TARGET_TMP_DIR} + +# libogg_-- +${INTERMEDIATE_DIR}/libogg_%: \ + ${DOWNLOADS_DIR} \ + ${PKGCONFIG_DIR} + + @echo "\033[32mRULE\033[0m $@" + + $(eval TARGET_DIR=$@) + $(eval TARGET_PATTERN=$*) + $(eval TARGET_DEPS=$+) + $(eval TARGET_NAME=$(notdir ${TARGET_DIR})) + $(eval TARGET_PKGNAME=$(firstword $(subst _${TARGET_PATTERN}, ,${TARGET_NAME}))) + $(eval TARGET_TMP_DIR=${TMP_DIR}/${TARGET_NAME}) + $(eval TARGET_SRC_DIR=${TARGET_TMP_DIR}/src/${TARGET_PKGNAME}) + $(eval TARGET_OUTPUT_DIR=${PROJECT_DIR}/${TARGET_DIR}) + + $(eval ARCHIVE_FILE=$(firstword $(wildcard ${DOWNLOADS_DIR}/${TARGET_PKGNAME}-*.tar.*))) + + $(eval TARGET_OS=$(word 1, $(subst -, ,${TARGET_PATTERN}))) + $(eval TARGET_ARCH=$(word 2, $(subst -, ,${TARGET_PATTERN}))) + $(eval TARGET_VARIANT=$(word 3, $(subst -, ,${TARGET_PATTERN}))) + + $(eval TARGET_PKGS_DEPS=$(foreach DEP,${TARGET_DEPS}, \ + $(if $(findstring downloads,${DEP}),, \ + $(if $(findstring pkg-config,${DEP}),, \ + ${DEP})))) + $(eval PKG_CONFIG_PATH_LIST=$(foreach DEP,${TARGET_PKGS_DEPS},${PROJECT_DIR}/${DEP}/lib/pkgconfig)) + $(eval PKG_CONFIG_PATH=$(subst ${SPACE},${COLON},${PKG_CONFIG_PATH_LIST})) + + rm -rf ${TARGET_TMP_DIR} ${TARGET_DIR} + mkdir -p ${TARGET_TMP_DIR} + + env -i \ + PATH=${SANDBOX_PATH} \ + ARCHIVE_FILE=${ARCHIVE_FILE} \ + TARGET_DIR=${TARGET_SRC_DIR} \ + sh ${PROJECT_DIR}/scripts/extract/build.sh + + env -i \ + PATH=${SANDBOX_PATH} \ + PROJECT_DIR=${PROJECT_DIR} \ + PKG_CONFIG_PATH=${PKG_CONFIG_PATH} \ + OS=${TARGET_OS} \ + ARCH=${TARGET_ARCH} \ + VARIANT=${TARGET_VARIANT} \ + SRC_DIR=${TARGET_SRC_DIR} \ + OUTPUT_DIR=${TARGET_OUTPUT_DIR} \ + sh ${PROJECT_DIR}/scripts/${TARGET_PKGNAME}/build.sh + + rm -rf ${TARGET_TMP_DIR} + +# libvorbis_-- +${INTERMEDIATE_DIR}/libvorbis_%: \ + ${DOWNLOADS_DIR} \ + ${PKGCONFIG_DIR} \ + ${INTERMEDIATE_DIR}/libogg_$$(word 1,$$(subst -, ,$$*))-$$(word 2,$$(subst -, ,$$*)) + + @echo "\033[32mRULE\033[0m $@" + + $(eval TARGET_DIR=$@) + $(eval TARGET_PATTERN=$*) + $(eval TARGET_DEPS=$+) + $(eval TARGET_NAME=$(notdir ${TARGET_DIR})) + $(eval TARGET_PKGNAME=$(firstword $(subst _${TARGET_PATTERN}, ,${TARGET_NAME}))) + $(eval TARGET_TMP_DIR=${TMP_DIR}/${TARGET_NAME}) + $(eval TARGET_SRC_DIR=${TARGET_TMP_DIR}/src/${TARGET_PKGNAME}) + $(eval TARGET_OUTPUT_DIR=${PROJECT_DIR}/${TARGET_DIR}) + + $(eval ARCHIVE_FILE=$(firstword $(wildcard ${DOWNLOADS_DIR}/${TARGET_PKGNAME}-*.tar.*))) + + $(eval TARGET_OS=$(word 1, $(subst -, ,${TARGET_PATTERN}))) + $(eval TARGET_ARCH=$(word 2, $(subst -, ,${TARGET_PATTERN}))) + $(eval TARGET_VARIANT=$(word 3, $(subst -, ,${TARGET_PATTERN}))) + + $(eval TARGET_PKGS_DEPS=$(foreach DEP,${TARGET_DEPS}, \ + $(if $(findstring downloads,${DEP}),, \ + $(if $(findstring pkg-config,${DEP}),, \ + ${DEP})))) + $(eval PKG_CONFIG_PATH_LIST=$(foreach DEP,${TARGET_PKGS_DEPS},${PROJECT_DIR}/${DEP}/lib/pkgconfig)) + $(eval PKG_CONFIG_PATH=$(subst ${SPACE},${COLON},${PKG_CONFIG_PATH_LIST})) + + rm -rf ${TARGET_TMP_DIR} ${TARGET_DIR} + mkdir -p ${TARGET_TMP_DIR} + + env -i \ + PATH=${SANDBOX_PATH} \ + ARCHIVE_FILE=${ARCHIVE_FILE} \ + TARGET_DIR=${TARGET_SRC_DIR} \ + sh ${PROJECT_DIR}/scripts/extract/build.sh + + env -i \ + PATH=${SANDBOX_PATH} \ + PROJECT_DIR=${PROJECT_DIR} \ + PKG_CONFIG_PATH=${PKG_CONFIG_PATH} \ + OS=${TARGET_OS} \ + ARCH=${TARGET_ARCH} \ + VARIANT=${TARGET_VARIANT} \ + SRC_DIR=${TARGET_SRC_DIR} \ + OUTPUT_DIR=${TARGET_OUTPUT_DIR} \ + sh ${PROJECT_DIR}/scripts/${TARGET_PKGNAME}/build.sh + + rm -rf x${TARGET_TMP_DIR} + +# libvpx_-- +${INTERMEDIATE_DIR}/libvpx_%: \ + ${DOWNLOADS_DIR} \ + ${PKGCONFIG_DIR} + + @echo "\033[32mRULE\033[0m $@" + + $(eval TARGET_DIR=$@) + $(eval TARGET_PATTERN=$*) + $(eval TARGET_DEPS=$+) + $(eval TARGET_NAME=$(notdir ${TARGET_DIR})) + $(eval TARGET_PKGNAME=$(firstword $(subst _${TARGET_PATTERN}, ,${TARGET_NAME}))) + $(eval TARGET_TMP_DIR=${TMP_DIR}/${TARGET_NAME}) + $(eval TARGET_SRC_DIR=${TARGET_TMP_DIR}/src/${TARGET_PKGNAME}) + $(eval TARGET_OUTPUT_DIR=${PROJECT_DIR}/${TARGET_DIR}) + + $(eval ARCHIVE_FILE=$(firstword $(wildcard ${DOWNLOADS_DIR}/${TARGET_PKGNAME}-*.tar.*))) + + $(eval TARGET_OS=$(word 1, $(subst -, ,${TARGET_PATTERN}))) + $(eval TARGET_ARCH=$(word 2, $(subst -, ,${TARGET_PATTERN}))) + $(eval TARGET_VARIANT=$(word 3, $(subst -, ,${TARGET_PATTERN}))) + + $(eval TARGET_PKGS_DEPS=$(foreach DEP,${TARGET_DEPS}, \ + $(if $(findstring downloads,${DEP}),, \ + $(if $(findstring pkg-config,${DEP}),, \ + ${DEP})))) + $(eval PKG_CONFIG_PATH_LIST=$(foreach DEP,${TARGET_PKGS_DEPS},${PROJECT_DIR}/${DEP}/lib/pkgconfig)) + $(eval PKG_CONFIG_PATH=$(subst ${SPACE},${COLON},${PKG_CONFIG_PATH_LIST})) + + rm -rf ${TARGET_TMP_DIR} ${TARGET_DIR} + mkdir -p ${TARGET_TMP_DIR} + + env -i \ + PATH=${SANDBOX_PATH} \ + ARCHIVE_FILE=${ARCHIVE_FILE} \ + TARGET_DIR=${TARGET_SRC_DIR} \ + sh ${PROJECT_DIR}/scripts/extract/build.sh + + env -i \ + PATH=${SANDBOX_PATH} \ + PROJECT_DIR=${PROJECT_DIR} \ + PKG_CONFIG_PATH=${PKG_CONFIG_PATH} \ + OS=${TARGET_OS} \ + ARCH=${TARGET_ARCH} \ + VARIANT=${TARGET_VARIANT} \ + SRC_DIR=${TARGET_SRC_DIR} \ + OUTPUT_DIR=${TARGET_OUTPUT_DIR} \ + sh ${PROJECT_DIR}/scripts/${TARGET_PKGNAME}/build.sh + + rm -rf ${TARGET_TMP_DIR} + +# libx264_-- +${INTERMEDIATE_DIR}/libx264_%: \ + ${DOWNLOADS_DIR} \ + ${PKGCONFIG_DIR} + + @echo "\033[32mRULE\033[0m $@" + + $(eval TARGET_DIR=$@) + $(eval TARGET_PATTERN=$*) + $(eval TARGET_DEPS=$+) + $(eval TARGET_NAME=$(notdir ${TARGET_DIR})) + $(eval TARGET_PKGNAME=$(firstword $(subst _${TARGET_PATTERN}, ,${TARGET_NAME}))) + $(eval TARGET_TMP_DIR=${TMP_DIR}/${TARGET_NAME}) + $(eval TARGET_SRC_DIR=${TARGET_TMP_DIR}/src/${TARGET_PKGNAME}) + $(eval TARGET_OUTPUT_DIR=${PROJECT_DIR}/${TARGET_DIR}) + + $(eval ARCHIVE_FILE=$(firstword $(wildcard ${DOWNLOADS_DIR}/${TARGET_PKGNAME}-*.tar.*))) + + $(eval TARGET_OS=$(word 1, $(subst -, ,${TARGET_PATTERN}))) + $(eval TARGET_ARCH=$(word 2, $(subst -, ,${TARGET_PATTERN}))) + $(eval TARGET_VARIANT=$(word 3, $(subst -, ,${TARGET_PATTERN}))) + + $(eval TARGET_PKGS_DEPS=$(foreach DEP,${TARGET_DEPS}, \ + $(if $(findstring downloads,${DEP}),, \ + $(if $(findstring pkg-config,${DEP}),, \ + ${DEP})))) + $(eval PKG_CONFIG_PATH_LIST=$(foreach DEP,${TARGET_PKGS_DEPS},${PROJECT_DIR}/${DEP}/lib/pkgconfig)) + $(eval PKG_CONFIG_PATH=$(subst ${SPACE},${COLON},${PKG_CONFIG_PATH_LIST})) + + rm -rf ${TARGET_TMP_DIR} ${TARGET_DIR} + mkdir -p ${TARGET_TMP_DIR} + + env -i \ + PATH=${SANDBOX_PATH} \ + ARCHIVE_FILE=${ARCHIVE_FILE} \ + TARGET_DIR=${TARGET_SRC_DIR} \ + sh ${PROJECT_DIR}/scripts/extract/build.sh + + env -i \ + PATH=${SANDBOX_PATH} \ + PROJECT_DIR=${PROJECT_DIR} \ + PKG_CONFIG_PATH=${PKG_CONFIG_PATH} \ + OS=${TARGET_OS} \ + ARCH=${TARGET_ARCH} \ + VARIANT=${TARGET_VARIANT} \ + SRC_DIR=${TARGET_SRC_DIR} \ + OUTPUT_DIR=${TARGET_OUTPUT_DIR} \ + sh ${PROJECT_DIR}/scripts/${TARGET_PKGNAME}/build.sh + + rm -rf ${TARGET_TMP_DIR} + # libs-arch_--- ${INTERMEDIATE_DIR}/libs-arch_%: \ ${INTERMEDIATE_DIR}/mpv_$$(word 1,$$(subst -, ,$$*))-$$(word 2,$$(subst -, ,$$*))-$$(word 3,$$(subst -, ,$$*)) \ ${INTERMEDIATE_DIR}/ffmpeg_$$(word 1,$$(subst -, ,$$*))-$$(word 2,$$(subst -, ,$$*))-$$(word 3,$$(subst -, ,$$*))-$$(word 4,$$(subst -, ,$$*)) \ - ${INTERMEDIATE_DIR}/libressl_$$(word 1,$$(subst -, ,$$*))-$$(word 2,$$(subst -, ,$$*)) \ + ${INTERMEDIATE_DIR}/mbedtls_$$(word 1,$$(subst -, ,$$*))-$$(word 2,$$(subst -, ,$$*)) \ + $$(if $$(filter encodersgpl, $$(word 4,$$(subst -, ,$$*))), \ + ${INTERMEDIATE_DIR}/fftools-ffi_$$(word 1,$$(subst -, ,$$*))-$$(word 2,$$(subst -, ,$$*))-$$(word 3,$$(subst -, ,$$*)) \ + ${INTERMEDIATE_DIR}/libogg_$$(word 1,$$(subst -, ,$$*))-$$(word 2,$$(subst -, ,$$*)) \ + ${INTERMEDIATE_DIR}/libvorbis_$$(word 1,$$(subst -, ,$$*))-$$(word 2,$$(subst -, ,$$*)) \ + ) \ $$(if $$(filter video, $$(word 3,$$(subst -, ,$$*))), \ ${INTERMEDIATE_DIR}/dav1d_$$(word 1,$$(subst -, ,$$*))-$$(word 2,$$(subst -, ,$$*)) \ ${INTERMEDIATE_DIR}/libxml2_$$(word 1,$$(subst -, ,$$*))-$$(word 2,$$(subst -, ,$$*)) \ @@ -694,6 +983,10 @@ ${INTERMEDIATE_DIR}/libs-arch_%: \ ${INTERMEDIATE_DIR}/harfbuzz_$$(word 1,$$(subst -, ,$$*))-$$(word 2,$$(subst -, ,$$*)) \ ${INTERMEDIATE_DIR}/fribidi_$$(word 1,$$(subst -, ,$$*))-$$(word 2,$$(subst -, ,$$*)) \ ${INTERMEDIATE_DIR}/freetype_$$(word 1,$$(subst -, ,$$*))-$$(word 2,$$(subst -, ,$$*)) \ + $$(if $$(filter encodersgpl, $$(word 4,$$(subst -, ,$$*))), \ + ${INTERMEDIATE_DIR}/libvpx_$$(word 1,$$(subst -, ,$$*))-$$(word 2,$$(subst -, ,$$*)) \ + ${INTERMEDIATE_DIR}/libx264_$$(word 1,$$(subst -, ,$$*))-$$(word 2,$$(subst -, ,$$*)) \ + ) \ ) @echo "\033[32mRULE\033[0m $@" @@ -892,7 +1185,6 @@ update-downloads-lock: harfbuzz \ fribidi \ ffmpeg \ - libressl \ libxml2 \ dav1d \ ) diff --git a/README.md b/README.md index aee3ce7..8474800 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ Provides builds of [libmpv](https://github.com/mpv-player/mpv) for macOS & iOS, used by [media_kit](https://github.com/alexmercerind/media_kit), compatible -with commercial use. +with commercial use for playback, and GPL use for encoding. Heavily inspired by [Homebrew](https://github.com/Homebrew/brew) and [IINA](https://github.com/iina/iina). @@ -15,24 +15,34 @@ $ VERSION=v0.0.1 make $ ls build/output libmpv-libs_v0.0.1_ios-arm64-audio-default.tar.gz libmpv-libs_v0.0.1_ios-arm64-audio-full.tar.gz +libmpv-libs_v0.0.1_ios-arm64-audio-encodersgpl.tar.gz libmpv-libs_v0.0.1_ios-arm64-video-default.tar.gz libmpv-libs_v0.0.1_ios-arm64-video-full.tar.gz +libmpv-libs_v0.0.1_ios-arm64-video-encodersgpl.tar.gz libmpv-libs_v0.0.1_iossimulator-universal-audio-default.tar.gz libmpv-libs_v0.0.1_iossimulator-universal-audio-full.tar.gz +libmpv-libs_v0.0.1_iossimulator-universal-audio-encodersgpl.tar.gz libmpv-libs_v0.0.1_iossimulator-universal-video-default.tar.gz libmpv-libs_v0.0.1_iossimulator-universal-video-full.tar.gz +libmpv-libs_v0.0.1_iossimulator-universal-video-encodersgpl.tar.gz libmpv-libs_v0.0.1_macos-universal-audio-default.tar.gz libmpv-libs_v0.0.1_macos-universal-audio-full.tar.gz +libmpv-libs_v0.0.1_macos-universal-audio-encodersgpl.tar.gz libmpv-libs_v0.0.1_macos-universal-video-default.tar.gz libmpv-libs_v0.0.1_macos-universal-video-full.tar.gz +libmpv-libs_v0.0.1_macos-universal-video-encodersgpl.tar.gz libmpv-xcframeworks_v0.0.1_ios-universal-audio-default.tar.gz libmpv-xcframeworks_v0.0.1_ios-universal-audio-full.tar.gz +libmpv-xcframeworks_v0.0.1_ios-universal-audio-encodersgpl.tar.gz libmpv-xcframeworks_v0.0.1_ios-universal-video-default.tar.gz libmpv-xcframeworks_v0.0.1_ios-universal-video-full.tar.gz +libmpv-xcframeworks_v0.0.1_ios-universal-video-encodersgpl.tar.gz libmpv-xcframeworks_v0.0.1_macos-universal-audio-default.tar.gz libmpv-xcframeworks_v0.0.1_macos-universal-audio-full.tar.gz +libmpv-xcframeworks_v0.0.1_macos-universal-audio-encodersgpl.tar.gz libmpv-xcframeworks_v0.0.1_macos-universal-video-default.tar.gz libmpv-xcframeworks_v0.0.1_macos-universal-video-full.tar.gz +libmpv-xcframeworks_v0.0.1_macos-universal-video-encodersgpl.tar.gz ``` ## Naming convention @@ -41,14 +51,14 @@ libmpv-xcframeworks_v0.0.1_macos-universal-video-full.tar.gz libmpv-__---.tar.gz ``` -| Component | Notes | Value | -| ----------- | ------------------------------- | ------------------------ | -| **format** | Output format of built files | libs, xcframeworks | -| **version** | Semantic version | v0.0.1, … | -| **os** | Operating system | ios, iossimulator, macos | -| **arch** | Architecture | arm64, amd64, universal | -| **variant** | Usage context | audio, video | -| **flavor** | Number of available decoders, … | default, full | +| Component | Notes | Value | +| ----------- | ------------------------------- | -------------------------- | +| **format** | Output format of built files | libs, xcframeworks | +| **version** | Semantic version | v0.0.1, … | +| **os** | Operating system | ios, iossimulator, macos | +| **arch** | Architecture | arm64, amd64, universal | +| **variant** | Usage context | audio, video | +| **flavor** | Available decoders and encoders | default, full, encodersgpl | ## Minimum versions @@ -99,22 +109,32 @@ flowchart LR A(mpv) --> B(ffmpeg) A(mpv) -.-> C(libass) A(mpv) -.-> D(uchardet) +A(mpv) -.-> K(fftools-ffi) B -.-> H(dav1d) -B -.-> I(libressl) +B -.-> I(mbedtls) B -.-> J(libxml2) +B -.-> L(libvpx) +B -.-> M(libx264) +B -.-> N(libvorbis) C --> E(freetype) C --> F(harfbuzz) C --> G(fribidi) +N --> O(libogg) + E -.-> F +K -.-> B ``` - [**ffmpeg**](https://ffmpeg.org): A cross-platform solution for converting, streaming, and recording audio and video, with support for a wide range of codecs and formats +- [**fftools-ffi**](https://github.com/moffatman/fftools-ffi): FFmpeg's command-line + interface exposed as a shared library for FFI usage + - **[libass](https://github.com/libass/libass)(optional)**: A library for rendering subtitles in videos, with support for advanced text formatting and positioning features (made optional with a patch) @@ -134,9 +154,20 @@ E -.-> F - **[dav1d](https://code.videolan.org/videolan/dav1d) (optional)**: A library for cross-platform AV1 decoding -- **[libressl](https://www.libressl.org/) (optional)**: A fork of OpenSSL that - aims to provide a more secure and auditable implementation of the SSL/TLS - protocols +- **[libogg](https://github.com/xiph/ogg) (optional)**: Reference implementation + of the Ogg media container + +- **[libvorbis](https://github.com/xiph/vorbis) (optional)**: Reference implementation + of the Ogg Vorbis audio format + +- **[libvpx](https://gitlab.freedesktop.org/gstreamer/meson-ports/libvpx) (optional)**: Reference + implementation of the VP8 and VP9 video formats + +- **[libx264](https://www.videolan.org/developers/x264.html) (optional)**: Free software library + for encoding video streams into the H.264/MPEG-4 AVC compression format + +- **[mbedtls](https://www.libressl.org/) (optional)**: An open source, portable, + easy to use, readable and flexible TLS library - **[libxml2](http://xmlsoft.org/) (optional)**: A library for processing XML data, used by ffmpeg to support the Dash protocol @@ -147,6 +178,8 @@ E -.-> F ## Commercial use +### Default, Full flavors + | Dependency | Licence | Commercial use | | ---------- | ------------------------------------------------------ | :------------: | | mpv | LGPL-2.1 (`-Dgpl=false`) | ✅ | @@ -155,11 +188,29 @@ E -.-> F | freetype | FreeType | ✅ | | harfbuzz | MIT | ✅ | | fribidi | LGPL-2.1 | ✅ | -| libressl | Apache-1.0, BSD-4-Clause, ISC, public domain | ✅ | +| mbedtls | Apache 2.0 | ✅ | | uchardet | MPL-1.1, GPL-2, LGPL-2.1 | ✅ | | libxml2 | MIT | ✅ | | dav1d | BSD-2-clause | ✅ | +### Encoders-GPL flavor + +| mpv | LGPL-2.1 (`-Dgpl=false`) | ✅ | +| ffmpeg | GPL-2.1 (`--enable-nonfree` omitted) | ❌ | +| libass | ISC | ✅ | +| freetype | FreeType | ✅ | +| harfbuzz | MIT | ✅ | +| fribidi | LGPL-2.1 | ✅ | +| mbedtls | Apache 2.0 | ✅ | +| uchardet | MPL-1.1, GPL-2, LGPL-2.1 | ✅ | +| libxml2 | MIT | ✅ | +| dav1d | BSD-2-clause | ✅ | +| fftools-ffi | LGPL-2.1 | ✅ | +| libx264 | GPL-2.0+ | ❌ | +| libvpx | BSD-3-clause | ✅ | +| libvorbis | BSD-3-clause | ✅ | +| libogg | BSD-3-clause | ✅ | + ## Notes - Some dependencies, which are not needed at the moment, may be added in the @@ -235,3 +286,4 @@ solution was to: - https://github.com/ldwardx/mpv-build-mac-iOS - https://github.com/birros/godot_tl/tree/ca2fc4151bd8141241151dd6e29768608600473a/toolchains - https://github.com/Vargol/ffmpeg-apple-arm64-build +- https://github.com/arthenica/ffmpeg-kit diff --git a/downloads.lock b/downloads.lock index cab86c9..69fabd9 100644 --- a/downloads.lock +++ b/downloads.lock @@ -6,6 +6,10 @@ ffmpeg: version: "6.0" url: https://ffmpeg.org/releases/ffmpeg-6.0.tar.xz sha256: 57be87c22d9b49c112b6d24bc67d42508660e6b718b3db89c44e47e289137082 +fftools-ffi: + version: "106d5813" + url: https://github.com/moffatman/fftools-ffi/archive/106d58138071eba66c7d814f6573029c712cd597.tar.gz + sha256: 4577bb410978f5026270390aa65ebf0307250f3f5b0adf5353e060a5a3f4ee25 freetype: version: 2.13.2 url: https://downloads.sourceforge.net/project/freetype/freetype2/2.13.2/freetype-2.13.2.tar.xz @@ -22,14 +26,30 @@ libass: version: 0.17.1 url: https://github.com/libass/libass/releases/download/0.17.1/libass-0.17.1.tar.xz sha256: f0da0bbfba476c16ae3e1cfd862256d30915911f7abaa1b16ce62ee653192784 -libressl: - version: 3.7.3 - url: https://cdn.openbsd.org/pub/OpenBSD/LibreSSL/libressl-3.7.3.tar.gz - sha256: 7948c856a90c825bd7268b6f85674a8dcd254bae42e221781b24e3f8dc335db3 +libogg: + version: 1.3.5 + url: https://github.com/xiph/ogg/releases/download/v1.3.5/libogg-1.3.5.tar.gz + sha256: 0eb4b4b9420a0f51db142ba3f9c64b333f826532dc0f48c6410ae51f4799b664 +libvorbis: + version: 1.3.7 + url: https://github.com/xiph/vorbis/releases/download/v1.3.7/libvorbis-1.3.7.tar.gz + sha256: 0e982409a9c3fc82ee06e08205b1355e5c6aa4c36bca58146ef399621b0ce5ab +libvpx: + version: 1.13.0+1 + url: https://gitlab.freedesktop.org/gstreamer/meson-ports/libvpx/-/archive/90d26fac0d895969a82cd873ad36e39737104c44/libvpx-v1.13.0.tar.gz + sha256: 4f872ad2709d17b848b3588231495e432c42b9263731b9121fa210a3c5a893ff +libx264: + version: "a8b68ebf" + url: https://code.videolan.org/videolan/x264/-/archive/a8b68ebfaa68621b5ac8907610d3335971839d52/libx264-a8b68ebfaa68621b5ac8907610d3335971839d52.tar.gz + sha256: 164688b63f11a6e4f6d945057fc5c57d5eefb97973d0029fb0303744e10839ff libxml2: version: 2.11.5 url: https://download.gnome.org/sources/libxml2/2.11/libxml2-2.11.5.tar.xz sha256: 3727b078c360ec69fa869de14bd6f75d7ee8d36987b071e6928d4720a28df3a6 +mbedtls: + version: 3.4.1 + url: https://github.com/Mbed-TLS/mbedtls/archive/refs/tags/v3.4.1.tar.gz + sha256: a420fcf7103e54e775c383e3751729b8fb2dcd087f6165befd13f28315f754f5 mpv: version: 0.36.0 url: https://github.com/mpv-player/mpv/archive/refs/tags/v0.36.0.tar.gz diff --git a/scripts/ffmpeg/meson.build b/scripts/ffmpeg/meson.build index 16d3b0a..aa3831e 100644 --- a/scripts/ffmpeg/meson.build +++ b/scripts/ffmpeg/meson.build @@ -46,7 +46,8 @@ common_options = [ '--enable-network', '--enable-pthreads', '--enable-pic', - '--enable-libtls', # tls support (libressl) + '--enable-mbedtls', # tls support (mbedtls) + '--enable-version3', '--enable-safe-bitstream-reader', '--enable-stripping', '--enable-avcodec', @@ -282,6 +283,20 @@ video_full_options = [ '--enable-decoder=h264', ] +audio_encodersgpl_options = [ + '--enable-encoders', + '--enable-muxers', + '--enable-filters', + '--enable-libvorbis', + # TODO: If audio_encoders is going to exist as its own package, be smarter about what encoders to include +] + +video_encodersgpl_options = [ + '--enable-libvpx', + '--enable-libx264', + '--enable-gpl' +] + # disable all option options = disable_all_options @@ -303,6 +318,13 @@ elif flavor == 'full' if variant == 'video' options += video_full_options endif +elif flavor == 'encodersgpl' + options += audio_full_options + options += audio_encodersgpl_options + if variant == 'video' + options += video_full_options + options += video_encodersgpl_options + endif endif p = mod.add_project('configure', @@ -333,14 +355,16 @@ p = mod.add_project('configure', verbose: true, ) -libavfilter_dep = p.dependency('libavfilter') -libswscale_dep = p.dependency('libswscale') -libavcodec_dep = p.dependency('libavcodec') -libavformat_dep = p.dependency('libavformat') -libswresample_dep = p.dependency('libswresample') +libavfilter_dep = p.dependency('avfilter') +libswscale_dep = p.dependency('swscale') +libavcodec_dep = p.dependency('avcodec') +libavformat_dep = p.dependency('avformat') +libavutil_dep = p.dependency('avutil') +libswresample_dep = p.dependency('swresample') meson.override_dependency('libavfilter', libavfilter_dep) meson.override_dependency('libswscale', libswscale_dep) meson.override_dependency('libavcodec', libavcodec_dep) meson.override_dependency('libavformat', libavformat_dep) +meson.override_dependency('libavutil', libavutil_dep) meson.override_dependency('libswresample', libswresample_dep) diff --git a/scripts/ffmpeg/meson.options b/scripts/ffmpeg/meson.options index d92686c..a48d1db 100644 --- a/scripts/ffmpeg/meson.options +++ b/scripts/ffmpeg/meson.options @@ -1,2 +1,2 @@ option('variant', type : 'combo', choices : ['audio', 'video']) -option('flavor', type : 'combo', choices : ['default', 'full']) +option('flavor', type : 'combo', choices : ['default', 'full', 'encodersgpl']) diff --git a/scripts/fftools-ffi/build.sh b/scripts/fftools-ffi/build.sh new file mode 100644 index 0000000..4079379 --- /dev/null +++ b/scripts/fftools-ffi/build.sh @@ -0,0 +1,14 @@ +#!/bin/bash + +set -e # exit immediately if a command exits with a non-zero status +set -u # treat unset variables as an error + +cd ${SRC_DIR} + +meson setup build \ + --cross-file ${PROJECT_DIR}/cross-files/${OS}-${ARCH}.ini \ + --prefix="${OUTPUT_DIR}" | + tee configure.log + +meson compile -C build +meson install -C build diff --git a/scripts/frameworks/ios/build-ios.sh b/scripts/frameworks/ios/build-ios.sh index e709a13..95032a4 100755 --- a/scripts/frameworks/ios/build-ios.sh +++ b/scripts/frameworks/ios/build-ios.sh @@ -15,6 +15,11 @@ find ${DEPS} -name "*.dylib" -type f | while read DYLIB; do # framework dir FRAMEWORK_DIR="${OUTPUT_DIR}/${FRAMEWORK_NAME}.framework" + if [ -d $FRAMEWORK_DIR ]; then + # Duplicated framework because of versioned dylibs, just skip + continue + fi + # determine archs ARCHS=$(lipo -archs "${DYLIB}") diff --git a/scripts/frameworks/macos/build-macos.sh b/scripts/frameworks/macos/build-macos.sh index a323f13..af5873f 100755 --- a/scripts/frameworks/macos/build-macos.sh +++ b/scripts/frameworks/macos/build-macos.sh @@ -16,6 +16,11 @@ find ${DEPS} -name "*.dylib" -type f | while read DYLIB; do # framework dir FRAMEWORK_DIR="${OUTPUT_DIR}/${FRAMEWORK_NAME}.framework" + if [ -d $FRAMEWORK_DIR ]; then + # Duplicated framework because of versioned dylibs, just skip + continue + fi + # determine archs ARCHS=$(lipo -archs "${DYLIB}") diff --git a/scripts/libogg/build.sh b/scripts/libogg/build.sh new file mode 100644 index 0000000..ca5dafa --- /dev/null +++ b/scripts/libogg/build.sh @@ -0,0 +1,16 @@ +#!/bin/bash + +set -e # exit immediately if a command exits with a non-zero status +set -u # treat unset variables as an error + +cd ${SRC_DIR} + +cp ${PROJECT_DIR}/scripts/libogg/meson.* . + +meson setup build \ + --cross-file ${PROJECT_DIR}/cross-files/${OS}-${ARCH}.ini \ + --prefix="${OUTPUT_DIR}" | + tee configure.log + +meson compile -C build libogg +meson install -C build diff --git a/scripts/libressl/meson.build b/scripts/libogg/meson.build similarity index 58% rename from scripts/libressl/meson.build rename to scripts/libogg/meson.build index 915ee5b..4316649 100644 --- a/scripts/libressl/meson.build +++ b/scripts/libogg/meson.build @@ -1,6 +1,6 @@ # https://mesonbuild.com/External-Project-module.html -project('libressl', 'c') +project('libogg', 'c') mod = import('unstable-external_project') @@ -9,11 +9,9 @@ p = mod.add_project('configure', '--prefix=@PREFIX@', '--disable-static', '--enable-shared', - '--disable-dependency-tracking', - '--disable-silent-rules', ], verbose: true, ) -libressl_dep = p.dependency('libressl') -meson.override_dependency('libressl', libressl_dep) +libogg_dep = p.dependency('libogg') +meson.override_dependency('libogg', libogg_dep) diff --git a/scripts/libressl/build.sh b/scripts/libressl/build.sh deleted file mode 100644 index 0e6341c..0000000 --- a/scripts/libressl/build.sh +++ /dev/null @@ -1,20 +0,0 @@ -#!/bin/sh - -set -e # exit immediately if a command exits with a non-zero status -set -u # treat unset variables as an error - -cd ${SRC_DIR} - -cp ${PROJECT_DIR}/scripts/libressl/meson.build ./meson.build -meson setup build \ - --cross-file ${PROJECT_DIR}/cross-files/${OS}-${ARCH}.ini \ - --prefix="${OUTPUT_DIR}" - -meson compile -C build libressl - -# fix file permissions -chmod 755 build/dist"${OUTPUT_DIR}"/lib/* - -# manual install to preserve symlinks (meson install -C build) -mkdir -p "${OUTPUT_DIR}" -cp -R build/dist"${OUTPUT_DIR}"/* "${OUTPUT_DIR}"/ diff --git a/scripts/libs-arch/relink-dylibs.sh b/scripts/libs-arch/relink-dylibs.sh index 899554f..4891ee0 100755 --- a/scripts/libs-arch/relink-dylibs.sh +++ b/scripts/libs-arch/relink-dylibs.sh @@ -28,7 +28,7 @@ relink_dylibs() { grep " name " | cut -d " " -f11 | tail -n +2 | - grep "$SOURCE_PREFIX" | + grep -E "$SOURCE_PREFIX|^lib" | # libmbedtls emitted without absolute path for some reason while read DEP; do DEPNAME=$(basename $DEP) diff --git a/scripts/libvorbis/build.sh b/scripts/libvorbis/build.sh new file mode 100644 index 0000000..8fbb30e --- /dev/null +++ b/scripts/libvorbis/build.sh @@ -0,0 +1,16 @@ +#!/bin/bash + +set -e # exit immediately if a command exits with a non-zero status +set -u # treat unset variables as an error + +cd ${SRC_DIR} + +cp ${PROJECT_DIR}/scripts/libvorbis/meson.* . + +meson setup build \ + --cross-file ${PROJECT_DIR}/cross-files/${OS}-${ARCH}.ini \ + --prefix="${OUTPUT_DIR}" | + tee configure.log + +meson compile -C build libvorbis +meson install -C build diff --git a/scripts/libvorbis/meson.build b/scripts/libvorbis/meson.build new file mode 100644 index 0000000..094d16a --- /dev/null +++ b/scripts/libvorbis/meson.build @@ -0,0 +1,17 @@ +# https://mesonbuild.com/External-Project-module.html + +project('libvorbis', 'c') + +mod = import('unstable-external_project') + +p = mod.add_project('configure', + configure_options : [ + '--prefix=@PREFIX@', + '--disable-static', + '--enable-shared', + ], + verbose: true, +) + +libvorbis_dep = p.dependency('libvorbis') +meson.override_dependency('libvorbis', libvorbis_dep) diff --git a/scripts/libvpx/build.sh b/scripts/libvpx/build.sh new file mode 100644 index 0000000..afda111 --- /dev/null +++ b/scripts/libvpx/build.sh @@ -0,0 +1,15 @@ +#!/bin/bash + +set -e # exit immediately if a command exits with a non-zero status +set -u # treat unset variables as an error + +cd ${SRC_DIR} + +meson setup build \ + --cross-file ${PROJECT_DIR}/cross-files/${OS}-${ARCH}.ini \ + --prefix="${OUTPUT_DIR}" \ + -Ddefault_library=shared | + tee configure.log + +meson compile -C build +meson install -C build diff --git a/scripts/libx264/build.sh b/scripts/libx264/build.sh new file mode 100644 index 0000000..43f14f9 --- /dev/null +++ b/scripts/libx264/build.sh @@ -0,0 +1,20 @@ +#!/bin/bash + +set -e # exit immediately if a command exits with a non-zero status +set -u # treat unset variables as an error + +cd ${SRC_DIR} + +cp ${PROJECT_DIR}/scripts/libx264/meson.* . + +# Fix building for arm64 +sed -i '' 's/\-arch arm64//g' configure + +meson setup build \ + --cross-file ${PROJECT_DIR}/cross-files/${OS}-${ARCH}.ini \ + --prefix="${OUTPUT_DIR}" \ + -Ddefault_library=shared | + tee configure.log + +meson compile -C build libx264 +meson install -C build diff --git a/scripts/libx264/meson.build b/scripts/libx264/meson.build new file mode 100644 index 0000000..bcb26c5 --- /dev/null +++ b/scripts/libx264/meson.build @@ -0,0 +1,23 @@ +# https://mesonbuild.com/External-Project-module.html + +project('libx264', 'c') + +mod = import('unstable-external_project') + +c_args = get_option('c_args') + +p = mod.add_project('configure', + configure_options : [ + '--prefix=@PREFIX@', + '--disable-static', + '--enable-shared', + '--disable-cli' + ], + env: { + 'ASFLAGS': host_machine.cpu() == 'amd64' ? '' : ' '.join(c_args) + }, + verbose: true, +) + +libx264_dep = p.dependency('libx264') +meson.override_dependency('libx264', libx264_dep) diff --git a/scripts/mbedtls/build.sh b/scripts/mbedtls/build.sh new file mode 100644 index 0000000..3e76bfa --- /dev/null +++ b/scripts/mbedtls/build.sh @@ -0,0 +1,27 @@ +#!/bin/bash + +set -e # exit immediately if a command exits with a non-zero status +set -u # treat unset variables as an error + +cd ${SRC_DIR} + +# Extract c, c_args +export CC="$(python3 -c "$(grep "^c" ${PROJECT_DIR}/cross-files/${OS}-${ARCH}.ini); print(' '.join(c + c_args))")" + +make clean +make SHARED=1 no_test +make SHARED=1 DESTDIR="${OUTPUT_DIR}" install + +mkdir -p "${OUTPUT_DIR}/lib/pkgconfig" +PC="${OUTPUT_DIR}/lib/pkgconfig/mbedtls.pc" +echo "prefix=\"${OUTPUT_DIR}\"" > "${PC}" +echo "exec_prefix=\${prefix}" >> "${PC}" +echo "includedir=\"\${prefix}/include\"" >> "${PC}" +echo "libdir=\"\${prefix}/lib\"" >> "${PC}" +echo >> "${PC}" +echo "Name: mbedtls" >> "${PC}" +echo "Description: cryptographic library" >> "${PC}" +echo "Version: unknown" >> "${PC}" +echo "Libs: -L\"\${libdir}\" -lmbedtls -lmbedcrypto -lmbedx509" >> "${PC}" +#echo Libs.private: -lm -framework ApplicationServices +echo "Cflags: -I\"\${includedir}\"" >> "${PC}" From 9f6e99c403b07028114d16af17bb6b0e10fc4be0 Mon Sep 17 00:00:00 2001 From: Callum Moffat Date: Sat, 16 Sep 2023 01:30:13 -0400 Subject: [PATCH 02/14] Install nasm in CI --- .github/workflows/ci.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 1940e3c..85034e6 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -13,7 +13,7 @@ jobs: uses: actions/checkout@v3 - name: Install requirements - run: brew install go meson ninja + run: brew install go meson ninja nasm - name: Print tool versions run: make tool-versions From 0906626fdcc68b90bcd658495099d43881e5bbb6 Mon Sep 17 00:00:00 2001 From: birros Date: Sat, 16 Sep 2023 12:19:48 +0200 Subject: [PATCH 03/14] feat: remove `update-downloads-lock` Some packages can't (`fftools-ffi`) or aren't (`x264`) indexed on Homebrew, so we'll update them manually. --- Makefile | 17 ---- cmd/update-downloads-lock/main.go | 129 ------------------------------ downloads.lock | 1 - 3 files changed, 147 deletions(-) delete mode 100644 cmd/update-downloads-lock/main.go diff --git a/Makefile b/Makefile index a930591..ee8da15 100644 --- a/Makefile +++ b/Makefile @@ -1174,23 +1174,6 @@ ${OUTPUT_DIR}/libmpv-%.tar.gz: \ mv ${TARGET_OUTPUT_FILE} ${TARGET_FILE} rm -rf ${TARGET_TMP_DIR} -.PHONY: update-downloads-lock -update-downloads-lock: - $(eval DEPS= \ - pkg-config \ - mpv \ - uchardet \ - libass \ - freetype \ - harfbuzz \ - fribidi \ - ffmpeg \ - libxml2 \ - dav1d \ - ) - - go run cmd/update-downloads-lock/main.go ${DEPS} > downloads.lock - .PHONY: tool-versions tool-versions: go run cmd/tool-versions/main.go diff --git a/cmd/update-downloads-lock/main.go b/cmd/update-downloads-lock/main.go deleted file mode 100644 index 48f769d..0000000 --- a/cmd/update-downloads-lock/main.go +++ /dev/null @@ -1,129 +0,0 @@ -package main - -import ( - "bytes" - "encoding/json" - "fmt" - "log" - "os" - "os/exec" - "strings" - - "github.com/media-kit/libmpv-darwin-build/pkg/lock" - "gopkg.in/yaml.v3" -) - -func main() { - log.SetFlags(log.Lshortfile) - - packages := os.Args[1:] - lock, err := newLock(packages...) - if err != nil { - log.Fatal(err) - } - - text, err := marshalLock(lock) - if err != nil { - log.Fatal(err) - } - - fmt.Println(text) -} - -func newLock(packages ...string) (lock.Lock, error) { - var lock lock.Lock = lock.Lock{} - - for _, name := range packages { - dep, err := newDep(name) - if err != nil { - return nil, fmt.Errorf("newLock: %w", err) - } - - if name == "libressl" { - dep.URL = strings.Replace( - dep.URL, - "https://ftp.openbsd.org", - "https://cdn.openbsd.org", - 1, - ) - } - - lock[name] = *dep - } - - return lock, nil -} - -func newDep(packageName string) (*lock.Dep, error) { - info, err := brewInfo(packageName) - if err != nil { - return nil, fmt.Errorf("newDep: %w", err) - } - - dep := depFromBrewInfo(info) - return dep, nil -} - -func brewInfo(packageName string) (*brewInfoResponse, error) { - out, err := exec.Command("brew", "info", "--json", packageName).Output() - if err != nil { - return nil, fmt.Errorf("brewInfo: %w", err) - } - - var resp []brewInfoResponse - err = json.Unmarshal(out, &resp) - if err != nil { - return nil, fmt.Errorf("brewInfo: %w", err) - } - - if len(resp) != 1 { - return nil, fmt.Errorf("brewInfo: not found") - } - - info := resp[0] - - if info.Name != packageName { - return nil, fmt.Errorf( - "brewInfo: %s: %s != %s", packageName, packageName, info.Name, - ) - } - - return &info, nil -} - -type brewInfoResponse struct { - Name string `json:"name"` - Versions struct { - Stable string `json:"stable"` - } `json:"versions"` - Urls struct { - Stable struct { - URL string `json:"url"` - Checksum string `json:"checksum"` - } `json:"stable"` - } `json:"urls"` -} - -func depFromBrewInfo(info *brewInfoResponse) *lock.Dep { - return &lock.Dep{ - Version: info.Versions.Stable, - URL: info.Urls.Stable.URL, - Sha256: info.Urls.Stable.Checksum, - } -} - -func marshalLock(lock lock.Lock) (string, error) { - var buf bytes.Buffer - e := yaml.NewEncoder(&buf) - e.SetIndent(2) - - e.Encode(lock) - err := e.Close() - if err != nil { - return "", fmt.Errorf("marshalLock: %w", err) - } - - text := string(buf.Bytes()) - - return text, nil -} diff --git a/downloads.lock b/downloads.lock index 69fabd9..3e3bd1e 100644 --- a/downloads.lock +++ b/downloads.lock @@ -62,4 +62,3 @@ uchardet: version: 0.0.8 url: https://www.freedesktop.org/software/uchardet/releases/uchardet-0.0.8.tar.xz sha256: e97a60cfc00a1c147a674b097bb1422abd9fa78a2d9ce3f3fdcc2e78a34ac5f0 - From 2dee776af700719bd4afe00f5fff8fd352489e7d Mon Sep 17 00:00:00 2001 From: birros Date: Sat, 16 Sep 2023 12:30:17 +0200 Subject: [PATCH 04/14] feat(tool-versions): add nasm and python3 --- .tool-versions | 6 ++++-- pkg/tool-versions/tool-versions.go | 18 ++++++++++-------- 2 files changed, 14 insertions(+), 10 deletions(-) diff --git a/.tool-versions b/.tool-versions index 49f5635..b0f7437 100644 --- a/.tool-versions +++ b/.tool-versions @@ -1,8 +1,10 @@ clang 14.0.3 -cmake 3.27.4 +cmake 3.27.5 golang 1.21.0 -macos 13.5.1 +macos 13.5.2 make 3.81 meson 1.2.1 +nasm 2.16.01 ninja 1.11.1 +python3 3.11.5 xcode 14.3.1 diff --git a/pkg/tool-versions/tool-versions.go b/pkg/tool-versions/tool-versions.go index a704c32..1011f5c 100644 --- a/pkg/tool-versions/tool-versions.go +++ b/pkg/tool-versions/tool-versions.go @@ -24,14 +24,16 @@ func BuildToolVersions() (versions.VersionsMap, error) { } var toolVersionsCMDs = map[string]string{ - "clang": "clang --version | head -n1 | cut -d ' ' -f 4", - "cmake": "cmake --version | head -n1 | cut -d ' ' -f 3", - "golang": "go version | cut -d ' ' -f 3 | sed 's/go//g'", - "macos": "sw_vers -productVersion", - "make": "make --version | head -n1 | cut -d ' ' -f 3", - "meson": "meson --version", - "ninja": "ninja --version", - "xcode": "xcodebuild -version | head -n1 | cut -d ' ' -f 2", + "clang": "clang --version | head -n1 | cut -d ' ' -f 4", + "cmake": "cmake --version | head -n1 | cut -d ' ' -f 3", + "golang": "go version | cut -d ' ' -f 3 | sed 's/go//g'", + "macos": "sw_vers -productVersion", + "make": "make --version | head -n1 | cut -d ' ' -f 3", + "meson": "meson --version", + "nasm": "nasm -v | cut -d ' ' -f 3", + "ninja": "ninja --version", + "python3": "python3 --version | cut -d ' ' -f 2", + "xcode": "xcodebuild -version | head -n1 | cut -d ' ' -f 2", } func shellCommand(cmd string) (string, error) { From eb1eec0115ae45e5e5084425851e027b7b56e4af Mon Sep 17 00:00:00 2001 From: birros Date: Sat, 16 Sep 2023 17:13:41 +0200 Subject: [PATCH 05/14] docs: improve dependencies graph --- README.md | 160 ++++++++++++++++++++++++++++++++++-------------------- 1 file changed, 102 insertions(+), 58 deletions(-) diff --git a/README.md b/README.md index 8474800..7cc4763 100644 --- a/README.md +++ b/README.md @@ -60,6 +60,11 @@ libmpv-__---.tar.gz | **variant** | Usage context | audio, video | | **flavor** | Available decoders and encoders | default, full, encodersgpl | +Inclusion: + +- Variants: $audio \subset video$ +- Flavors: $audio \subset full \subset encodersgpl$ + ## Minimum versions @@ -105,37 +110,73 @@ libmpv-__---.tar.gz ```mermaid flowchart LR - -A(mpv) --> B(ffmpeg) -A(mpv) -.-> C(libass) -A(mpv) -.-> D(uchardet) -A(mpv) -.-> K(fftools-ffi) - -B -.-> H(dav1d) -B -.-> I(mbedtls) -B -.-> J(libxml2) -B -.-> L(libvpx) -B -.-> M(libx264) -B -.-> N(libvorbis) - -C --> E(freetype) -C --> F(harfbuzz) -C --> G(fribidi) - -N --> O(libogg) - -E -.-> F -K -.-> B + subgraph legend[Legend] + direction TB + subgraph links + P(node):::decoders -- "required" --> Q(node):::decoders + R(node):::decoders -. "optional" .-> S(node):::decoders + end + + subgraph variants + T(audio & video):::decoders + U{{video only}}:::decoders + end + + subgraph flavors + V(default, full):::decoders + W(encodersgpl):::encoders + end + end + + subgraph content[ ] + direction LR + A(mpv):::decoders -.-> B{{uchardet}}:::decoders + A -.-> C{{libass}}:::decoders + A --> D(ffmpeg):::decoders + + E(fftools-ffi):::encoders --> D + + %% libass + C --> F{{fribidi}}:::decoders + C --> G{{harfbuzz}}:::decoders + C --> H{{freetype}}:::decoders + H -.-> G + + %% ffmpeg + D -.-> I(mbedtls):::decoders + D -.-> J{{dav1d}}:::decoders + D -.-> K{{libxml2}}:::decoders + D -.-> L(libvorbis):::encoders + D -.-> M{{libvpx}}:::encoders + D -.-> N{{libx264}}:::encoders + L --> O(libogg):::encoders + end + + classDef decoders stroke:#888 + classDef encoders stroke:#14a,stroke-width:3px + classDef legend fill:transparent,stroke:#8882 + classDef content fill:transparent,stroke:transparent + classDef card fill:transparent,stroke:#888a + + legend:::legend + content:::content + links:::card + variants:::card + flavors:::card ``` +- [**mpv**](https://github.com/mpv-player/mpv): A free (as in freedom) media + player for the command line. It supports a wide variety of media file formats, + audio and video codecs, and subtitle types + - [**ffmpeg**](https://ffmpeg.org): A cross-platform solution for converting, streaming, and recording audio and video, with support for a wide range of codecs and formats -- [**fftools-ffi**](https://github.com/moffatman/fftools-ffi): FFmpeg's command-line - interface exposed as a shared library for FFI usage +- [**fftools-ffi**](https://github.com/moffatman/fftools-ffi): FFmpeg's + command-line interface exposed as a shared library for FFI usage -- **[libass](https://github.com/libass/libass)(optional)**: A library for rendering +- [**libass**](https://github.com/libass/libass): A library for rendering subtitles in videos, with support for advanced text formatting and positioning features (made optional with a patch) @@ -151,30 +192,31 @@ K -.-> B and laying out text in multiple languages and scripts, with support for advanced typography features such as ligatures and kerning -- **[dav1d](https://code.videolan.org/videolan/dav1d) (optional)**: A library - for cross-platform AV1 decoding +- [**dav1d**](https://code.videolan.org/videolan/dav1d): A library for + cross-platform AV1 decoding -- **[libogg](https://github.com/xiph/ogg) (optional)**: Reference implementation - of the Ogg media container +- [**libogg**](https://github.com/xiph/ogg): Reference implementation of the Ogg + media container -- **[libvorbis](https://github.com/xiph/vorbis) (optional)**: Reference implementation - of the Ogg Vorbis audio format +- [**libvorbis**](https://github.com/xiph/vorbis): Reference implementation of + the Ogg Vorbis audio format -- **[libvpx](https://gitlab.freedesktop.org/gstreamer/meson-ports/libvpx) (optional)**: Reference - implementation of the VP8 and VP9 video formats +- [**libvpx**](https://gitlab.freedesktop.org/gstreamer/meson-ports/libvpx): + Reference implementation of the VP8 and VP9 video formats -- **[libx264](https://www.videolan.org/developers/x264.html) (optional)**: Free software library - for encoding video streams into the H.264/MPEG-4 AVC compression format +- [**libx264**](https://www.videolan.org/developers/x264.html): Free software + library for encoding video streams into the H.264/MPEG-4 AVC compression + format -- **[mbedtls](https://www.libressl.org/) (optional)**: An open source, portable, - easy to use, readable and flexible TLS library +- [**mbedtls**](https://www.libressl.org/): An open source, portable, easy to + use, readable and flexible TLS library -- **[libxml2](http://xmlsoft.org/) (optional)**: A library for processing XML - data, used by ffmpeg to support the Dash protocol +- [**libxml2**](http://xmlsoft.org/): A library for processing XML data, used by + ffmpeg to support the Dash protocol -- **[uchardet](https://www.freedesktop.org/wiki/Software/uchardet/) - (optional)**: A C++ port of the Universal Character Encoding Detector (used by - Mozilla Firefox and Thunderbird) for detecting the encoding of input text +- [**uchardet**](https://www.freedesktop.org/wiki/Software/uchardet/): A C++ + port of the Universal Character Encoding Detector (used by Mozilla Firefox + and Thunderbird) for detecting the encoding of input text ## Commercial use @@ -195,21 +237,23 @@ K -.-> B ### Encoders-GPL flavor -| mpv | LGPL-2.1 (`-Dgpl=false`) | ✅ | -| ffmpeg | GPL-2.1 (`--enable-nonfree` omitted) | ❌ | -| libass | ISC | ✅ | -| freetype | FreeType | ✅ | -| harfbuzz | MIT | ✅ | -| fribidi | LGPL-2.1 | ✅ | -| mbedtls | Apache 2.0 | ✅ | -| uchardet | MPL-1.1, GPL-2, LGPL-2.1 | ✅ | -| libxml2 | MIT | ✅ | -| dav1d | BSD-2-clause | ✅ | -| fftools-ffi | LGPL-2.1 | ✅ | -| libx264 | GPL-2.0+ | ❌ | -| libvpx | BSD-3-clause | ✅ | -| libvorbis | BSD-3-clause | ✅ | -| libogg | BSD-3-clause | ✅ | +| Dependency | Licence | Commercial use | +| ----------- | ------------------------------------ | :------------: | +| mpv | LGPL-2.1 (`-Dgpl=false`) | ✅ | +| ffmpeg | GPL-2.1 (`--enable-nonfree` omitted) | ❌ | +| libass | ISC | ✅ | +| freetype | FreeType | ✅ | +| harfbuzz | MIT | ✅ | +| fribidi | LGPL-2.1 | ✅ | +| mbedtls | Apache 2.0 | ✅ | +| uchardet | MPL-1.1, GPL-2, LGPL-2.1 | ✅ | +| libxml2 | MIT | ✅ | +| dav1d | BSD-2-clause | ✅ | +| fftools-ffi | LGPL-2.1 | ✅ | +| libx264 | GPL-2.0+ | ❌ | +| libvpx | BSD-3-clause | ✅ | +| libvorbis | BSD-3-clause | ✅ | +| libogg | BSD-3-clause | ✅ | ## Notes @@ -217,8 +261,8 @@ K -.-> B future: - [**libbluray**](https://code.videolan.org/videolan/libbluray): A library for - reading and parsing Blu-ray discs, with support for advanced features such as - BD-J menus and seamless branching + reading and parsing Blu-ray discs, with support for advanced features such + as BD-J menus and seamless branching - [**libarchive**](https://github.com/libarchive/libarchive): A library for reading various archive formats, including tar and zip, with support for From 965054d1c6609f01bb3e6e2126cef7bd438d1699 Mon Sep 17 00:00:00 2001 From: birros Date: Sat, 16 Sep 2023 17:27:45 +0200 Subject: [PATCH 06/14] refactor(make): change dependencies order --- Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index ee8da15..261328d 100644 --- a/Makefile +++ b/Makefile @@ -362,8 +362,8 @@ ${INTERMEDIATE_DIR}/ffmpeg_%: \ ${PKGCONFIG_DIR} \ ${INTERMEDIATE_DIR}/mbedtls_$$(word 1,$$(subst -, ,$$*))-$$(word 2,$$(subst -, ,$$*)) \ $$(if $$(filter encodersgpl, $$(word 4,$$(subst -, ,$$*))), \ - ${INTERMEDIATE_DIR}/libogg_$$(word 1,$$(subst -, ,$$*))-$$(word 2,$$(subst -, ,$$*)) \ ${INTERMEDIATE_DIR}/libvorbis_$$(word 1,$$(subst -, ,$$*))-$$(word 2,$$(subst -, ,$$*)) \ + ${INTERMEDIATE_DIR}/libogg_$$(word 1,$$(subst -, ,$$*))-$$(word 2,$$(subst -, ,$$*)) \ ) \ $$(if $$(filter video, $$(word 3,$$(subst -, ,$$*))), \ ${INTERMEDIATE_DIR}/dav1d_$$(word 1,$$(subst -, ,$$*))-$$(word 2,$$(subst -, ,$$*)) \ @@ -972,8 +972,8 @@ ${INTERMEDIATE_DIR}/libs-arch_%: \ ${INTERMEDIATE_DIR}/mbedtls_$$(word 1,$$(subst -, ,$$*))-$$(word 2,$$(subst -, ,$$*)) \ $$(if $$(filter encodersgpl, $$(word 4,$$(subst -, ,$$*))), \ ${INTERMEDIATE_DIR}/fftools-ffi_$$(word 1,$$(subst -, ,$$*))-$$(word 2,$$(subst -, ,$$*))-$$(word 3,$$(subst -, ,$$*)) \ - ${INTERMEDIATE_DIR}/libogg_$$(word 1,$$(subst -, ,$$*))-$$(word 2,$$(subst -, ,$$*)) \ ${INTERMEDIATE_DIR}/libvorbis_$$(word 1,$$(subst -, ,$$*))-$$(word 2,$$(subst -, ,$$*)) \ + ${INTERMEDIATE_DIR}/libogg_$$(word 1,$$(subst -, ,$$*))-$$(word 2,$$(subst -, ,$$*)) \ ) \ $$(if $$(filter video, $$(word 3,$$(subst -, ,$$*))), \ ${INTERMEDIATE_DIR}/dav1d_$$(word 1,$$(subst -, ,$$*))-$$(word 2,$$(subst -, ,$$*)) \ From ce8eaf6373235895836b8aa7f35e0e5545199da4 Mon Sep 17 00:00:00 2001 From: birros Date: Sat, 16 Sep 2023 17:34:40 +0200 Subject: [PATCH 07/14] ci: add encodersgpl flavor builds --- .github/workflows/ci.yaml | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 85034e6..83eb4a5 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -41,40 +41,58 @@ jobs: VERSION=${{ steps.version.outputs.version }} make build/output/libmpv-libs_${VERSION}_ios-arm64-audio-default.tar.gz make build/output/libmpv-libs_${VERSION}_ios-arm64-audio-full.tar.gz + make build/output/libmpv-libs_${VERSION}_ios-arm64-audio-encodersgpl.tar.gz make build/output/libmpv-libs_${VERSION}_ios-arm64-video-default.tar.gz make build/output/libmpv-libs_${VERSION}_ios-arm64-video-full.tar.gz + make build/output/libmpv-libs_${VERSION}_ios-arm64-video-encodersgpl.tar.gz make build/output/libmpv-libs_${VERSION}_iossimulator-amd64-audio-default.tar.gz make build/output/libmpv-libs_${VERSION}_iossimulator-amd64-audio-full.tar.gz + make build/output/libmpv-libs_${VERSION}_iossimulator-amd64-audio-encodersgpl.tar.gz make build/output/libmpv-libs_${VERSION}_iossimulator-amd64-video-default.tar.gz make build/output/libmpv-libs_${VERSION}_iossimulator-amd64-video-full.tar.gz + make build/output/libmpv-libs_${VERSION}_iossimulator-amd64-video-encodersgpl.tar.gz make build/output/libmpv-libs_${VERSION}_iossimulator-arm64-audio-default.tar.gz make build/output/libmpv-libs_${VERSION}_iossimulator-arm64-audio-full.tar.gz + make build/output/libmpv-libs_${VERSION}_iossimulator-arm64-audio-encodersgpl.tar.gz make build/output/libmpv-libs_${VERSION}_iossimulator-arm64-video-default.tar.gz make build/output/libmpv-libs_${VERSION}_iossimulator-arm64-video-full.tar.gz + make build/output/libmpv-libs_${VERSION}_iossimulator-arm64-video-encodersgpl.tar.gz make build/output/libmpv-libs_${VERSION}_iossimulator-universal-audio-default.tar.gz make build/output/libmpv-libs_${VERSION}_iossimulator-universal-audio-full.tar.gz + make build/output/libmpv-libs_${VERSION}_iossimulator-universal-audio-encodersgpl.tar.gz make build/output/libmpv-libs_${VERSION}_iossimulator-universal-video-default.tar.gz make build/output/libmpv-libs_${VERSION}_iossimulator-universal-video-full.tar.gz + make build/output/libmpv-libs_${VERSION}_iossimulator-universal-video-encodersgpl.tar.gz make build/output/libmpv-libs_${VERSION}_macos-amd64-audio-default.tar.gz make build/output/libmpv-libs_${VERSION}_macos-amd64-audio-full.tar.gz + make build/output/libmpv-libs_${VERSION}_macos-amd64-audio-encodersgpl.tar.gz make build/output/libmpv-libs_${VERSION}_macos-amd64-video-default.tar.gz make build/output/libmpv-libs_${VERSION}_macos-amd64-video-full.tar.gz + make build/output/libmpv-libs_${VERSION}_macos-amd64-video-encodersgpl.tar.gz make build/output/libmpv-libs_${VERSION}_macos-arm64-audio-default.tar.gz make build/output/libmpv-libs_${VERSION}_macos-arm64-audio-full.tar.gz + make build/output/libmpv-libs_${VERSION}_macos-arm64-audio-encodersgpl.tar.gz make build/output/libmpv-libs_${VERSION}_macos-arm64-video-default.tar.gz make build/output/libmpv-libs_${VERSION}_macos-arm64-video-full.tar.gz + make build/output/libmpv-libs_${VERSION}_macos-arm64-video-encodersgpl.tar.gz make build/output/libmpv-libs_${VERSION}_macos-universal-audio-default.tar.gz make build/output/libmpv-libs_${VERSION}_macos-universal-audio-full.tar.gz + make build/output/libmpv-libs_${VERSION}_macos-universal-audio-encodersgpl.tar.gz make build/output/libmpv-libs_${VERSION}_macos-universal-video-default.tar.gz make build/output/libmpv-libs_${VERSION}_macos-universal-video-full.tar.gz + make build/output/libmpv-libs_${VERSION}_macos-universal-video-encodersgpl.tar.gz make build/output/libmpv-xcframeworks_${VERSION}_ios-universal-audio-default.tar.gz make build/output/libmpv-xcframeworks_${VERSION}_ios-universal-audio-full.tar.gz + make build/output/libmpv-xcframeworks_${VERSION}_ios-universal-audio-encodersgpl.tar.gz make build/output/libmpv-xcframeworks_${VERSION}_ios-universal-video-default.tar.gz make build/output/libmpv-xcframeworks_${VERSION}_ios-universal-video-full.tar.gz + make build/output/libmpv-xcframeworks_${VERSION}_ios-universal-video-encodersgpl.tar.gz make build/output/libmpv-xcframeworks_${VERSION}_macos-universal-audio-default.tar.gz make build/output/libmpv-xcframeworks_${VERSION}_macos-universal-audio-full.tar.gz + make build/output/libmpv-xcframeworks_${VERSION}_macos-universal-audio-encodersgpl.tar.gz make build/output/libmpv-xcframeworks_${VERSION}_macos-universal-video-default.tar.gz make build/output/libmpv-xcframeworks_${VERSION}_macos-universal-video-full.tar.gz + make build/output/libmpv-xcframeworks_${VERSION}_macos-universal-video-encodersgpl.tar.gz make build/output/debug.zip - name: Upload artifacts From f5efd0807346dee08e9989099da8b37c394ac034 Mon Sep 17 00:00:00 2001 From: birros Date: Sat, 16 Sep 2023 17:40:04 +0200 Subject: [PATCH 08/14] refactor: rename encodersgpl flavor to encoders --- .github/workflows/ci.yaml | 36 ++++++++++++++-------------- LICENSE.txt | 2 +- Makefile | 46 ++++++++++++++++++------------------ README.md | 42 ++++++++++++++++---------------- scripts/ffmpeg/meson.build | 10 ++++---- scripts/ffmpeg/meson.options | 2 +- 6 files changed, 69 insertions(+), 69 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 83eb4a5..8b64706 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -41,58 +41,58 @@ jobs: VERSION=${{ steps.version.outputs.version }} make build/output/libmpv-libs_${VERSION}_ios-arm64-audio-default.tar.gz make build/output/libmpv-libs_${VERSION}_ios-arm64-audio-full.tar.gz - make build/output/libmpv-libs_${VERSION}_ios-arm64-audio-encodersgpl.tar.gz + make build/output/libmpv-libs_${VERSION}_ios-arm64-audio-encoders.tar.gz make build/output/libmpv-libs_${VERSION}_ios-arm64-video-default.tar.gz make build/output/libmpv-libs_${VERSION}_ios-arm64-video-full.tar.gz - make build/output/libmpv-libs_${VERSION}_ios-arm64-video-encodersgpl.tar.gz + make build/output/libmpv-libs_${VERSION}_ios-arm64-video-encoders.tar.gz make build/output/libmpv-libs_${VERSION}_iossimulator-amd64-audio-default.tar.gz make build/output/libmpv-libs_${VERSION}_iossimulator-amd64-audio-full.tar.gz - make build/output/libmpv-libs_${VERSION}_iossimulator-amd64-audio-encodersgpl.tar.gz + make build/output/libmpv-libs_${VERSION}_iossimulator-amd64-audio-encoders.tar.gz make build/output/libmpv-libs_${VERSION}_iossimulator-amd64-video-default.tar.gz make build/output/libmpv-libs_${VERSION}_iossimulator-amd64-video-full.tar.gz - make build/output/libmpv-libs_${VERSION}_iossimulator-amd64-video-encodersgpl.tar.gz + make build/output/libmpv-libs_${VERSION}_iossimulator-amd64-video-encoders.tar.gz make build/output/libmpv-libs_${VERSION}_iossimulator-arm64-audio-default.tar.gz make build/output/libmpv-libs_${VERSION}_iossimulator-arm64-audio-full.tar.gz - make build/output/libmpv-libs_${VERSION}_iossimulator-arm64-audio-encodersgpl.tar.gz + make build/output/libmpv-libs_${VERSION}_iossimulator-arm64-audio-encoders.tar.gz make build/output/libmpv-libs_${VERSION}_iossimulator-arm64-video-default.tar.gz make build/output/libmpv-libs_${VERSION}_iossimulator-arm64-video-full.tar.gz - make build/output/libmpv-libs_${VERSION}_iossimulator-arm64-video-encodersgpl.tar.gz + make build/output/libmpv-libs_${VERSION}_iossimulator-arm64-video-encoders.tar.gz make build/output/libmpv-libs_${VERSION}_iossimulator-universal-audio-default.tar.gz make build/output/libmpv-libs_${VERSION}_iossimulator-universal-audio-full.tar.gz - make build/output/libmpv-libs_${VERSION}_iossimulator-universal-audio-encodersgpl.tar.gz + make build/output/libmpv-libs_${VERSION}_iossimulator-universal-audio-encoders.tar.gz make build/output/libmpv-libs_${VERSION}_iossimulator-universal-video-default.tar.gz make build/output/libmpv-libs_${VERSION}_iossimulator-universal-video-full.tar.gz - make build/output/libmpv-libs_${VERSION}_iossimulator-universal-video-encodersgpl.tar.gz + make build/output/libmpv-libs_${VERSION}_iossimulator-universal-video-encoders.tar.gz make build/output/libmpv-libs_${VERSION}_macos-amd64-audio-default.tar.gz make build/output/libmpv-libs_${VERSION}_macos-amd64-audio-full.tar.gz - make build/output/libmpv-libs_${VERSION}_macos-amd64-audio-encodersgpl.tar.gz + make build/output/libmpv-libs_${VERSION}_macos-amd64-audio-encoders.tar.gz make build/output/libmpv-libs_${VERSION}_macos-amd64-video-default.tar.gz make build/output/libmpv-libs_${VERSION}_macos-amd64-video-full.tar.gz - make build/output/libmpv-libs_${VERSION}_macos-amd64-video-encodersgpl.tar.gz + make build/output/libmpv-libs_${VERSION}_macos-amd64-video-encoders.tar.gz make build/output/libmpv-libs_${VERSION}_macos-arm64-audio-default.tar.gz make build/output/libmpv-libs_${VERSION}_macos-arm64-audio-full.tar.gz - make build/output/libmpv-libs_${VERSION}_macos-arm64-audio-encodersgpl.tar.gz + make build/output/libmpv-libs_${VERSION}_macos-arm64-audio-encoders.tar.gz make build/output/libmpv-libs_${VERSION}_macos-arm64-video-default.tar.gz make build/output/libmpv-libs_${VERSION}_macos-arm64-video-full.tar.gz - make build/output/libmpv-libs_${VERSION}_macos-arm64-video-encodersgpl.tar.gz + make build/output/libmpv-libs_${VERSION}_macos-arm64-video-encoders.tar.gz make build/output/libmpv-libs_${VERSION}_macos-universal-audio-default.tar.gz make build/output/libmpv-libs_${VERSION}_macos-universal-audio-full.tar.gz - make build/output/libmpv-libs_${VERSION}_macos-universal-audio-encodersgpl.tar.gz + make build/output/libmpv-libs_${VERSION}_macos-universal-audio-encoders.tar.gz make build/output/libmpv-libs_${VERSION}_macos-universal-video-default.tar.gz make build/output/libmpv-libs_${VERSION}_macos-universal-video-full.tar.gz - make build/output/libmpv-libs_${VERSION}_macos-universal-video-encodersgpl.tar.gz + make build/output/libmpv-libs_${VERSION}_macos-universal-video-encoders.tar.gz make build/output/libmpv-xcframeworks_${VERSION}_ios-universal-audio-default.tar.gz make build/output/libmpv-xcframeworks_${VERSION}_ios-universal-audio-full.tar.gz - make build/output/libmpv-xcframeworks_${VERSION}_ios-universal-audio-encodersgpl.tar.gz + make build/output/libmpv-xcframeworks_${VERSION}_ios-universal-audio-encoders.tar.gz make build/output/libmpv-xcframeworks_${VERSION}_ios-universal-video-default.tar.gz make build/output/libmpv-xcframeworks_${VERSION}_ios-universal-video-full.tar.gz - make build/output/libmpv-xcframeworks_${VERSION}_ios-universal-video-encodersgpl.tar.gz + make build/output/libmpv-xcframeworks_${VERSION}_ios-universal-video-encoders.tar.gz make build/output/libmpv-xcframeworks_${VERSION}_macos-universal-audio-default.tar.gz make build/output/libmpv-xcframeworks_${VERSION}_macos-universal-audio-full.tar.gz - make build/output/libmpv-xcframeworks_${VERSION}_macos-universal-audio-encodersgpl.tar.gz + make build/output/libmpv-xcframeworks_${VERSION}_macos-universal-audio-encoders.tar.gz make build/output/libmpv-xcframeworks_${VERSION}_macos-universal-video-default.tar.gz make build/output/libmpv-xcframeworks_${VERSION}_macos-universal-video-full.tar.gz - make build/output/libmpv-xcframeworks_${VERSION}_macos-universal-video-encodersgpl.tar.gz + make build/output/libmpv-xcframeworks_${VERSION}_macos-universal-video-encoders.tar.gz make build/output/debug.zip - name: Upload artifacts diff --git a/LICENSE.txt b/LICENSE.txt index 21bdbf1..2de2e3d 100644 --- a/LICENSE.txt +++ b/LICENSE.txt @@ -22,7 +22,7 @@ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -For the "encodersgpl" flavor, the following license applies: +For the "encoders" flavor, the following license applies: Copyright (C) 2023 moffatman diff --git a/Makefile b/Makefile index 261328d..3fb0ed9 100644 --- a/Makefile +++ b/Makefile @@ -56,65 +56,65 @@ all: \ ${OUTPUT_DIR}/debug.zip \ ${OUTPUT_DIR}/libmpv-libs_${VERSION}_ios-arm64-audio-default.tar.gz \ ${OUTPUT_DIR}/libmpv-libs_${VERSION}_ios-arm64-audio-full.tar.gz \ - ${OUTPUT_DIR}/libmpv-libs_${VERSION}_ios-arm64-audio-encodersgpl.tar.gz \ + ${OUTPUT_DIR}/libmpv-libs_${VERSION}_ios-arm64-audio-encoders.tar.gz \ ${OUTPUT_DIR}/libmpv-libs_${VERSION}_ios-arm64-video-default.tar.gz \ ${OUTPUT_DIR}/libmpv-libs_${VERSION}_ios-arm64-video-full.tar.gz \ - ${OUTPUT_DIR}/libmpv-libs_${VERSION}_ios-arm64-video-encodersgpl.tar.gz \ + ${OUTPUT_DIR}/libmpv-libs_${VERSION}_ios-arm64-video-encoders.tar.gz \ ${OUTPUT_DIR}/libmpv-libs_${VERSION}_iossimulator-amd64-audio-default.tar.gz \ ${OUTPUT_DIR}/libmpv-libs_${VERSION}_iossimulator-amd64-audio-full.tar.gz \ - ${OUTPUT_DIR}/libmpv-libs_${VERSION}_iossimulator-amd64-audio-encodersgpl.tar.gz \ + ${OUTPUT_DIR}/libmpv-libs_${VERSION}_iossimulator-amd64-audio-encoders.tar.gz \ ${OUTPUT_DIR}/libmpv-libs_${VERSION}_iossimulator-amd64-video-default.tar.gz \ ${OUTPUT_DIR}/libmpv-libs_${VERSION}_iossimulator-amd64-video-full.tar.gz \ - ${OUTPUT_DIR}/libmpv-libs_${VERSION}_iossimulator-amd64-video-encodersgpl.tar.gz \ + ${OUTPUT_DIR}/libmpv-libs_${VERSION}_iossimulator-amd64-video-encoders.tar.gz \ ${OUTPUT_DIR}/libmpv-libs_${VERSION}_iossimulator-arm64-audio-default.tar.gz \ ${OUTPUT_DIR}/libmpv-libs_${VERSION}_iossimulator-arm64-audio-full.tar.gz \ - ${OUTPUT_DIR}/libmpv-libs_${VERSION}_iossimulator-arm64-audio-encodersgpl.tar.gz \ + ${OUTPUT_DIR}/libmpv-libs_${VERSION}_iossimulator-arm64-audio-encoders.tar.gz \ ${OUTPUT_DIR}/libmpv-libs_${VERSION}_iossimulator-arm64-video-default.tar.gz \ ${OUTPUT_DIR}/libmpv-libs_${VERSION}_iossimulator-arm64-video-full.tar.gz \ - ${OUTPUT_DIR}/libmpv-libs_${VERSION}_iossimulator-arm64-video-encodersgpl.tar.gz \ + ${OUTPUT_DIR}/libmpv-libs_${VERSION}_iossimulator-arm64-video-encoders.tar.gz \ ${OUTPUT_DIR}/libmpv-libs_${VERSION}_iossimulator-universal-audio-default.tar.gz \ ${OUTPUT_DIR}/libmpv-libs_${VERSION}_iossimulator-universal-audio-full.tar.gz \ - ${OUTPUT_DIR}/libmpv-libs_${VERSION}_iossimulator-universal-audio-encodersgpl.tar.gz \ + ${OUTPUT_DIR}/libmpv-libs_${VERSION}_iossimulator-universal-audio-encoders.tar.gz \ ${OUTPUT_DIR}/libmpv-libs_${VERSION}_iossimulator-universal-video-default.tar.gz \ ${OUTPUT_DIR}/libmpv-libs_${VERSION}_iossimulator-universal-video-full.tar.gz \ - ${OUTPUT_DIR}/libmpv-libs_${VERSION}_iossimulator-universal-video-encodersgpl.tar.gz \ + ${OUTPUT_DIR}/libmpv-libs_${VERSION}_iossimulator-universal-video-encoders.tar.gz \ ${OUTPUT_DIR}/libmpv-libs_${VERSION}_macos-amd64-audio-default.tar.gz \ ${OUTPUT_DIR}/libmpv-libs_${VERSION}_macos-amd64-audio-full.tar.gz \ - ${OUTPUT_DIR}/libmpv-libs_${VERSION}_macos-amd64-audio-encodersgpl.tar.gz \ + ${OUTPUT_DIR}/libmpv-libs_${VERSION}_macos-amd64-audio-encoders.tar.gz \ ${OUTPUT_DIR}/libmpv-libs_${VERSION}_macos-amd64-video-default.tar.gz \ ${OUTPUT_DIR}/libmpv-libs_${VERSION}_macos-amd64-video-full.tar.gz \ - ${OUTPUT_DIR}/libmpv-libs_${VERSION}_macos-amd64-video-encodersgpl.tar.gz \ + ${OUTPUT_DIR}/libmpv-libs_${VERSION}_macos-amd64-video-encoders.tar.gz \ ${OUTPUT_DIR}/libmpv-libs_${VERSION}_macos-arm64-audio-default.tar.gz \ ${OUTPUT_DIR}/libmpv-libs_${VERSION}_macos-arm64-audio-full.tar.gz \ - ${OUTPUT_DIR}/libmpv-libs_${VERSION}_macos-arm64-audio-encodersgpl.tar.gz \ + ${OUTPUT_DIR}/libmpv-libs_${VERSION}_macos-arm64-audio-encoders.tar.gz \ ${OUTPUT_DIR}/libmpv-libs_${VERSION}_macos-arm64-video-default.tar.gz \ ${OUTPUT_DIR}/libmpv-libs_${VERSION}_macos-arm64-video-full.tar.gz \ - ${OUTPUT_DIR}/libmpv-libs_${VERSION}_macos-arm64-video-encodersgpl.tar.gz \ + ${OUTPUT_DIR}/libmpv-libs_${VERSION}_macos-arm64-video-encoders.tar.gz \ ${OUTPUT_DIR}/libmpv-libs_${VERSION}_macos-universal-audio-default.tar.gz \ ${OUTPUT_DIR}/libmpv-libs_${VERSION}_macos-universal-audio-full.tar.gz \ - ${OUTPUT_DIR}/libmpv-libs_${VERSION}_macos-universal-audio-encodersgpl.tar.gz \ + ${OUTPUT_DIR}/libmpv-libs_${VERSION}_macos-universal-audio-encoders.tar.gz \ ${OUTPUT_DIR}/libmpv-libs_${VERSION}_macos-universal-video-default.tar.gz \ ${OUTPUT_DIR}/libmpv-libs_${VERSION}_macos-universal-video-full.tar.gz \ - ${OUTPUT_DIR}/libmpv-libs_${VERSION}_macos-universal-video-encodersgpl.tar.gz \ + ${OUTPUT_DIR}/libmpv-libs_${VERSION}_macos-universal-video-encoders.tar.gz \ ${OUTPUT_DIR}/libmpv-xcframeworks_${VERSION}_ios-universal-audio-default.tar.gz \ ${OUTPUT_DIR}/libmpv-xcframeworks_${VERSION}_ios-universal-audio-full.tar.gz \ - ${OUTPUT_DIR}/libmpv-xcframeworks_${VERSION}_ios-universal-audio-encodersgpl.tar.gz \ + ${OUTPUT_DIR}/libmpv-xcframeworks_${VERSION}_ios-universal-audio-encoders.tar.gz \ ${OUTPUT_DIR}/libmpv-xcframeworks_${VERSION}_ios-universal-video-default.tar.gz \ ${OUTPUT_DIR}/libmpv-xcframeworks_${VERSION}_ios-universal-video-full.tar.gz \ - ${OUTPUT_DIR}/libmpv-xcframeworks_${VERSION}_ios-universal-video-encodersgpl.tar.gz \ + ${OUTPUT_DIR}/libmpv-xcframeworks_${VERSION}_ios-universal-video-encoders.tar.gz \ ${OUTPUT_DIR}/libmpv-xcframeworks_${VERSION}_macos-universal-audio-default.tar.gz \ ${OUTPUT_DIR}/libmpv-xcframeworks_${VERSION}_macos-universal-audio-full.tar.gz \ - ${OUTPUT_DIR}/libmpv-xcframeworks_${VERSION}_macos-universal-audio-encodersgpl.tar.gz \ + ${OUTPUT_DIR}/libmpv-xcframeworks_${VERSION}_macos-universal-audio-encoders.tar.gz \ ${OUTPUT_DIR}/libmpv-xcframeworks_${VERSION}_macos-universal-video-default.tar.gz \ ${OUTPUT_DIR}/libmpv-xcframeworks_${VERSION}_macos-universal-video-full.tar.gz \ - ${OUTPUT_DIR}/libmpv-xcframeworks_${VERSION}_macos-universal-video-encodersgpl.tar.gz + ${OUTPUT_DIR}/libmpv-xcframeworks_${VERSION}_macos-universal-video-encoders.tar.gz ${OUTPUT_DIR}/debug.zip: \ ${INTERMEDIATE_DIR}/tool-versions.lock \ $$(foreach OS,ios iossimulator macos, \ $$(foreach ARCH,amd64 arm64, \ $$(foreach VARIANT,audio video, \ - $$(foreach FLAVOR,default full encodersgpl, \ + $$(foreach FLAVOR,default full encoders, \ $$(if $$(filter-out ios-amd64, $${OS}-$${ARCH}), \ ${INTERMEDIATE_DIR}/ffmpeg_$${OS}-$${ARCH}-$${VARIANT}-$${FLAVOR} \ ${INTERMEDIATE_DIR}/fftools-ffi_$${OS}-$${ARCH}-$${VARIANT}-$${FLAVOR} \ @@ -361,14 +361,14 @@ ${INTERMEDIATE_DIR}/ffmpeg_%: \ ${DOWNLOADS_DIR} \ ${PKGCONFIG_DIR} \ ${INTERMEDIATE_DIR}/mbedtls_$$(word 1,$$(subst -, ,$$*))-$$(word 2,$$(subst -, ,$$*)) \ - $$(if $$(filter encodersgpl, $$(word 4,$$(subst -, ,$$*))), \ + $$(if $$(filter encoders, $$(word 4,$$(subst -, ,$$*))), \ ${INTERMEDIATE_DIR}/libvorbis_$$(word 1,$$(subst -, ,$$*))-$$(word 2,$$(subst -, ,$$*)) \ ${INTERMEDIATE_DIR}/libogg_$$(word 1,$$(subst -, ,$$*))-$$(word 2,$$(subst -, ,$$*)) \ ) \ $$(if $$(filter video, $$(word 3,$$(subst -, ,$$*))), \ ${INTERMEDIATE_DIR}/dav1d_$$(word 1,$$(subst -, ,$$*))-$$(word 2,$$(subst -, ,$$*)) \ ${INTERMEDIATE_DIR}/libxml2_$$(word 1,$$(subst -, ,$$*))-$$(word 2,$$(subst -, ,$$*)) \ - $$(if $$(filter encodersgpl, $$(word 4,$$(subst -, ,$$*))), \ + $$(if $$(filter encoders, $$(word 4,$$(subst -, ,$$*))), \ ${INTERMEDIATE_DIR}/libvpx_$$(word 1,$$(subst -, ,$$*))-$$(word 2,$$(subst -, ,$$*)) \ ${INTERMEDIATE_DIR}/libx264_$$(word 1,$$(subst -, ,$$*))-$$(word 2,$$(subst -, ,$$*)) \ ) \ @@ -970,7 +970,7 @@ ${INTERMEDIATE_DIR}/libs-arch_%: \ ${INTERMEDIATE_DIR}/mpv_$$(word 1,$$(subst -, ,$$*))-$$(word 2,$$(subst -, ,$$*))-$$(word 3,$$(subst -, ,$$*)) \ ${INTERMEDIATE_DIR}/ffmpeg_$$(word 1,$$(subst -, ,$$*))-$$(word 2,$$(subst -, ,$$*))-$$(word 3,$$(subst -, ,$$*))-$$(word 4,$$(subst -, ,$$*)) \ ${INTERMEDIATE_DIR}/mbedtls_$$(word 1,$$(subst -, ,$$*))-$$(word 2,$$(subst -, ,$$*)) \ - $$(if $$(filter encodersgpl, $$(word 4,$$(subst -, ,$$*))), \ + $$(if $$(filter encoders, $$(word 4,$$(subst -, ,$$*))), \ ${INTERMEDIATE_DIR}/fftools-ffi_$$(word 1,$$(subst -, ,$$*))-$$(word 2,$$(subst -, ,$$*))-$$(word 3,$$(subst -, ,$$*)) \ ${INTERMEDIATE_DIR}/libvorbis_$$(word 1,$$(subst -, ,$$*))-$$(word 2,$$(subst -, ,$$*)) \ ${INTERMEDIATE_DIR}/libogg_$$(word 1,$$(subst -, ,$$*))-$$(word 2,$$(subst -, ,$$*)) \ @@ -983,7 +983,7 @@ ${INTERMEDIATE_DIR}/libs-arch_%: \ ${INTERMEDIATE_DIR}/harfbuzz_$$(word 1,$$(subst -, ,$$*))-$$(word 2,$$(subst -, ,$$*)) \ ${INTERMEDIATE_DIR}/fribidi_$$(word 1,$$(subst -, ,$$*))-$$(word 2,$$(subst -, ,$$*)) \ ${INTERMEDIATE_DIR}/freetype_$$(word 1,$$(subst -, ,$$*))-$$(word 2,$$(subst -, ,$$*)) \ - $$(if $$(filter encodersgpl, $$(word 4,$$(subst -, ,$$*))), \ + $$(if $$(filter encoders, $$(word 4,$$(subst -, ,$$*))), \ ${INTERMEDIATE_DIR}/libvpx_$$(word 1,$$(subst -, ,$$*))-$$(word 2,$$(subst -, ,$$*)) \ ${INTERMEDIATE_DIR}/libx264_$$(word 1,$$(subst -, ,$$*))-$$(word 2,$$(subst -, ,$$*)) \ ) \ diff --git a/README.md b/README.md index 7cc4763..9965082 100644 --- a/README.md +++ b/README.md @@ -15,34 +15,34 @@ $ VERSION=v0.0.1 make $ ls build/output libmpv-libs_v0.0.1_ios-arm64-audio-default.tar.gz libmpv-libs_v0.0.1_ios-arm64-audio-full.tar.gz -libmpv-libs_v0.0.1_ios-arm64-audio-encodersgpl.tar.gz +libmpv-libs_v0.0.1_ios-arm64-audio-encoders.tar.gz libmpv-libs_v0.0.1_ios-arm64-video-default.tar.gz libmpv-libs_v0.0.1_ios-arm64-video-full.tar.gz -libmpv-libs_v0.0.1_ios-arm64-video-encodersgpl.tar.gz +libmpv-libs_v0.0.1_ios-arm64-video-encoders.tar.gz libmpv-libs_v0.0.1_iossimulator-universal-audio-default.tar.gz libmpv-libs_v0.0.1_iossimulator-universal-audio-full.tar.gz -libmpv-libs_v0.0.1_iossimulator-universal-audio-encodersgpl.tar.gz +libmpv-libs_v0.0.1_iossimulator-universal-audio-encoders.tar.gz libmpv-libs_v0.0.1_iossimulator-universal-video-default.tar.gz libmpv-libs_v0.0.1_iossimulator-universal-video-full.tar.gz -libmpv-libs_v0.0.1_iossimulator-universal-video-encodersgpl.tar.gz +libmpv-libs_v0.0.1_iossimulator-universal-video-encoders.tar.gz libmpv-libs_v0.0.1_macos-universal-audio-default.tar.gz libmpv-libs_v0.0.1_macos-universal-audio-full.tar.gz -libmpv-libs_v0.0.1_macos-universal-audio-encodersgpl.tar.gz +libmpv-libs_v0.0.1_macos-universal-audio-encoders.tar.gz libmpv-libs_v0.0.1_macos-universal-video-default.tar.gz libmpv-libs_v0.0.1_macos-universal-video-full.tar.gz -libmpv-libs_v0.0.1_macos-universal-video-encodersgpl.tar.gz +libmpv-libs_v0.0.1_macos-universal-video-encoders.tar.gz libmpv-xcframeworks_v0.0.1_ios-universal-audio-default.tar.gz libmpv-xcframeworks_v0.0.1_ios-universal-audio-full.tar.gz -libmpv-xcframeworks_v0.0.1_ios-universal-audio-encodersgpl.tar.gz +libmpv-xcframeworks_v0.0.1_ios-universal-audio-encoders.tar.gz libmpv-xcframeworks_v0.0.1_ios-universal-video-default.tar.gz libmpv-xcframeworks_v0.0.1_ios-universal-video-full.tar.gz -libmpv-xcframeworks_v0.0.1_ios-universal-video-encodersgpl.tar.gz +libmpv-xcframeworks_v0.0.1_ios-universal-video-encoders.tar.gz libmpv-xcframeworks_v0.0.1_macos-universal-audio-default.tar.gz libmpv-xcframeworks_v0.0.1_macos-universal-audio-full.tar.gz -libmpv-xcframeworks_v0.0.1_macos-universal-audio-encodersgpl.tar.gz +libmpv-xcframeworks_v0.0.1_macos-universal-audio-encoders.tar.gz libmpv-xcframeworks_v0.0.1_macos-universal-video-default.tar.gz libmpv-xcframeworks_v0.0.1_macos-universal-video-full.tar.gz -libmpv-xcframeworks_v0.0.1_macos-universal-video-encodersgpl.tar.gz +libmpv-xcframeworks_v0.0.1_macos-universal-video-encoders.tar.gz ``` ## Naming convention @@ -51,19 +51,19 @@ libmpv-xcframeworks_v0.0.1_macos-universal-video-encodersgpl.tar.gz libmpv-__---.tar.gz ``` -| Component | Notes | Value | -| ----------- | ------------------------------- | -------------------------- | -| **format** | Output format of built files | libs, xcframeworks | -| **version** | Semantic version | v0.0.1, … | -| **os** | Operating system | ios, iossimulator, macos | -| **arch** | Architecture | arm64, amd64, universal | -| **variant** | Usage context | audio, video | -| **flavor** | Available decoders and encoders | default, full, encodersgpl | +| Component | Notes | Value | +| ----------- | ------------------------------- | ------------------------ | +| **format** | Output format of built files | libs, xcframeworks | +| **version** | Semantic version | v0.0.1, … | +| **os** | Operating system | ios, iossimulator, macos | +| **arch** | Architecture | arm64, amd64, universal | +| **variant** | Usage context | audio, video | +| **flavor** | Available decoders and encoders | default, full, encoders | Inclusion: - Variants: $audio \subset video$ -- Flavors: $audio \subset full \subset encodersgpl$ +- Flavors: $audio \subset full \subset encoders$ ## Minimum versions @@ -124,7 +124,7 @@ flowchart LR subgraph flavors V(default, full):::decoders - W(encodersgpl):::encoders + W(encoders):::encoders end end @@ -235,7 +235,7 @@ flowchart LR | libxml2 | MIT | ✅ | | dav1d | BSD-2-clause | ✅ | -### Encoders-GPL flavor +### Encoders flavor | Dependency | Licence | Commercial use | | ----------- | ------------------------------------ | :------------: | diff --git a/scripts/ffmpeg/meson.build b/scripts/ffmpeg/meson.build index aa3831e..f816822 100644 --- a/scripts/ffmpeg/meson.build +++ b/scripts/ffmpeg/meson.build @@ -283,7 +283,7 @@ video_full_options = [ '--enable-decoder=h264', ] -audio_encodersgpl_options = [ +audio_encoders_options = [ '--enable-encoders', '--enable-muxers', '--enable-filters', @@ -291,7 +291,7 @@ audio_encodersgpl_options = [ # TODO: If audio_encoders is going to exist as its own package, be smarter about what encoders to include ] -video_encodersgpl_options = [ +video_encoders_options = [ '--enable-libvpx', '--enable-libx264', '--enable-gpl' @@ -318,12 +318,12 @@ elif flavor == 'full' if variant == 'video' options += video_full_options endif -elif flavor == 'encodersgpl' +elif flavor == 'encoders' options += audio_full_options - options += audio_encodersgpl_options + options += audio_encoders_options if variant == 'video' options += video_full_options - options += video_encodersgpl_options + options += video_encoders_options endif endif diff --git a/scripts/ffmpeg/meson.options b/scripts/ffmpeg/meson.options index a48d1db..e819373 100644 --- a/scripts/ffmpeg/meson.options +++ b/scripts/ffmpeg/meson.options @@ -1,2 +1,2 @@ option('variant', type : 'combo', choices : ['audio', 'video']) -option('flavor', type : 'combo', choices : ['default', 'full', 'encodersgpl']) +option('flavor', type : 'combo', choices : ['default', 'full', 'encoders']) From 190cb0159c3ee4ef89e87980c49fcb93b31aeadb Mon Sep 17 00:00:00 2001 From: birros Date: Sat, 16 Sep 2023 19:17:58 +0200 Subject: [PATCH 09/14] refactor(mbedtls): use meson.build --- Makefile | 2 +- scripts/mbedtls/build.sh | 40 +++++++++++++++++++---------------- scripts/mbedtls/mbedtls.pc.in | 10 +++++++++ scripts/mbedtls/meson.build | 19 +++++++++++++++++ 4 files changed, 52 insertions(+), 19 deletions(-) create mode 100644 scripts/mbedtls/mbedtls.pc.in create mode 100644 scripts/mbedtls/meson.build diff --git a/Makefile b/Makefile index 3fb0ed9..85ee47e 100644 --- a/Makefile +++ b/Makefile @@ -302,7 +302,7 @@ ${INTERMEDIATE_DIR}/mbedtls_%: \ env -i \ PATH=${SANDBOX_PATH} \ ARCHIVE_FILE=${ARCHIVE_FILE} \ - TARGET_DIR=${TARGET_SRC_DIR} \ + TARGET_DIR=${TARGET_SRC_DIR}/subprojects/${TARGET_PKGNAME} \ sh ${PROJECT_DIR}/scripts/extract/build.sh env -i \ diff --git a/scripts/mbedtls/build.sh b/scripts/mbedtls/build.sh index 3e76bfa..05efd94 100644 --- a/scripts/mbedtls/build.sh +++ b/scripts/mbedtls/build.sh @@ -5,23 +5,27 @@ set -u # treat unset variables as an error cd ${SRC_DIR} -# Extract c, c_args -export CC="$(python3 -c "$(grep "^c" ${PROJECT_DIR}/cross-files/${OS}-${ARCH}.ini); print(' '.join(c + c_args))")" +# cross build with meson +cp ${PROJECT_DIR}/scripts/mbedtls/meson.build ./meson.build +meson setup build_cross \ + --cross-file ${PROJECT_DIR}/cross-files/${OS}-${ARCH}.ini \ + --prefix="${OUTPUT_DIR}" +meson compile -C build_cross mbedtls -make clean -make SHARED=1 no_test -make SHARED=1 DESTDIR="${OUTPUT_DIR}" install +# manually create output +## create output layout +mkdir -p dist/{include,lib} +mkdir -p dist/include/{mbedtls,psa} +mkdir -p dist/lib/pkgconfig +## install headers +cp -R subprojects/mbedtls/include/mbedtls/*.h dist/include/mbedtls +cp -R subprojects/mbedtls/include/psa/*.h dist/include/psa +## install libs +find . -type f -name '*.dylib' -exec sh -c 'mv {} dist/lib' \; +## install pkgconfig file +cp ${PROJECT_DIR}/scripts/mbedtls/mbedtls.pc.in dist/lib/pkgconfig/mbedtls.pc +sed -i '' 's|${PREFIX}|'${OUTPUT_DIR}'|g' dist/lib/pkgconfig/mbedtls.pc -mkdir -p "${OUTPUT_DIR}/lib/pkgconfig" -PC="${OUTPUT_DIR}/lib/pkgconfig/mbedtls.pc" -echo "prefix=\"${OUTPUT_DIR}\"" > "${PC}" -echo "exec_prefix=\${prefix}" >> "${PC}" -echo "includedir=\"\${prefix}/include\"" >> "${PC}" -echo "libdir=\"\${prefix}/lib\"" >> "${PC}" -echo >> "${PC}" -echo "Name: mbedtls" >> "${PC}" -echo "Description: cryptographic library" >> "${PC}" -echo "Version: unknown" >> "${PC}" -echo "Libs: -L\"\${libdir}\" -lmbedtls -lmbedcrypto -lmbedx509" >> "${PC}" -#echo Libs.private: -lm -framework ApplicationServices -echo "Cflags: -I\"\${includedir}\"" >> "${PC}" +# manual install +mkdir -p "${OUTPUT_DIR}" +cp -R dist/* "${OUTPUT_DIR}"/ diff --git a/scripts/mbedtls/mbedtls.pc.in b/scripts/mbedtls/mbedtls.pc.in new file mode 100644 index 0000000..fede917 --- /dev/null +++ b/scripts/mbedtls/mbedtls.pc.in @@ -0,0 +1,10 @@ +prefix="${PREFIX}" +exec_prefix=${prefix} +includedir="${prefix}/include" +libdir="${prefix}/lib" + +Name: mbedtls +Description: cryptographic library +Version: unknown +Libs: -L"${libdir}" -lmbedtls -lmbedcrypto -lmbedx509 +Cflags: -I"${includedir}" diff --git a/scripts/mbedtls/meson.build b/scripts/mbedtls/meson.build new file mode 100644 index 0000000..387eb8e --- /dev/null +++ b/scripts/mbedtls/meson.build @@ -0,0 +1,19 @@ +# https://mesonbuild.com/External-Project-module.html + +project('mbedtls', 'c') + +cmake = import('cmake') + +options = cmake.subproject_options() +options.add_cmake_defines({ + 'USE_STATIC_MBEDTLS_LIBRARY': false, + 'USE_SHARED_MBEDTLS_LIBRARY': true, + 'LINK_WITH_PTHREAD': true, +}) + +mbedtls = cmake.subproject('mbedtls', + options: options, +) + +mbedtls_dep = mbedtls.dependency('mbedtls') +meson.override_dependency('mbedtls', mbedtls_dep) From c88cfcb90bbae483cf887f40fd346e3f756a52e3 Mon Sep 17 00:00:00 2001 From: birros Date: Sat, 16 Sep 2023 20:54:25 +0200 Subject: [PATCH 10/14] docs(uchardet): add todo about double build --- scripts/uchardet/build.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/scripts/uchardet/build.sh b/scripts/uchardet/build.sh index 5dd0087..c407333 100644 --- a/scripts/uchardet/build.sh +++ b/scripts/uchardet/build.sh @@ -12,6 +12,7 @@ meson setup build_cross \ --prefix="${OUTPUT_DIR}" meson compile -C build_cross uchardet +# TODO: don't build twice, see what's done for mbetls # native build with cmake cmake ./subprojects/uchardet \ -B build_native \ From 8831261faeffed948eac6209ef3c82cbb47993b3 Mon Sep 17 00:00:00 2001 From: birros Date: Sat, 16 Sep 2023 20:54:55 +0200 Subject: [PATCH 11/14] fix(cmake): add sys_root property --- cross-files/ios-arm64.ini | 3 +++ cross-files/iossimulator-amd64.ini | 3 +++ cross-files/iossimulator-arm64.ini | 3 +++ cross-files/macos-amd64.ini | 3 +++ cross-files/macos-arm64.ini | 3 +++ scripts/mbedtls/meson.build | 1 + scripts/uchardet/meson.build | 1 + 7 files changed, 17 insertions(+) diff --git a/cross-files/ios-arm64.ini b/cross-files/ios-arm64.ini index 9be13c2..92e3559 100644 --- a/cross-files/ios-arm64.ini +++ b/cross-files/ios-arm64.ini @@ -23,3 +23,6 @@ c_link_args = ['-arch', 'arm64', '-isysroot', '/Applications/Xcode.app/Contents/ cpp_link_args = ['-arch', 'arm64', '-isysroot', '/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk', '-miphoneos-version-min=9.0'] objc_link_args = ['-arch', 'arm64', '-isysroot', '/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk', '-miphoneos-version-min=9.0'] objcpp_link_args = ['-arch', 'arm64', '-isysroot', '/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk', '-miphoneos-version-min=9.0'] + +[properties] +sys_root = '/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk' diff --git a/cross-files/iossimulator-amd64.ini b/cross-files/iossimulator-amd64.ini index e296b78..a0fba12 100644 --- a/cross-files/iossimulator-amd64.ini +++ b/cross-files/iossimulator-amd64.ini @@ -23,3 +23,6 @@ c_link_args = ['-arch', 'x86_64', '-isysroot', '/Applications/Xcode.app/Contents cpp_link_args = ['-arch', 'x86_64', '-isysroot', '/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk', '-miphoneos-version-min=9.0'] objc_link_args = ['-arch', 'x86_64', '-isysroot', '/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk', '-miphoneos-version-min=9.0'] objcpp_link_args = ['-arch', 'x86_64', '-isysroot', '/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk', '-miphoneos-version-min=9.0'] + +[properties] +sys_root = '/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk' diff --git a/cross-files/iossimulator-arm64.ini b/cross-files/iossimulator-arm64.ini index f269130..da16e8c 100644 --- a/cross-files/iossimulator-arm64.ini +++ b/cross-files/iossimulator-arm64.ini @@ -23,3 +23,6 @@ c_link_args = ['-arch', 'arm64', '-isysroot', '/Applications/Xcode.app/Contents/ cpp_link_args = ['-arch', 'arm64', '-isysroot', '/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk', '-miphoneos-version-min=12.0'] objc_link_args = ['-arch', 'arm64', '-isysroot', '/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk', '-miphoneos-version-min=12.0'] objcpp_link_args = ['-arch', 'arm64', '-isysroot', '/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk', '-miphoneos-version-min=12.0'] + +[properties] +sys_root = '/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk' diff --git a/cross-files/macos-amd64.ini b/cross-files/macos-amd64.ini index e7a0de4..fdc82ff 100644 --- a/cross-files/macos-amd64.ini +++ b/cross-files/macos-amd64.ini @@ -23,3 +23,6 @@ c_link_args = ['-arch', 'x86_64', '-isysroot', '/Applications/Xcode.app/Contents cpp_link_args = ['-arch', 'x86_64', '-isysroot', '/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk', '-mmacosx-version-min=10.9'] objc_link_args = ['-arch', 'x86_64', '-isysroot', '/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk', '-mmacosx-version-min=10.9'] objcpp_link_args = ['-arch', 'x86_64', '-isysroot', '/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk', '-mmacosx-version-min=10.9'] + +[properties] +sys_root = '/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk' diff --git a/cross-files/macos-arm64.ini b/cross-files/macos-arm64.ini index d1ae4b8..9664405 100644 --- a/cross-files/macos-arm64.ini +++ b/cross-files/macos-arm64.ini @@ -23,3 +23,6 @@ c_link_args = ['-arch', 'arm64', '-isysroot', '/Applications/Xcode.app/Contents/ cpp_link_args = ['-arch', 'arm64', '-isysroot', '/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk', '-mmacosx-version-min=10.9'] objc_link_args = ['-arch', 'arm64', '-isysroot', '/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk', '-mmacosx-version-min=10.9'] objcpp_link_args = ['-arch', 'arm64', '-isysroot', '/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk', '-mmacosx-version-min=10.9'] + +[properties] +sys_root = '/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk' diff --git a/scripts/mbedtls/meson.build b/scripts/mbedtls/meson.build index 387eb8e..235bded 100644 --- a/scripts/mbedtls/meson.build +++ b/scripts/mbedtls/meson.build @@ -6,6 +6,7 @@ cmake = import('cmake') options = cmake.subproject_options() options.add_cmake_defines({ + 'CMAKE_OSX_SYSROOT': meson.get_cross_property('sys_root'), 'USE_STATIC_MBEDTLS_LIBRARY': false, 'USE_SHARED_MBEDTLS_LIBRARY': true, 'LINK_WITH_PTHREAD': true, diff --git a/scripts/uchardet/meson.build b/scripts/uchardet/meson.build index 28684d4..2d66586 100644 --- a/scripts/uchardet/meson.build +++ b/scripts/uchardet/meson.build @@ -6,6 +6,7 @@ cmake = import('cmake') options = cmake.subproject_options() options.add_cmake_defines({ + 'CMAKE_OSX_SYSROOT': meson.get_cross_property('sys_root'), 'BUILD_STATIC': false, }) From 0995f3cdb6513ab5a652fe428d8ff700b1cc1cf8 Mon Sep 17 00:00:00 2001 From: birros Date: Sat, 16 Sep 2023 21:23:44 +0200 Subject: [PATCH 12/14] fix(cmake): fix sys_root arch --- scripts/mbedtls/meson.build | 8 ++++++++ scripts/uchardet/meson.build | 8 ++++++++ 2 files changed, 16 insertions(+) diff --git a/scripts/mbedtls/meson.build b/scripts/mbedtls/meson.build index 235bded..edf036c 100644 --- a/scripts/mbedtls/meson.build +++ b/scripts/mbedtls/meson.build @@ -4,8 +4,16 @@ project('mbedtls', 'c') cmake = import('cmake') +cpu = host_machine.cpu() +if cpu == 'amd64' + arch = 'x86_64' +elif cpu == 'arm64' + arch = 'arm64' +endif + options = cmake.subproject_options() options.add_cmake_defines({ + 'CMAKE_OSX_ARCHITECTURES': arch, 'CMAKE_OSX_SYSROOT': meson.get_cross_property('sys_root'), 'USE_STATIC_MBEDTLS_LIBRARY': false, 'USE_SHARED_MBEDTLS_LIBRARY': true, diff --git a/scripts/uchardet/meson.build b/scripts/uchardet/meson.build index 2d66586..b4a9939 100644 --- a/scripts/uchardet/meson.build +++ b/scripts/uchardet/meson.build @@ -4,8 +4,16 @@ project('uchardet', 'c', 'cpp') cmake = import('cmake') +cpu = host_machine.cpu() +if cpu == 'amd64' + arch = 'x86_64' +elif cpu == 'arm64' + arch = 'arm64' +endif + options = cmake.subproject_options() options.add_cmake_defines({ + 'CMAKE_OSX_ARCHITECTURES': arch, 'CMAKE_OSX_SYSROOT': meson.get_cross_property('sys_root'), 'BUILD_STATIC': false, }) From 0b780c51075648824baa489e58cec0e4308fd7b8 Mon Sep 17 00:00:00 2001 From: birros Date: Sat, 16 Sep 2023 23:50:45 +0200 Subject: [PATCH 13/14] fix(cmake): fix sysroot collision The `sys_root` property in cross-files prevents `ffmpeg` from finding `mbedtls`. --- cross-files/ios-arm64.ini | 2 +- cross-files/iossimulator-amd64.ini | 2 +- cross-files/iossimulator-arm64.ini | 2 +- cross-files/macos-amd64.ini | 2 +- cross-files/macos-arm64.ini | 2 +- scripts/mbedtls/meson.build | 2 +- scripts/uchardet/meson.build | 2 +- 7 files changed, 7 insertions(+), 7 deletions(-) diff --git a/cross-files/ios-arm64.ini b/cross-files/ios-arm64.ini index 92e3559..e9b146c 100644 --- a/cross-files/ios-arm64.ini +++ b/cross-files/ios-arm64.ini @@ -25,4 +25,4 @@ objc_link_args = ['-arch', 'arm64', '-isysroot', '/Applications/Xcode.app/Conten objcpp_link_args = ['-arch', 'arm64', '-isysroot', '/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk', '-miphoneos-version-min=9.0'] [properties] -sys_root = '/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk' +cmake_osx_sysroot = '/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk' diff --git a/cross-files/iossimulator-amd64.ini b/cross-files/iossimulator-amd64.ini index a0fba12..462c831 100644 --- a/cross-files/iossimulator-amd64.ini +++ b/cross-files/iossimulator-amd64.ini @@ -25,4 +25,4 @@ objc_link_args = ['-arch', 'x86_64', '-isysroot', '/Applications/Xcode.app/Conte objcpp_link_args = ['-arch', 'x86_64', '-isysroot', '/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk', '-miphoneos-version-min=9.0'] [properties] -sys_root = '/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk' +cmake_osx_sysroot = '/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk' diff --git a/cross-files/iossimulator-arm64.ini b/cross-files/iossimulator-arm64.ini index da16e8c..a4bd31b 100644 --- a/cross-files/iossimulator-arm64.ini +++ b/cross-files/iossimulator-arm64.ini @@ -25,4 +25,4 @@ objc_link_args = ['-arch', 'arm64', '-isysroot', '/Applications/Xcode.app/Conten objcpp_link_args = ['-arch', 'arm64', '-isysroot', '/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk', '-miphoneos-version-min=12.0'] [properties] -sys_root = '/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk' +cmake_osx_sysroot = '/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk' diff --git a/cross-files/macos-amd64.ini b/cross-files/macos-amd64.ini index fdc82ff..833b5de 100644 --- a/cross-files/macos-amd64.ini +++ b/cross-files/macos-amd64.ini @@ -25,4 +25,4 @@ objc_link_args = ['-arch', 'x86_64', '-isysroot', '/Applications/Xcode.app/Conte objcpp_link_args = ['-arch', 'x86_64', '-isysroot', '/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk', '-mmacosx-version-min=10.9'] [properties] -sys_root = '/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk' +cmake_osx_sysroot = '/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk' diff --git a/cross-files/macos-arm64.ini b/cross-files/macos-arm64.ini index 9664405..3617015 100644 --- a/cross-files/macos-arm64.ini +++ b/cross-files/macos-arm64.ini @@ -25,4 +25,4 @@ objc_link_args = ['-arch', 'arm64', '-isysroot', '/Applications/Xcode.app/Conten objcpp_link_args = ['-arch', 'arm64', '-isysroot', '/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk', '-mmacosx-version-min=10.9'] [properties] -sys_root = '/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk' +cmake_osx_sysroot = '/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk' diff --git a/scripts/mbedtls/meson.build b/scripts/mbedtls/meson.build index edf036c..640c8d1 100644 --- a/scripts/mbedtls/meson.build +++ b/scripts/mbedtls/meson.build @@ -14,7 +14,7 @@ endif options = cmake.subproject_options() options.add_cmake_defines({ 'CMAKE_OSX_ARCHITECTURES': arch, - 'CMAKE_OSX_SYSROOT': meson.get_cross_property('sys_root'), + 'CMAKE_OSX_SYSROOT': meson.get_cross_property('cmake_osx_sysroot'), 'USE_STATIC_MBEDTLS_LIBRARY': false, 'USE_SHARED_MBEDTLS_LIBRARY': true, 'LINK_WITH_PTHREAD': true, diff --git a/scripts/uchardet/meson.build b/scripts/uchardet/meson.build index b4a9939..a7ca18a 100644 --- a/scripts/uchardet/meson.build +++ b/scripts/uchardet/meson.build @@ -14,7 +14,7 @@ endif options = cmake.subproject_options() options.add_cmake_defines({ 'CMAKE_OSX_ARCHITECTURES': arch, - 'CMAKE_OSX_SYSROOT': meson.get_cross_property('sys_root'), + 'CMAKE_OSX_SYSROOT': meson.get_cross_property('cmake_osx_sysroot'), 'BUILD_STATIC': false, }) From 5896a830273a85e9d5acbfc450cb13f1f4b6b58f Mon Sep 17 00:00:00 2001 From: birros Date: Sat, 16 Sep 2023 23:58:51 +0200 Subject: [PATCH 14/14] Revert "refactor: rename encodersgpl flavor to encoders" This reverts commit f5efd0807346dee08e9989099da8b37c394ac034. --- .github/workflows/ci.yaml | 36 ++++++++++++++-------------- LICENSE.txt | 2 +- Makefile | 46 ++++++++++++++++++------------------ README.md | 42 ++++++++++++++++---------------- scripts/ffmpeg/meson.build | 10 ++++---- scripts/ffmpeg/meson.options | 2 +- 6 files changed, 69 insertions(+), 69 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 8b64706..83eb4a5 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -41,58 +41,58 @@ jobs: VERSION=${{ steps.version.outputs.version }} make build/output/libmpv-libs_${VERSION}_ios-arm64-audio-default.tar.gz make build/output/libmpv-libs_${VERSION}_ios-arm64-audio-full.tar.gz - make build/output/libmpv-libs_${VERSION}_ios-arm64-audio-encoders.tar.gz + make build/output/libmpv-libs_${VERSION}_ios-arm64-audio-encodersgpl.tar.gz make build/output/libmpv-libs_${VERSION}_ios-arm64-video-default.tar.gz make build/output/libmpv-libs_${VERSION}_ios-arm64-video-full.tar.gz - make build/output/libmpv-libs_${VERSION}_ios-arm64-video-encoders.tar.gz + make build/output/libmpv-libs_${VERSION}_ios-arm64-video-encodersgpl.tar.gz make build/output/libmpv-libs_${VERSION}_iossimulator-amd64-audio-default.tar.gz make build/output/libmpv-libs_${VERSION}_iossimulator-amd64-audio-full.tar.gz - make build/output/libmpv-libs_${VERSION}_iossimulator-amd64-audio-encoders.tar.gz + make build/output/libmpv-libs_${VERSION}_iossimulator-amd64-audio-encodersgpl.tar.gz make build/output/libmpv-libs_${VERSION}_iossimulator-amd64-video-default.tar.gz make build/output/libmpv-libs_${VERSION}_iossimulator-amd64-video-full.tar.gz - make build/output/libmpv-libs_${VERSION}_iossimulator-amd64-video-encoders.tar.gz + make build/output/libmpv-libs_${VERSION}_iossimulator-amd64-video-encodersgpl.tar.gz make build/output/libmpv-libs_${VERSION}_iossimulator-arm64-audio-default.tar.gz make build/output/libmpv-libs_${VERSION}_iossimulator-arm64-audio-full.tar.gz - make build/output/libmpv-libs_${VERSION}_iossimulator-arm64-audio-encoders.tar.gz + make build/output/libmpv-libs_${VERSION}_iossimulator-arm64-audio-encodersgpl.tar.gz make build/output/libmpv-libs_${VERSION}_iossimulator-arm64-video-default.tar.gz make build/output/libmpv-libs_${VERSION}_iossimulator-arm64-video-full.tar.gz - make build/output/libmpv-libs_${VERSION}_iossimulator-arm64-video-encoders.tar.gz + make build/output/libmpv-libs_${VERSION}_iossimulator-arm64-video-encodersgpl.tar.gz make build/output/libmpv-libs_${VERSION}_iossimulator-universal-audio-default.tar.gz make build/output/libmpv-libs_${VERSION}_iossimulator-universal-audio-full.tar.gz - make build/output/libmpv-libs_${VERSION}_iossimulator-universal-audio-encoders.tar.gz + make build/output/libmpv-libs_${VERSION}_iossimulator-universal-audio-encodersgpl.tar.gz make build/output/libmpv-libs_${VERSION}_iossimulator-universal-video-default.tar.gz make build/output/libmpv-libs_${VERSION}_iossimulator-universal-video-full.tar.gz - make build/output/libmpv-libs_${VERSION}_iossimulator-universal-video-encoders.tar.gz + make build/output/libmpv-libs_${VERSION}_iossimulator-universal-video-encodersgpl.tar.gz make build/output/libmpv-libs_${VERSION}_macos-amd64-audio-default.tar.gz make build/output/libmpv-libs_${VERSION}_macos-amd64-audio-full.tar.gz - make build/output/libmpv-libs_${VERSION}_macos-amd64-audio-encoders.tar.gz + make build/output/libmpv-libs_${VERSION}_macos-amd64-audio-encodersgpl.tar.gz make build/output/libmpv-libs_${VERSION}_macos-amd64-video-default.tar.gz make build/output/libmpv-libs_${VERSION}_macos-amd64-video-full.tar.gz - make build/output/libmpv-libs_${VERSION}_macos-amd64-video-encoders.tar.gz + make build/output/libmpv-libs_${VERSION}_macos-amd64-video-encodersgpl.tar.gz make build/output/libmpv-libs_${VERSION}_macos-arm64-audio-default.tar.gz make build/output/libmpv-libs_${VERSION}_macos-arm64-audio-full.tar.gz - make build/output/libmpv-libs_${VERSION}_macos-arm64-audio-encoders.tar.gz + make build/output/libmpv-libs_${VERSION}_macos-arm64-audio-encodersgpl.tar.gz make build/output/libmpv-libs_${VERSION}_macos-arm64-video-default.tar.gz make build/output/libmpv-libs_${VERSION}_macos-arm64-video-full.tar.gz - make build/output/libmpv-libs_${VERSION}_macos-arm64-video-encoders.tar.gz + make build/output/libmpv-libs_${VERSION}_macos-arm64-video-encodersgpl.tar.gz make build/output/libmpv-libs_${VERSION}_macos-universal-audio-default.tar.gz make build/output/libmpv-libs_${VERSION}_macos-universal-audio-full.tar.gz - make build/output/libmpv-libs_${VERSION}_macos-universal-audio-encoders.tar.gz + make build/output/libmpv-libs_${VERSION}_macos-universal-audio-encodersgpl.tar.gz make build/output/libmpv-libs_${VERSION}_macos-universal-video-default.tar.gz make build/output/libmpv-libs_${VERSION}_macos-universal-video-full.tar.gz - make build/output/libmpv-libs_${VERSION}_macos-universal-video-encoders.tar.gz + make build/output/libmpv-libs_${VERSION}_macos-universal-video-encodersgpl.tar.gz make build/output/libmpv-xcframeworks_${VERSION}_ios-universal-audio-default.tar.gz make build/output/libmpv-xcframeworks_${VERSION}_ios-universal-audio-full.tar.gz - make build/output/libmpv-xcframeworks_${VERSION}_ios-universal-audio-encoders.tar.gz + make build/output/libmpv-xcframeworks_${VERSION}_ios-universal-audio-encodersgpl.tar.gz make build/output/libmpv-xcframeworks_${VERSION}_ios-universal-video-default.tar.gz make build/output/libmpv-xcframeworks_${VERSION}_ios-universal-video-full.tar.gz - make build/output/libmpv-xcframeworks_${VERSION}_ios-universal-video-encoders.tar.gz + make build/output/libmpv-xcframeworks_${VERSION}_ios-universal-video-encodersgpl.tar.gz make build/output/libmpv-xcframeworks_${VERSION}_macos-universal-audio-default.tar.gz make build/output/libmpv-xcframeworks_${VERSION}_macos-universal-audio-full.tar.gz - make build/output/libmpv-xcframeworks_${VERSION}_macos-universal-audio-encoders.tar.gz + make build/output/libmpv-xcframeworks_${VERSION}_macos-universal-audio-encodersgpl.tar.gz make build/output/libmpv-xcframeworks_${VERSION}_macos-universal-video-default.tar.gz make build/output/libmpv-xcframeworks_${VERSION}_macos-universal-video-full.tar.gz - make build/output/libmpv-xcframeworks_${VERSION}_macos-universal-video-encoders.tar.gz + make build/output/libmpv-xcframeworks_${VERSION}_macos-universal-video-encodersgpl.tar.gz make build/output/debug.zip - name: Upload artifacts diff --git a/LICENSE.txt b/LICENSE.txt index 2de2e3d..21bdbf1 100644 --- a/LICENSE.txt +++ b/LICENSE.txt @@ -22,7 +22,7 @@ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -For the "encoders" flavor, the following license applies: +For the "encodersgpl" flavor, the following license applies: Copyright (C) 2023 moffatman diff --git a/Makefile b/Makefile index 85ee47e..b96190c 100644 --- a/Makefile +++ b/Makefile @@ -56,65 +56,65 @@ all: \ ${OUTPUT_DIR}/debug.zip \ ${OUTPUT_DIR}/libmpv-libs_${VERSION}_ios-arm64-audio-default.tar.gz \ ${OUTPUT_DIR}/libmpv-libs_${VERSION}_ios-arm64-audio-full.tar.gz \ - ${OUTPUT_DIR}/libmpv-libs_${VERSION}_ios-arm64-audio-encoders.tar.gz \ + ${OUTPUT_DIR}/libmpv-libs_${VERSION}_ios-arm64-audio-encodersgpl.tar.gz \ ${OUTPUT_DIR}/libmpv-libs_${VERSION}_ios-arm64-video-default.tar.gz \ ${OUTPUT_DIR}/libmpv-libs_${VERSION}_ios-arm64-video-full.tar.gz \ - ${OUTPUT_DIR}/libmpv-libs_${VERSION}_ios-arm64-video-encoders.tar.gz \ + ${OUTPUT_DIR}/libmpv-libs_${VERSION}_ios-arm64-video-encodersgpl.tar.gz \ ${OUTPUT_DIR}/libmpv-libs_${VERSION}_iossimulator-amd64-audio-default.tar.gz \ ${OUTPUT_DIR}/libmpv-libs_${VERSION}_iossimulator-amd64-audio-full.tar.gz \ - ${OUTPUT_DIR}/libmpv-libs_${VERSION}_iossimulator-amd64-audio-encoders.tar.gz \ + ${OUTPUT_DIR}/libmpv-libs_${VERSION}_iossimulator-amd64-audio-encodersgpl.tar.gz \ ${OUTPUT_DIR}/libmpv-libs_${VERSION}_iossimulator-amd64-video-default.tar.gz \ ${OUTPUT_DIR}/libmpv-libs_${VERSION}_iossimulator-amd64-video-full.tar.gz \ - ${OUTPUT_DIR}/libmpv-libs_${VERSION}_iossimulator-amd64-video-encoders.tar.gz \ + ${OUTPUT_DIR}/libmpv-libs_${VERSION}_iossimulator-amd64-video-encodersgpl.tar.gz \ ${OUTPUT_DIR}/libmpv-libs_${VERSION}_iossimulator-arm64-audio-default.tar.gz \ ${OUTPUT_DIR}/libmpv-libs_${VERSION}_iossimulator-arm64-audio-full.tar.gz \ - ${OUTPUT_DIR}/libmpv-libs_${VERSION}_iossimulator-arm64-audio-encoders.tar.gz \ + ${OUTPUT_DIR}/libmpv-libs_${VERSION}_iossimulator-arm64-audio-encodersgpl.tar.gz \ ${OUTPUT_DIR}/libmpv-libs_${VERSION}_iossimulator-arm64-video-default.tar.gz \ ${OUTPUT_DIR}/libmpv-libs_${VERSION}_iossimulator-arm64-video-full.tar.gz \ - ${OUTPUT_DIR}/libmpv-libs_${VERSION}_iossimulator-arm64-video-encoders.tar.gz \ + ${OUTPUT_DIR}/libmpv-libs_${VERSION}_iossimulator-arm64-video-encodersgpl.tar.gz \ ${OUTPUT_DIR}/libmpv-libs_${VERSION}_iossimulator-universal-audio-default.tar.gz \ ${OUTPUT_DIR}/libmpv-libs_${VERSION}_iossimulator-universal-audio-full.tar.gz \ - ${OUTPUT_DIR}/libmpv-libs_${VERSION}_iossimulator-universal-audio-encoders.tar.gz \ + ${OUTPUT_DIR}/libmpv-libs_${VERSION}_iossimulator-universal-audio-encodersgpl.tar.gz \ ${OUTPUT_DIR}/libmpv-libs_${VERSION}_iossimulator-universal-video-default.tar.gz \ ${OUTPUT_DIR}/libmpv-libs_${VERSION}_iossimulator-universal-video-full.tar.gz \ - ${OUTPUT_DIR}/libmpv-libs_${VERSION}_iossimulator-universal-video-encoders.tar.gz \ + ${OUTPUT_DIR}/libmpv-libs_${VERSION}_iossimulator-universal-video-encodersgpl.tar.gz \ ${OUTPUT_DIR}/libmpv-libs_${VERSION}_macos-amd64-audio-default.tar.gz \ ${OUTPUT_DIR}/libmpv-libs_${VERSION}_macos-amd64-audio-full.tar.gz \ - ${OUTPUT_DIR}/libmpv-libs_${VERSION}_macos-amd64-audio-encoders.tar.gz \ + ${OUTPUT_DIR}/libmpv-libs_${VERSION}_macos-amd64-audio-encodersgpl.tar.gz \ ${OUTPUT_DIR}/libmpv-libs_${VERSION}_macos-amd64-video-default.tar.gz \ ${OUTPUT_DIR}/libmpv-libs_${VERSION}_macos-amd64-video-full.tar.gz \ - ${OUTPUT_DIR}/libmpv-libs_${VERSION}_macos-amd64-video-encoders.tar.gz \ + ${OUTPUT_DIR}/libmpv-libs_${VERSION}_macos-amd64-video-encodersgpl.tar.gz \ ${OUTPUT_DIR}/libmpv-libs_${VERSION}_macos-arm64-audio-default.tar.gz \ ${OUTPUT_DIR}/libmpv-libs_${VERSION}_macos-arm64-audio-full.tar.gz \ - ${OUTPUT_DIR}/libmpv-libs_${VERSION}_macos-arm64-audio-encoders.tar.gz \ + ${OUTPUT_DIR}/libmpv-libs_${VERSION}_macos-arm64-audio-encodersgpl.tar.gz \ ${OUTPUT_DIR}/libmpv-libs_${VERSION}_macos-arm64-video-default.tar.gz \ ${OUTPUT_DIR}/libmpv-libs_${VERSION}_macos-arm64-video-full.tar.gz \ - ${OUTPUT_DIR}/libmpv-libs_${VERSION}_macos-arm64-video-encoders.tar.gz \ + ${OUTPUT_DIR}/libmpv-libs_${VERSION}_macos-arm64-video-encodersgpl.tar.gz \ ${OUTPUT_DIR}/libmpv-libs_${VERSION}_macos-universal-audio-default.tar.gz \ ${OUTPUT_DIR}/libmpv-libs_${VERSION}_macos-universal-audio-full.tar.gz \ - ${OUTPUT_DIR}/libmpv-libs_${VERSION}_macos-universal-audio-encoders.tar.gz \ + ${OUTPUT_DIR}/libmpv-libs_${VERSION}_macos-universal-audio-encodersgpl.tar.gz \ ${OUTPUT_DIR}/libmpv-libs_${VERSION}_macos-universal-video-default.tar.gz \ ${OUTPUT_DIR}/libmpv-libs_${VERSION}_macos-universal-video-full.tar.gz \ - ${OUTPUT_DIR}/libmpv-libs_${VERSION}_macos-universal-video-encoders.tar.gz \ + ${OUTPUT_DIR}/libmpv-libs_${VERSION}_macos-universal-video-encodersgpl.tar.gz \ ${OUTPUT_DIR}/libmpv-xcframeworks_${VERSION}_ios-universal-audio-default.tar.gz \ ${OUTPUT_DIR}/libmpv-xcframeworks_${VERSION}_ios-universal-audio-full.tar.gz \ - ${OUTPUT_DIR}/libmpv-xcframeworks_${VERSION}_ios-universal-audio-encoders.tar.gz \ + ${OUTPUT_DIR}/libmpv-xcframeworks_${VERSION}_ios-universal-audio-encodersgpl.tar.gz \ ${OUTPUT_DIR}/libmpv-xcframeworks_${VERSION}_ios-universal-video-default.tar.gz \ ${OUTPUT_DIR}/libmpv-xcframeworks_${VERSION}_ios-universal-video-full.tar.gz \ - ${OUTPUT_DIR}/libmpv-xcframeworks_${VERSION}_ios-universal-video-encoders.tar.gz \ + ${OUTPUT_DIR}/libmpv-xcframeworks_${VERSION}_ios-universal-video-encodersgpl.tar.gz \ ${OUTPUT_DIR}/libmpv-xcframeworks_${VERSION}_macos-universal-audio-default.tar.gz \ ${OUTPUT_DIR}/libmpv-xcframeworks_${VERSION}_macos-universal-audio-full.tar.gz \ - ${OUTPUT_DIR}/libmpv-xcframeworks_${VERSION}_macos-universal-audio-encoders.tar.gz \ + ${OUTPUT_DIR}/libmpv-xcframeworks_${VERSION}_macos-universal-audio-encodersgpl.tar.gz \ ${OUTPUT_DIR}/libmpv-xcframeworks_${VERSION}_macos-universal-video-default.tar.gz \ ${OUTPUT_DIR}/libmpv-xcframeworks_${VERSION}_macos-universal-video-full.tar.gz \ - ${OUTPUT_DIR}/libmpv-xcframeworks_${VERSION}_macos-universal-video-encoders.tar.gz + ${OUTPUT_DIR}/libmpv-xcframeworks_${VERSION}_macos-universal-video-encodersgpl.tar.gz ${OUTPUT_DIR}/debug.zip: \ ${INTERMEDIATE_DIR}/tool-versions.lock \ $$(foreach OS,ios iossimulator macos, \ $$(foreach ARCH,amd64 arm64, \ $$(foreach VARIANT,audio video, \ - $$(foreach FLAVOR,default full encoders, \ + $$(foreach FLAVOR,default full encodersgpl, \ $$(if $$(filter-out ios-amd64, $${OS}-$${ARCH}), \ ${INTERMEDIATE_DIR}/ffmpeg_$${OS}-$${ARCH}-$${VARIANT}-$${FLAVOR} \ ${INTERMEDIATE_DIR}/fftools-ffi_$${OS}-$${ARCH}-$${VARIANT}-$${FLAVOR} \ @@ -361,14 +361,14 @@ ${INTERMEDIATE_DIR}/ffmpeg_%: \ ${DOWNLOADS_DIR} \ ${PKGCONFIG_DIR} \ ${INTERMEDIATE_DIR}/mbedtls_$$(word 1,$$(subst -, ,$$*))-$$(word 2,$$(subst -, ,$$*)) \ - $$(if $$(filter encoders, $$(word 4,$$(subst -, ,$$*))), \ + $$(if $$(filter encodersgpl, $$(word 4,$$(subst -, ,$$*))), \ ${INTERMEDIATE_DIR}/libvorbis_$$(word 1,$$(subst -, ,$$*))-$$(word 2,$$(subst -, ,$$*)) \ ${INTERMEDIATE_DIR}/libogg_$$(word 1,$$(subst -, ,$$*))-$$(word 2,$$(subst -, ,$$*)) \ ) \ $$(if $$(filter video, $$(word 3,$$(subst -, ,$$*))), \ ${INTERMEDIATE_DIR}/dav1d_$$(word 1,$$(subst -, ,$$*))-$$(word 2,$$(subst -, ,$$*)) \ ${INTERMEDIATE_DIR}/libxml2_$$(word 1,$$(subst -, ,$$*))-$$(word 2,$$(subst -, ,$$*)) \ - $$(if $$(filter encoders, $$(word 4,$$(subst -, ,$$*))), \ + $$(if $$(filter encodersgpl, $$(word 4,$$(subst -, ,$$*))), \ ${INTERMEDIATE_DIR}/libvpx_$$(word 1,$$(subst -, ,$$*))-$$(word 2,$$(subst -, ,$$*)) \ ${INTERMEDIATE_DIR}/libx264_$$(word 1,$$(subst -, ,$$*))-$$(word 2,$$(subst -, ,$$*)) \ ) \ @@ -970,7 +970,7 @@ ${INTERMEDIATE_DIR}/libs-arch_%: \ ${INTERMEDIATE_DIR}/mpv_$$(word 1,$$(subst -, ,$$*))-$$(word 2,$$(subst -, ,$$*))-$$(word 3,$$(subst -, ,$$*)) \ ${INTERMEDIATE_DIR}/ffmpeg_$$(word 1,$$(subst -, ,$$*))-$$(word 2,$$(subst -, ,$$*))-$$(word 3,$$(subst -, ,$$*))-$$(word 4,$$(subst -, ,$$*)) \ ${INTERMEDIATE_DIR}/mbedtls_$$(word 1,$$(subst -, ,$$*))-$$(word 2,$$(subst -, ,$$*)) \ - $$(if $$(filter encoders, $$(word 4,$$(subst -, ,$$*))), \ + $$(if $$(filter encodersgpl, $$(word 4,$$(subst -, ,$$*))), \ ${INTERMEDIATE_DIR}/fftools-ffi_$$(word 1,$$(subst -, ,$$*))-$$(word 2,$$(subst -, ,$$*))-$$(word 3,$$(subst -, ,$$*)) \ ${INTERMEDIATE_DIR}/libvorbis_$$(word 1,$$(subst -, ,$$*))-$$(word 2,$$(subst -, ,$$*)) \ ${INTERMEDIATE_DIR}/libogg_$$(word 1,$$(subst -, ,$$*))-$$(word 2,$$(subst -, ,$$*)) \ @@ -983,7 +983,7 @@ ${INTERMEDIATE_DIR}/libs-arch_%: \ ${INTERMEDIATE_DIR}/harfbuzz_$$(word 1,$$(subst -, ,$$*))-$$(word 2,$$(subst -, ,$$*)) \ ${INTERMEDIATE_DIR}/fribidi_$$(word 1,$$(subst -, ,$$*))-$$(word 2,$$(subst -, ,$$*)) \ ${INTERMEDIATE_DIR}/freetype_$$(word 1,$$(subst -, ,$$*))-$$(word 2,$$(subst -, ,$$*)) \ - $$(if $$(filter encoders, $$(word 4,$$(subst -, ,$$*))), \ + $$(if $$(filter encodersgpl, $$(word 4,$$(subst -, ,$$*))), \ ${INTERMEDIATE_DIR}/libvpx_$$(word 1,$$(subst -, ,$$*))-$$(word 2,$$(subst -, ,$$*)) \ ${INTERMEDIATE_DIR}/libx264_$$(word 1,$$(subst -, ,$$*))-$$(word 2,$$(subst -, ,$$*)) \ ) \ diff --git a/README.md b/README.md index 9965082..7cc4763 100644 --- a/README.md +++ b/README.md @@ -15,34 +15,34 @@ $ VERSION=v0.0.1 make $ ls build/output libmpv-libs_v0.0.1_ios-arm64-audio-default.tar.gz libmpv-libs_v0.0.1_ios-arm64-audio-full.tar.gz -libmpv-libs_v0.0.1_ios-arm64-audio-encoders.tar.gz +libmpv-libs_v0.0.1_ios-arm64-audio-encodersgpl.tar.gz libmpv-libs_v0.0.1_ios-arm64-video-default.tar.gz libmpv-libs_v0.0.1_ios-arm64-video-full.tar.gz -libmpv-libs_v0.0.1_ios-arm64-video-encoders.tar.gz +libmpv-libs_v0.0.1_ios-arm64-video-encodersgpl.tar.gz libmpv-libs_v0.0.1_iossimulator-universal-audio-default.tar.gz libmpv-libs_v0.0.1_iossimulator-universal-audio-full.tar.gz -libmpv-libs_v0.0.1_iossimulator-universal-audio-encoders.tar.gz +libmpv-libs_v0.0.1_iossimulator-universal-audio-encodersgpl.tar.gz libmpv-libs_v0.0.1_iossimulator-universal-video-default.tar.gz libmpv-libs_v0.0.1_iossimulator-universal-video-full.tar.gz -libmpv-libs_v0.0.1_iossimulator-universal-video-encoders.tar.gz +libmpv-libs_v0.0.1_iossimulator-universal-video-encodersgpl.tar.gz libmpv-libs_v0.0.1_macos-universal-audio-default.tar.gz libmpv-libs_v0.0.1_macos-universal-audio-full.tar.gz -libmpv-libs_v0.0.1_macos-universal-audio-encoders.tar.gz +libmpv-libs_v0.0.1_macos-universal-audio-encodersgpl.tar.gz libmpv-libs_v0.0.1_macos-universal-video-default.tar.gz libmpv-libs_v0.0.1_macos-universal-video-full.tar.gz -libmpv-libs_v0.0.1_macos-universal-video-encoders.tar.gz +libmpv-libs_v0.0.1_macos-universal-video-encodersgpl.tar.gz libmpv-xcframeworks_v0.0.1_ios-universal-audio-default.tar.gz libmpv-xcframeworks_v0.0.1_ios-universal-audio-full.tar.gz -libmpv-xcframeworks_v0.0.1_ios-universal-audio-encoders.tar.gz +libmpv-xcframeworks_v0.0.1_ios-universal-audio-encodersgpl.tar.gz libmpv-xcframeworks_v0.0.1_ios-universal-video-default.tar.gz libmpv-xcframeworks_v0.0.1_ios-universal-video-full.tar.gz -libmpv-xcframeworks_v0.0.1_ios-universal-video-encoders.tar.gz +libmpv-xcframeworks_v0.0.1_ios-universal-video-encodersgpl.tar.gz libmpv-xcframeworks_v0.0.1_macos-universal-audio-default.tar.gz libmpv-xcframeworks_v0.0.1_macos-universal-audio-full.tar.gz -libmpv-xcframeworks_v0.0.1_macos-universal-audio-encoders.tar.gz +libmpv-xcframeworks_v0.0.1_macos-universal-audio-encodersgpl.tar.gz libmpv-xcframeworks_v0.0.1_macos-universal-video-default.tar.gz libmpv-xcframeworks_v0.0.1_macos-universal-video-full.tar.gz -libmpv-xcframeworks_v0.0.1_macos-universal-video-encoders.tar.gz +libmpv-xcframeworks_v0.0.1_macos-universal-video-encodersgpl.tar.gz ``` ## Naming convention @@ -51,19 +51,19 @@ libmpv-xcframeworks_v0.0.1_macos-universal-video-encoders.tar.gz libmpv-__---.tar.gz ``` -| Component | Notes | Value | -| ----------- | ------------------------------- | ------------------------ | -| **format** | Output format of built files | libs, xcframeworks | -| **version** | Semantic version | v0.0.1, … | -| **os** | Operating system | ios, iossimulator, macos | -| **arch** | Architecture | arm64, amd64, universal | -| **variant** | Usage context | audio, video | -| **flavor** | Available decoders and encoders | default, full, encoders | +| Component | Notes | Value | +| ----------- | ------------------------------- | -------------------------- | +| **format** | Output format of built files | libs, xcframeworks | +| **version** | Semantic version | v0.0.1, … | +| **os** | Operating system | ios, iossimulator, macos | +| **arch** | Architecture | arm64, amd64, universal | +| **variant** | Usage context | audio, video | +| **flavor** | Available decoders and encoders | default, full, encodersgpl | Inclusion: - Variants: $audio \subset video$ -- Flavors: $audio \subset full \subset encoders$ +- Flavors: $audio \subset full \subset encodersgpl$ ## Minimum versions @@ -124,7 +124,7 @@ flowchart LR subgraph flavors V(default, full):::decoders - W(encoders):::encoders + W(encodersgpl):::encoders end end @@ -235,7 +235,7 @@ flowchart LR | libxml2 | MIT | ✅ | | dav1d | BSD-2-clause | ✅ | -### Encoders flavor +### Encoders-GPL flavor | Dependency | Licence | Commercial use | | ----------- | ------------------------------------ | :------------: | diff --git a/scripts/ffmpeg/meson.build b/scripts/ffmpeg/meson.build index f816822..aa3831e 100644 --- a/scripts/ffmpeg/meson.build +++ b/scripts/ffmpeg/meson.build @@ -283,7 +283,7 @@ video_full_options = [ '--enable-decoder=h264', ] -audio_encoders_options = [ +audio_encodersgpl_options = [ '--enable-encoders', '--enable-muxers', '--enable-filters', @@ -291,7 +291,7 @@ audio_encoders_options = [ # TODO: If audio_encoders is going to exist as its own package, be smarter about what encoders to include ] -video_encoders_options = [ +video_encodersgpl_options = [ '--enable-libvpx', '--enable-libx264', '--enable-gpl' @@ -318,12 +318,12 @@ elif flavor == 'full' if variant == 'video' options += video_full_options endif -elif flavor == 'encoders' +elif flavor == 'encodersgpl' options += audio_full_options - options += audio_encoders_options + options += audio_encodersgpl_options if variant == 'video' options += video_full_options - options += video_encoders_options + options += video_encodersgpl_options endif endif diff --git a/scripts/ffmpeg/meson.options b/scripts/ffmpeg/meson.options index e819373..a48d1db 100644 --- a/scripts/ffmpeg/meson.options +++ b/scripts/ffmpeg/meson.options @@ -1,2 +1,2 @@ option('variant', type : 'combo', choices : ['audio', 'video']) -option('flavor', type : 'combo', choices : ['default', 'full', 'encoders']) +option('flavor', type : 'combo', choices : ['default', 'full', 'encodersgpl'])