-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathffmpeg
More file actions
39 lines (33 loc) · 1.55 KB
/
ffmpeg
File metadata and controls
39 lines (33 loc) · 1.55 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
# Use legacy bundle on high-sierra
if [ "x${OSTYPE:6:1}" = "x1" ]; then
bottle="https://github.com/autobrew/bundler/releases/download/ffmpeg-6.0/ffmpeg-4.2.4-high_sierra.tar.xz"
AVRESAMPLE="-lavresample"
else
bottle="https://github.com/autobrew/bundler/releases/download/ffmpeg-6.0/ffmpeg-6.0-universal.tar.xz"
MMACOS="-mmacosx-version-min=11.0"
fi
# Skip if disabled
if [ "$DISABLE_AUTOBREW" ]; then return 0; fi
echo "Using autobrew bundle: $(basename $bottle)"
# General setup
BREWDIR="$PWD/.deps"
mkdir -p $BREWDIR
curl -sSL $bottle -o libs.tar.xz
tar -xf libs.tar.xz --strip 1 -C $BREWDIR
rm -f libs.tar.xz
# package may look under /opt
mkdir -p $BREWDIR/opt/ffmpeg
ln -s $BREWDIR/{include,lib} $BREWDIR/opt/ffmpeg/
# pkg-config --libs-only-l --static libavfilter vorbis
PKG_LIBS="-L$BREWDIR/lib -lavfilter -lswscale -lpostproc -lavformat -lbz2 -lavcodec -lvpx -lmp3lame -lvorbisenc -lx264 -lxvidcore -lswresample $AVRESAMPLE -lavutil -lvorbis -logg -liconv -lz -lm -framework AppKit -framework AVFoundation -framework AudioToolbox -framework CoreMedia -framework VideoToolbox -framework CoreImage -framework Security -framework CoreVideo -framework Metal -framework OpenGL"
PKG_CFLAGS="-I$BREWDIR/include -DBUILD_AUTOBREW $MMACOS"
# Prevent CRAN builder from linking against old libs in /usr/local/lib
for FILE in $BREWDIR/lib/*.a; do
BASENAME=$(basename $FILE)
LIBNAME=$(echo "${BASENAME%.*}" | cut -c4-)
mv $FILE $BREWDIR/$LIBNAME
PKG_LIBS=$(echo $PKG_LIBS | sed "s|-l$LIBNAME |../.deps/$LIBNAME |g")
done
# Cleanup
echo "rm -Rf .deps" >> cleanup
chmod +x cleanup