1616shift 3 || true
1717FF_ARGS=$@
1818
19- for dep in libharfbuzz libfreetype sdl libjxl libvpx libwebp; do
19+ for dep in libharfbuzz libfreetype sdl libjxl libvpx libwebp libass ; do
2020 if grep -q " enable-${dep} " FFmpeg/configure; then
2121 export ENABLE_${dep^^} =1
2222 # FF_ARGS="$FF_ARGS --enable-$dep"
@@ -33,9 +33,10 @@ add_ffargs() {
3333}
3434
3535apply-patch () {
36- GIT_CMD=" git -C $1 apply ../patches/$2 --ignore-whitespace"
37- if ! $GIT_CMD -R --check; then
38- $GIT_CMD --ignore-whitespace
36+ GIT_CMD=" git -C $1 apply $( pwd) /patches/$2 --ignore-whitespace"
37+ if ! $GIT_CMD -R --check 2> /dev/null; then
38+ echo Apply $2 for $1
39+ $GIT_CMD
3940 else
4041 echo Skip $2 for $1
4142 fi
@@ -45,42 +46,6 @@ apply-patch zlib zlib.patch
4546apply-patch FFmpeg ffmpeg.patch
4647apply-patch harfbuzz harfbuzz.patch
4748
48- # --enable-libfribidi --enable-libass
49- # ./build-meson-dep.sh fribidi -Ddocs=false
50- # ./build-meson-dep.sh libass
51-
52- if [ " $BUILD_LICENSE " == " gpl" ]; then
53-
54- apply-patch x265_git x265_git-${BUILD_TYPE} .patch
55-
56- if [ " $BUILD_TYPE " == " static" ]; then
57- X265_ARGS=" -DSTATIC_LINK_CRT=ON"
58- ENABLE_SHARED=OFF
59- else
60- X265_ARGS=" -DSTATIC_LINK_CRT=OFF"
61- ENABLE_SHARED=ON
62- fi
63-
64- if [ " $BUILD_ARCH " == arm ]; then
65- apply-patch x265_git x265_git-arm.patch
66- fi
67-
68- git -C x265_git fetch --tags
69- ./build-cmake-dep.sh x265_git/source -DCMAKE_SYSTEM_NAME=Windows -DENABLE_SHARED=$ENABLE_SHARED -DENABLE_CLI=OFF $X265_ARGS
70- add_ffargs " --enable-libx265"
71-
72- if [ " $BUILD_TYPE " == " shared" ]; then
73- apply-patch x264 x264-${BUILD_TYPE} .patch
74- fi
75- if [[ " $BUILD_ARCH " =~ arm ]]; then
76- X264_ARGS=" --disable-asm"
77- fi
78-
79- INSTALL_TARGET=install-lib-${BUILD_TYPE} ./build-make-dep.sh x264 --enable-${BUILD_TYPE} $X264_ARGS
80- add_ffargs " --enable-libx264"
81-
82- fi
83-
8449./build-make-dep.sh nv-codec-headers
8550
8651./build-cmake-dep.sh zlib -DZLIB_BUILD_EXAMPLES=OFF
@@ -96,6 +61,14 @@ if [ -n "$ENABLE_LIBHARFBUZZ" ]; then
9661 add_ffargs " --enable-libharfbuzz"
9762fi
9863
64+ if [ -n " $ENABLE_LIBASS " ]; then
65+ # apply-patch fribidi fribidi.patch
66+ ./build-libass.sh
67+ add_ffargs " --enable-libass"
68+ fi
69+
70+
71+
9972if [ -n " $ENABLE_SDL " ]; then
10073 ./build-cmake-dep.sh SDL
10174 add_ffargs " --enable-sdl"
@@ -116,9 +89,6 @@ if [ -n "$ENABLE_LIBJXL" ]; then
11689
11790fi
11891
119- # libvpx AR=lib ARFLAGS= CC=cl CXX=cl LD=link STRIP=false ./configure --as=yasm --disable-optimizations --disable-dependency-tracking --disable-runtime-cpu-detect --disable-thumb --disable-neon
120- # AR=lib ARFLAGS= CC=cl CXX=cl LD=link STRIP=false ./configure --target=armv7-win32-vs17 --as=yasm --disable-optimizations --disable-dependency-tracking --disable-runtime-cpu-detect --disable-thumb --disable-neon --enable-external-build --enable-static-msvcrt
121-
12292if [ -n " $ENABLE_LIBVPX " ]; then
12393 case $BUILD_ARCH in
12494 amd64) libvpx_target=x86_64-win64-vs17 ;;
@@ -127,12 +97,9 @@ if [ -n "$ENABLE_LIBVPX" ]; then
12797 arm64) libvpx_target=arm64-win64-vs17 ;;
12898 esac
12999
130- if [ " $BUILD_TYPE " == " static" ]; then
131- LIBVPX_ARGS=" --enable-static-msvcrt"
132- fi
100+ LIBVPX_ARGS=" --enable-static-msvcrt"
133101 apply-patch libvpx libvpx.patch
134- export
135- AS=yasm AR=lib ARFLAGS= CC=cl CXX=cl LD=link STRIP=false target= ./build-make-dep.sh libvpx --target=$libvpx_target --as=yasm --disable-optimizations --disable-dependency-tracking --disable-runtime-cpu-detect --disable-thumb --disable-neon --enable-external-build --disable-unit-tests --disable-decode-perf-tests --disable-encode-perf-tests --disable-tools --disable-examples $LIBVPX_ARGS
102+ CFLAGS=" " AS=yasm AR=lib ARFLAGS= CC=cl CXX=cl LD=link STRIP=false target= ./build-make-dep.sh libvpx --target=$libvpx_target --as=yasm --disable-optimizations --disable-dependency-tracking --disable-runtime-cpu-detect --disable-thumb --disable-neon --enable-external-build --disable-unit-tests --disable-decode-perf-tests --disable-encode-perf-tests --disable-tools --disable-examples $LIBVPX_ARGS
136103 add_ffargs " --enable-libvpx"
137104fi
138105
@@ -141,5 +108,37 @@ if [ -n "$ENABLE_LIBWEBP" ]; then
141108 add_ffargs " --enable-libwebp"
142109fi
143110
111+ if [ " $BUILD_LICENSE " == " gpl" ]; then
112+
113+ apply-patch x265_git x265_git-${BUILD_TYPE} .patch
114+
115+ if [ " $BUILD_TYPE " == " static" ]; then
116+ X265_ARGS=" -DSTATIC_LINK_CRT=ON"
117+ ENABLE_SHARED=OFF
118+ else
119+ X265_ARGS=" -DSTATIC_LINK_CRT=OFF"
120+ ENABLE_SHARED=ON
121+ fi
122+
123+ if [ " $BUILD_ARCH " == arm ]; then
124+ apply-patch x265_git x265_git-arm.patch
125+ fi
126+
127+ git -C x265_git fetch --tags
128+ ./build-cmake-dep.sh x265_git/source -DCMAKE_SYSTEM_NAME=Windows -DENABLE_SHARED=$ENABLE_SHARED -DENABLE_CLI=OFF $X265_ARGS
129+ add_ffargs " --enable-libx265"
130+
131+ if [ " $BUILD_TYPE " == " shared" ]; then
132+ apply-patch x264 x264-${BUILD_TYPE} .patch
133+ fi
134+ if [[ " $BUILD_ARCH " =~ arm ]]; then
135+ X264_ARGS=" --disable-asm"
136+ fi
137+
138+ INSTALL_TARGET=install-lib-${BUILD_TYPE} ./build-make-dep.sh x264 --enable-${BUILD_TYPE} $X264_ARGS
139+ add_ffargs " --enable-libx264"
140+
141+ fi
142+
144143./build-ffmpeg.sh FFmpeg $FF_ARGS
145- ./relocate_prefix .sh
144+ ./reprefix .sh
0 commit comments