Skip to content

Commit 26dba63

Browse files
committed
Add libass and MT Only
1 parent a750108 commit 26dba63

File tree

21 files changed

+457
-114
lines changed

21 files changed

+457
-114
lines changed

.github/workflows/build.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,10 @@ jobs:
7676
pkgconf
7777
yasm
7878
nasm
79+
libtool
80+
bison
81+
automake
82+
autoconf
7983
8084
- name: Remove MSYS2 link
8185
shell: msys2 {0}

.gitmodules

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,3 +37,9 @@ url = https://github.com/webmproject/libwebp.git
3737
[submodule "libvpx"]
3838
path = libvpx
3939
url = https://github.com/webmproject/libvpx.git
40+
[submodule "libass"]
41+
path = libass
42+
url = https://github.com/libass/libass.git
43+
[submodule "fribidi"]
44+
path = fribidi
45+
url = https://github.com/fribidi/fribidi.git

README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,12 +61,15 @@ All builds include the following libraries:
6161
- [openexr](https://github.com/AcademySoftwareFoundation/openexr.git)
6262
- [freetype](https://gitlab.freedesktop.org/freetype/freetype.git)
6363
- [harfbuzz](https://github.com/harfbuzz/harfbuzz.git)
64+
- [libass](https://github.com/libass/libass.git)
65+
- [fribidi](https://github.com/fribidi/fribidi.git)
6466
- [SDL2](https://github.com/libsdl-org/SDL.git)
6567
- [libvpx](https://github.com/webmproject/libvpx.git)
6668
- [libwebp](https://github.com/webmproject/libwebp.git)
6769
- [x264](https://code.videolan.org/videolan/x264.git) (GPL builds only)
6870
- [x265](https://bitbucket.org/multicoreware/x265_git.git) (GPL builds only)
6971

72+
7073
## License
7174

7275
- The scripts in this repository are licensed under the **MIT License**.

RELEASE.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@ This release contains FFmpeg builds, compiled with MSVC (Microsoft Visual C++) v
1414
- [openexr](https://github.com/AcademySoftwareFoundation/openexr.git)
1515
- [freetype](https://gitlab.freedesktop.org/freetype/freetype.git)
1616
- [harfbuzz](https://github.com/harfbuzz/harfbuzz.git)
17+
- [libass](https://github.com/libass/libass.git)
18+
- [fribidi](https://github.com/fribidi/fribidi.git)
1719
- [SDL2](https://github.com/libsdl-org/SDL.git)
1820
- [libvpx](https://github.com/webmproject/libvpx.git)
1921
- [libwebp](https://github.com/webmproject/libwebp.git)

build-ffmpeg.sh

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,8 @@ shift 1
1111
cd $SRC_DIR
1212

1313
if [ $BUILD_TYPE == "static" ]; then
14-
CFLAGS="$CFLAGS -MT"
1514
TYPE_ARGS="--enable-static --pkg-config-flags=--static"
1615
else
17-
CFLAGS="$CFLAGS -MD"
1816
TYPE_ARGS="--enable-shared"
1917
fi
2018
if [[ $BUILD_ARCH =~ arm ]]; then

build-libass.sh

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
#!/bin/bash
2+
# Copyright (c) 2024 System233
3+
#
4+
# This software is released under the MIT License.
5+
# https://opensource.org/licenses/MIT
6+
7+
set -e -x
8+
echo SET test
9+
SRC_DIR=$(pwd)
10+
11+
export TOOLCHAIN_SRCDIR="$(pwd)/toolchain"
12+
export AR=win-ar
13+
export RANLIB=win-ranlib
14+
export PATH=$TOOLCHAIN_SRCDIR:$PATH
15+
16+
echo -e "\n[Build fribidi]"
17+
cd $SRC_DIR/fribidi
18+
NOCONFIGURE=1 ./autogen.sh
19+
FRIBIDI_CFLAGS="-DHAVE_STRINGIZE"
20+
CFLAGS="$FRIBIDI_CFLAGS" ./configure "--host=${BUILD_ARCH}-windows" --prefix=$INSTALL_PREFIX --disable-shared --enable-static --disable-dependency-tracking
21+
make -C lib fribidi-unicode-version.h CFLAGS="$FRIBIDI_CFLAGS"
22+
make -C lib gen CFLAGS="$FRIBIDI_CFLAGS"
23+
make -C lib install -j$(nproc) CFLAGS="$CFLAGS $FRIBIDI_CFLAGS"
24+
make install-data-am
25+
26+
27+
echo -e "\n[Build libass]"
28+
cd $SRC_DIR/libass
29+
NOCONFIGURE=1 ./autogen.sh
30+
CFLAGS="$CFLAGS" ./configure "--host=${BUILD_ARCH}-windows" --prefix=$INSTALL_PREFIX --disable-shared --enable-static --disable-asm --disable-dependency-tracking
31+
make install -j$(nproc)
32+
make install-data-am
33+

build-make-dep.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ SRC_DIR=$(pwd)/$1
1010
shift 1
1111
cd $SRC_DIR
1212
if [ -e ./configure ]; then
13-
./configure $@
13+
CFLAGS="$CFLAGS" ./configure $@
1414
fi
1515
make -j$(nproc)
1616
make ${INSTALL_TARGET:-install} PREFIX=$INSTALL_PREFIX

build-meson-dep.cmd

Lines changed: 0 additions & 10 deletions
This file was deleted.

build-meson-dep.sh

Lines changed: 0 additions & 17 deletions
This file was deleted.

build.sh

Lines changed: 48 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ fi
1616
shift 3 || true
1717
FF_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

3535
apply-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
4546
apply-patch FFmpeg ffmpeg.patch
4647
apply-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"
9762
fi
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+
9972
if [ -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

11790
fi
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-
12292
if [ -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"
137104
fi
138105

@@ -141,5 +108,37 @@ if [ -n "$ENABLE_LIBWEBP" ]; then
141108
add_ffargs "--enable-libwebp"
142109
fi
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

Comments
 (0)