├── .gitignore ├── rebuild ├── scripts ├── libass-clean ├── freetype-clean ├── fribidi-build ├── fribidi-clean ├── harfbuzz-clean ├── freetype-build ├── harfbuzz-build ├── libass-build ├── mpv-clean ├── uchardet-build ├── mpv-build └── ffmpeg-build ├── clean ├── README.md └── update /.gitignore: -------------------------------------------------------------------------------- 1 | tarballs/ 2 | src/ 3 | build-*/ 4 | -------------------------------------------------------------------------------- /rebuild: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | set -e 3 | 4 | ./clean 5 | ./build $@ -------------------------------------------------------------------------------- /scripts/libass-clean: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | set -ex 3 | 4 | cd $SRCPATH/libass* 5 | if [[ -f Makefile ]]; then 6 | make distclean 7 | fi -------------------------------------------------------------------------------- /scripts/freetype-clean: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | set -ex 3 | 4 | cd $SRCPATH/freetype* 5 | if [[ -f Makefile ]]; then 6 | make distclean 7 | fi -------------------------------------------------------------------------------- /scripts/fribidi-build: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | set -e 3 | 4 | $SRCPATH/fribidi*/configure $OPTHIONS \ 5 | --disable-docs 6 | make install -------------------------------------------------------------------------------- /scripts/fribidi-clean: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | set -ex 3 | 4 | cd $SRCPATH/fribidi* 5 | if [[ -f Makefile ]]; then 6 | make distclean 7 | fi -------------------------------------------------------------------------------- /scripts/harfbuzz-clean: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | set -ex 3 | 4 | cd $SRCPATH/harfbuzz* 5 | if [[ -f Makefile ]]; then 6 | make distclean 7 | fi -------------------------------------------------------------------------------- /scripts/freetype-build: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | set -e 3 | 4 | $SRCPATH/freetype*/configure $OPTHIONS \ 5 | --with-zlib=yes \ 6 | --without-png \ 7 | --with-bzip2=no 8 | make install -------------------------------------------------------------------------------- /scripts/harfbuzz-build: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | set -e 3 | 4 | $SRCPATH/harfbuzz*/configure $OPTHIONS \ 5 | --with-icu=no \ 6 | --with-glib=no \ 7 | --with-fontconfig=no \ 8 | --with-coretext=yes 9 | make install -------------------------------------------------------------------------------- /clean: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | set -e 3 | 4 | ROOT="$(pwd)" 5 | export SRCPATH="$ROOT/src" 6 | 7 | scripts/fribidi-clean 8 | scripts/freetype-clean 9 | scripts/harfbuzz-clean 10 | scripts/libass-clean 11 | scripts/mpv-clean 12 | 13 | rm -rf $ROOT/build-* -------------------------------------------------------------------------------- /scripts/libass-build: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | set -ex 3 | 4 | if [[ "$PLATFORM" = "ios" ]]; then 5 | OPT="--disable-fontconfig \ 6 | --disable-require-system-font-provider \ 7 | --enable-directwrite" 8 | fi 9 | $SRCPATH/libass*/configure $OPTHIONS $OPT 10 | 11 | make install -------------------------------------------------------------------------------- /scripts/mpv-clean: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | set -ex 3 | 4 | cd $SRCPATH/mpv* 5 | if [[ -f waf ]]; then 6 | ./waf distclean 7 | fi 8 | rm -f DOCS/man/*/mpv.1 version.h input/input_conf.h video/out/vdpau_template.c demux/ebml_types.h demux/ebml_defs.c video/out/gl_video_shaders.h video/out/x11_icon.inc sub/osd_font.h player/lua/defaults.inc player/lua/assdraw.inc player/lua/osc.inc mpv -------------------------------------------------------------------------------- /scripts/uchardet-build: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | set -e 3 | 4 | PREFIX="${OPTHIONS%% *}" 5 | PREFIX="${PREFIX##*=}" 6 | 7 | OPT="-DCMAKE_INSTALL_PREFIX=$PREFIX -DCMAKE_BUILD_TYPE=Release" 8 | 9 | if [[ "$PLATFORM" = "ios" ]]; then 10 | OPT="$OPT -DBUILD_SHARED_LIBS=false" 11 | fi 12 | 13 | cmake $SRCPATH/uchardet* 14 | cmake $SRCPATH/uchardet* $OPT && make 15 | make install -------------------------------------------------------------------------------- /scripts/mpv-build: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | set -e 3 | 4 | if [[ "$PLATFORM" = "ios" ]]; then 5 | OPTS="--disable-cplayer \ 6 | --disable-lcms2 \ 7 | --disable-lua \ 8 | --enable-libmpv-static \ 9 | --enable-ios-gl \ 10 | --enable-gl \ 11 | --disable-javascript" 12 | else 13 | OPTS="--enable-uchardet --enable-libmpv-shared" 14 | fi 15 | 16 | cd $SRCPATH/mpv* 17 | ./bootstrap.py 18 | ./waf configure $OPTS --disable-debug-build 19 | ./waf build -j4 -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | ## Overview 2 | 3 | This is a shell script to build mpv libraries for iOS and macOS apps. 4 | 5 | This script refers to the mpv official build script [mpv-build](https://github.com/mpv-player/mpv-build). 6 | 7 | Tested with: 8 | 9 | - macOS 10.13.4 10 | - Xcode 9.3 for mac 11 | - Xcode 8.3.3 for iOS 12 | 13 | ## Usage 14 | 15 | - Clone code 16 | 17 | > ./update 18 | 19 | - To build for macOS 20 | 21 | > ./build 22 | 23 | - To build for iOS 24 | 25 | > ./build -p iOS 26 | 27 | - Get help 28 | 29 | > ./build -h 30 | 31 | ​ -------------------------------------------------------------------------------- /scripts/ffmpeg-build: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | set -e 3 | 4 | OPTS="${OPTHIONS%% *} \ 5 | --disable-lzma \ 6 | --disable-securetransport \ 7 | --disable-debug \ 8 | --disable-programs \ 9 | --disable-doc \ 10 | --enable-pic" 11 | 12 | if [[ "$PLATFORM" = "ios" ]]; then 13 | if [[ ! `which gas-preprocessor.pl` ]]; then 14 | curl -L https://github.com/libav/gas-preprocessor/raw/master/gas-preprocessor.pl -o /usr/local/bin/gas-preprocessor.pl \ 15 | && chmod +x /usr/local/bin/gas-preprocessor.pl 16 | fi 17 | 18 | $SRCPATH/ffmpeg*/configure $OPTS \ 19 | --target-os=darwin \ 20 | --arch=$ARCHFLAG \ 21 | --extra-cflags="$CFLAGS" \ 22 | --enable-cross-compile 23 | else 24 | $SRCPATH/ffmpeg*/configure $OPTS \ 25 | --disable-static \ 26 | --enable-shared 27 | fi 28 | 29 | make -j4 install -------------------------------------------------------------------------------- /update: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | set -ex 3 | 4 | FREETYPE_VERSION="2.9" 5 | HARFBUZZ_VERSION="1.7.6" 6 | FRIBIDI_VERSION="1.0.2" 7 | LIBASS_VERSION="0.14.0" 8 | FFMPEG_VERSION="3.4.2" 9 | MPV_VERSION="0.27.2" 10 | UCHARDET_VERSION="0.0.6" 11 | 12 | FREETYPE_URL="https://sourceforge.net/projects/freetype/files/freetype2/$FREETYPE_VERSION/freetype-$FREETYPE_VERSION.tar.bz2" 13 | HARFBUZZ_URL="https://www.freedesktop.org/software/harfbuzz/release/harfbuzz-$HARFBUZZ_VERSION.tar.bz2" 14 | FRIBIDI_URL="https://github.com/fribidi/fribidi/releases/download/v$FRIBIDI_VERSION/fribidi-$FRIBIDI_VERSION.tar.bz2" 15 | LIBASS_URL="https://github.com/libass/libass/releases/download/$LIBASS_VERSION/libass-$LIBASS_VERSION.tar.gz" 16 | FFMPEG_URL="http://www.ffmpeg.org/releases/ffmpeg-$FFMPEG_VERSION.tar.bz2" 17 | MPV_URL="https://github.com/mpv-player/mpv/archive/v$MPV_VERSION.tar.gz" 18 | UCHARDET_URL="https://www.freedesktop.org/software/uchardet/releases/uchardet-$UCHARDET_VERSION.tar.xz" 19 | 20 | mkdir tarballs src 21 | for URL in $UCHARDET_URL $FREETYPE_URL $HARFBUZZ_URL $FRIBIDI_URL $LIBASS_URL $FFMPEG_URL $MPV_URL; do 22 | TARNAME=${URL##*/} 23 | curl -f -L -- $URL > tarballs/$TARNAME 24 | tar xvf tarballs/$TARNAME -C src 25 | done --------------------------------------------------------------------------------