forked from pinterf/assrender
-
Notifications
You must be signed in to change notification settings - Fork 7
155 lines (140 loc) · 5.06 KB
/
c-cpp.yml
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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
name: C/C++ CI
on: [push]
jobs:
build-linux:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: install deps
run: |
sudo apt-get update && sudo apt-get install -y meson ninja-build
- name: set deps version
run: |
echo "fc_ver=2.14.2" >> $GITHUB_ENV
echo "ft_ver=2.13.2" >> $GITHUB_ENV
echo "hb_ver=8.4.0" >> $GITHUB_ENV
echo "fb_ver=1.0.14" >> $GITHUB_ENV
echo "ass_ver=0.17.2" >> $GITHUB_ENV
- name: build fontconfig
run: |
git clone https://gitlab.freedesktop.org/fontconfig/fontconfig.git -b ${fc_ver} --depth=1 fontconfig-${fc_ver}
cd fontconfig-${fc_ver}
meson --prefix="/usr" --default-library=static build
ninja -C build
sudo ninja -C build install
cd ..
rm -rf fontconfig-${fc_ver}
- name: build freetype
run: |
wget https://download.savannah.gnu.org/releases/freetype/freetype-${ft_ver}.tar.gz
tar -xzf freetype-${ft_ver}.tar.gz && rm freetype-${ft_ver}.tar.gz
cd freetype-${ft_ver}
./configure --prefix=/usr
meson --prefix="/usr" --default-library=static -Dharfbuzz=disabled -Dbrotli=disabled -Dpng=disabled build
meson compile -Cbuild
sudo meson install -Cbuild
cd ..
rm -rf freetype-${ft_ver}
- name: build harbuzz
run: |
git clone --recurse-submodules https://github.com/harfbuzz/harfbuzz.git -b ${hb_ver} --depth=1 harfbuzz-${hb_ver}
cd harfbuzz-${hb_ver}
meson --prefix="/usr" --default-library=static -Dtests=disabled -Dintrospection=disabled -Ddocs=disabled build
meson compile -Cbuild
sudo meson install -Cbuild
cd ..
rm -rf harfbuzz-${hb_ver}
- name: build fribidi
run: |
git clone https://github.com/fribidi/fribidi.git -b v${fb_ver} --depth=1 fribidi-${fb_ver}
cd fribidi-${fb_ver}
meson --prefix="/usr" -Ddocs=false -Dtests=false --backend=ninja --default-library=static build
ninja -C build
sudo ninja -C build install
cd ..
rm -rf fribidi-${fb_ver}
- name: build libass
run: |
git clone https://github.com/libass/libass.git -b ${ass_ver} --depth=1 libass-${ass_ver}
cd libass-${ass_ver}
./autogen.sh
CFLAGS="-fPIC" CXXFLAGS="-fPIC" ./configure --prefix=/usr --disable-shared
make -j2
sudo make install
cd ..
rm -rf libass-${ass_ver}
- name: build
run: |
cmake -B build -S .
cmake --build build --clean-first
- name: set short version
shell: bash
run: |
ver_short=`git rev-parse --short HEAD`
echo "VERSION=$ver_short" >> $GITHUB_ENV
- name: upload
uses: actions/upload-artifact@v4
with:
name: assrender_linux-x64_${{ env.VERSION }}
path: build/src/libassrender.so
build-macos:
runs-on: macos-12
steps:
- uses: actions/checkout@v4
- name: install deps
run: |
brew install cmake libass
- name: build
run: |
cmake -B build -S .
cmake --build build --clean-first
build-mingw:
runs-on: windows-2019
defaults:
run:
shell: msys2 {0}
steps:
- uses: actions/checkout@v4
- uses: msys2/setup-msys2@v2
with:
update: true
install: base-devel git mingw-w64-x86_64-gcc mingw-w64-x86_64-cmake mingw-w64-x86_64-libass
msystem: MINGW64
path-type: inherit
- name: build
run: |
cmake -G "MSYS Makefiles" -B build -S .
cmake --build build --clean-first
build-win:
runs-on: windows-2019
strategy:
matrix:
include:
- target: 'x86'
platform: 'Win32'
- target: 'x64'
platform: 'x64'
steps:
- uses: actions/checkout@v4
- name: install submodules and nasm
shell: cmd
run: |
git submodule update --init --recursive --remote
git clone https://github.com/ShiftMediaProject/VSNASM.git --branch 0.9
.\VSNASM\install_script.bat
- name: force /MT build
shell: bash
run: |
sed -i -e 's|<ClCompile>|&<RuntimeLibrary>MultiThreaded</RuntimeLibrary>|g' SMP/*/SMP/*.vcxproj
sed -i -e 's|<ClCompile>|&<RuntimeLibrary>MultiThreaded</RuntimeLibrary>|g' assrender.vcxproj
- name: add msbuild to PATH
uses: microsoft/setup-msbuild@v2
- name: build
run: MSBuild.exe /t:Rebuild /p:WindowsTargetPlatformVersion=10.0.19041.0 /p:PlatformToolset=v142 /m /p:Configuration=Release /p:Platform=${{matrix.target}}
- name: copy
run: cmake -E copy "bin\Release_${{matrix.platform}}\assrender.dll" dist\${{matrix.target}}\assrender.dll
- name: upload
uses: actions/upload-artifact@v2
with:
name: assrender_bin
path: dist