Skip to content
Permalink
master
Switch branches/tags
Go to file
 
 
Cannot retrieve contributors at this time
executable file 56 lines (42 sloc) 1.03 KB
#!/usr/bin/env bash
set -eux
cd $(dirname $0)
BASE_DIR=$(pwd)
source common.sh
if [ ! -e $FFMPEG_TARBALL ]
then
curl -O $FFMPEG_TARBALL_URL
fi
: ${TARGET?}
case $TARGET in
x86_64-*)
ARCH="x86_64"
;;
arm64-*)
ARCH="arm64"
;;
*)
echo "Unknown target: $TARGET"
exit 1
;;
esac
OUTPUT_DIR=artifacts/ffmpeg-$FFMPEG_VERSION-audio-$TARGET
BUILD_DIR=$BASE_DIR/$(mktemp -d build.XXXXXXXX)
trap 'rm -rf $BUILD_DIR' EXIT
cd $BUILD_DIR
tar --strip-components=1 -xf $BASE_DIR/$FFMPEG_TARBALL
FFMPEG_CONFIGURE_FLAGS+=(
--cc=/usr/bin/clang
--prefix=$BASE_DIR/$OUTPUT_DIR
--enable-cross-compile
--target-os=darwin
--arch=$ARCH
--extra-ldflags="-target $TARGET"
--extra-cflags="-target $TARGET"
--enable-runtime-cpudetect
)
./configure "${FFMPEG_CONFIGURE_FLAGS[@]}" || (cat ffbuild/config.log && exit 1)
perl -pi -e 's{HAVE_MACH_MACH_TIME_H 1}{HAVE_MACH_MACH_TIME_H 0}' config.h
make V=1
make install
chown -R $(stat -f '%u:%g' $BASE_DIR) $BASE_DIR/$OUTPUT_DIR