Skip to content

Commit db5c699

Browse files
authored
Merge pull request #48 from seiya-dev/dev
Switch submodule build system to meson + new parameters + Use frame properties if they available for "YCbCr Matrix: None"
2 parents ae23131 + c63e1d0 commit db5c699

32 files changed

+1379
-1379
lines changed

.github/dependabot.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
version: 2
2+
updates:
3+
- package-ecosystem: "github-actions"
4+
directory: "/"
5+
schedule:
6+
interval: weekly

.github/workflows/check-smp.yml

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

.github/workflows/github-ci.yml

Lines changed: 107 additions & 72 deletions
Original file line numberDiff line numberDiff line change
@@ -5,101 +5,136 @@ on:
55
pull_request:
66
workflow_dispatch: #
77

8+
env:
9+
ass_repo: https://github.com/libass/libass
10+
ass_ver: 0.17.4
11+
avs_repo: https://github.com/AviSynth/AviSynthPlus
12+
avs_ver: 3.7.5
13+
avs_date: 20250420
14+
815
jobs:
916
build-linux:
1017
runs-on: ubuntu-latest
1118
steps:
1219
- name: Git checkout
13-
uses: actions/checkout@v3
20+
uses: actions/checkout@v4
1421
- name: Install dependencies
1522
run: |
16-
sudo apt-get update
17-
sudo apt-get install cmake git ninja-build checkinstall
18-
sudo apt-get install -y --no-install-recommends build-essential g++ gcc libass-dev pkg-config
19-
git clone https://github.com/AviSynth/AviSynthPlus avsplus
20-
cd avsplus
21-
cmake -G "Ninja" -B avisynth-build -S .
22-
cd avisynth-build
23-
ninja
24-
sudo checkinstall --pkgname=avisynth --pkgversion="$(grep -r Version avs_core/avisynth.pc | cut -f2 -d " ")-$(date --rfc-3339=date | sed 's/-//g')-git" --backup=no --deldoc=yes --delspec=yes --deldesc=yes --strip=yes --stripso=yes --addso=yes --fstrans=no --default ninja install
25-
- name: Build binary
23+
sudo apt-get update && sudo apt-get install -y ninja-build nasm libfontconfig1-dev meson
24+
25+
git clone ${{ env.avs_repo }}.git -b v${{ env.avs_ver }} --depth=1 avsplus
26+
27+
cd ./avsplus
28+
cmake -DCMAKE_INSTALL_PREFIX=/usr/local -S . -B avisynth-build
29+
cmake --build avisynth-build --config Release -j 2
30+
sudo cmake --install avisynth-build --config Release
31+
cd ..
32+
33+
git clone ${{ env.ass_repo }}.git -b ${{ env.ass_ver }} --depth=1 libass
34+
35+
cd ./libass
36+
meson wrap update-db
37+
meson wrap install fribidi
38+
meson wrap install freetype2
39+
meson wrap install expat
40+
meson wrap install harfbuzz
41+
meson wrap install libpng
42+
meson wrap install zlib
43+
44+
meson setup build -Ddefault_library=static -Dbuildtype=release -Dasm=enabled -Dc_std=c11 -Dcpp_std=c++17
45+
meson compile -C build
46+
sudo meson install -C build
47+
- name: Build & Save binary
2648
run: |
2749
cmake -B build -S .
2850
cmake --build build --clean-first
29-
- name: Copy binary
30-
run: cmake -E copy "build/src/libassrender.so" "dist/libassrender.so"
51+
cmake -E copy "build/src/libassrender.so" "dist/libassrender.so"
3152
- name: Upload artifact
32-
uses: actions/upload-artifact@v2
53+
uses: actions/upload-artifact@v4
3354
with:
3455
name: assrender_bin_linux
3556
path: dist
3657

3758
build-win:
38-
runs-on: windows-2019
59+
runs-on: windows-latest
3960
steps:
4061
- name: Git checkout
41-
uses: actions/checkout@v3
62+
uses: actions/checkout@v4
4263
- name: Install dependencies
4364
run: |
44-
git submodule update --init --recursive
45-
git clone https://github.com/ShiftMediaProject/VSYASM.git
46-
.\VSYASM\install_script.bat
47-
git clone https://github.com/ShiftMediaProject/VSNASM.git
48-
.\VSNASM\install_script.bat
49-
md avsplus
50-
# - name: Install MSYS2 with dependencies
51-
# uses: msys2/setup-msys2@v2
52-
# with:
53-
# update: true
54-
# install: base-devel git mingw-w64-x86_64-gcc mingw-w64-x86_64-cmake mingw-w64-x86_64-libass
55-
# msystem: MINGW64
56-
# path-type: inherit
57-
- name: Parse AviSynth+ release metadata
58-
uses: actions/github-script@v6
59-
with:
60-
script: |
61-
const req = await github.request('https://api.github.com/repos/avisynth/avisynthplus/releases');
62-
const data = req.data;
63-
let link = '';
64-
for(let rel of data){
65-
if(rel.prerelease||rel.draft){
66-
continue;
67-
}
68-
for(let asset of rel.assets){
69-
if(asset.name.match(/-filesonly.7z$/i)){
70-
link = asset.browser_download_url;
71-
}
72-
}
73-
if(link != ''){
74-
break;
75-
}
76-
}
77-
core.exportVariable('PACKAGE_URL', link);
78-
- name: Download AviSynth+ latest release
79-
run: curl -L "${{ env.PACKAGE_URL }}" -o "./avsplus/avisynthplus-latest-filesonly.7z"
80-
- name: Move libs files
81-
run: |
65+
choco install ninja nasm pkgconfiglite
66+
67+
python -m pip install --upgrade pip
68+
pip install meson
69+
70+
curl -L "${{ env.avs_repo }}/releases/download/v${{ env.avs_ver }}/AviSynthPlus_${{ env.avs_ver }}_${{ env.avs_date }}-filesonly.7z" `
71+
--create-dirs -o "./avsplus/avisynthplus-latest-filesonly.7z"
8272
7z e "avsplus\*-filesonly.7z" -o"lib\x86-32" "*\x86\c_api\AviSynth.lib"
8373
7z e "avsplus\*-filesonly.7z" -o"lib\x86-64" "*\x64\c_api\AviSynth.lib"
84-
- name: Add MSBuild to PATH
85-
uses: microsoft/setup-msbuild@v1
86-
- name: Build x86 binary
87-
run: MSBuild.exe /t:Rebuild /p:PlatformToolset=v142 /m /p:Configuration=Release /p:Platform=x86
88-
- name: Build x64 binary
89-
run: MSBuild.exe /t:Rebuild /p:PlatformToolset=v142 /m /p:Configuration=Release /p:Platform=x64
90-
# - name: Build MINGW64 binary
91-
# shell: msys2 {0}
92-
# run: |
93-
# cmake -G "MinGW Makefiles" -B build -S .
94-
# cmake --build build --config Release --clean-first
95-
- name: Copy x86 binary
96-
run: cmake -E copy "bin\Release_Win32\assrender.dll" "dist\Release_x86\assrender.dll"
97-
- name: Copy x64 binary
98-
run: cmake -E copy "bin\Release_x64\assrender.dll" "dist\Release_x64\assrender.dll"
99-
# - name: Copy MINGW64 binary
100-
# run: cmake -E copy "build\src\assrender.dll" "dist\Release_MINGW64\assrender.dll"
74+
75+
git clone ${{ env.ass_repo }}.git -b ${{ env.ass_ver }} --depth=1 libass
76+
77+
cd ./libass
78+
meson wrap update-db
79+
meson wrap install fribidi
80+
meson wrap install fontconfig
81+
meson wrap install freetype2
82+
meson wrap install expat
83+
meson wrap install harfbuzz
84+
meson wrap install libpng
85+
meson wrap install zlib
86+
- name: Setup MSVC (x64)
87+
uses: ilammy/msvc-dev-cmd@v1
88+
with:
89+
arch: x64
90+
- name: Meson + CMake build (x64)
91+
env:
92+
PKG_CONFIG_PATH: C:/assdeps/x64/lib/pkgconfig
93+
run: |
94+
cd libass
95+
meson setup build_x64 `
96+
--prefix "C:/assdeps/x64" `
97+
--libdir "lib" `
98+
-Ddefault_library=static `
99+
-Dbuildtype=release `
100+
-Dasm=enabled `
101+
-Db_vscrt=static_from_buildtype `
102+
-Dc_std=c11 `
103+
-Dcpp_std=c++17
104+
meson compile -C build_x64
105+
meson install -C build_x64
106+
cd ..
107+
108+
cmake -D CMAKE_MSVC_RUNTIME_LIBRARY=MultiThreaded -A x64 -S . -B build_x64
109+
msbuild /t:Rebuild /m /p:Configuration=Release /p:Platform=x64 ".\build_x64\assrender.sln"
110+
cmake -E copy "build_x64\src\Release\assrender.dll" "dist\Release_x64\assrender.dll"
111+
- name: Setup MSVC (Win32)
112+
uses: ilammy/msvc-dev-cmd@v1
113+
with:
114+
arch: x86
115+
- name: Meson + CMake build (Win32)
116+
env:
117+
PKG_CONFIG_PATH: C:/assdeps/x86/lib/pkgconfig
118+
run: |
119+
cd libass
120+
meson setup build_Win32 `
121+
--prefix "C:/assdeps/x86" `
122+
--libdir "lib" `
123+
-Ddefault_library=static `
124+
-Dbuildtype=release `
125+
-Dasm=enabled `
126+
-Db_vscrt=static_from_buildtype `
127+
-Dc_std=c11 `
128+
-Dcpp_std=c++17
129+
meson compile -C build_Win32
130+
meson install -C build_Win32
131+
cd ..
132+
133+
cmake -D CMAKE_MSVC_RUNTIME_LIBRARY=MultiThreaded -A Win32 -S . -B build_Win32
134+
msbuild /t:Rebuild /m /p:Configuration=Release /p:Platform=Win32 ".\build_Win32\assrender.sln"
135+
cmake -E copy "build_Win32\src\Release\assrender.dll" "dist\Release_Win32\assrender.dll"
101136
- name: Upload artifact
102-
uses: actions/upload-artifact@v2
137+
uses: actions/upload-artifact@v4
103138
with:
104139
name: assrender_bin_win
105140
path: dist

.gitignore

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
lib/*/avisynth.lib
2+
*.7z
23

34
CMakeCache.txt
45
CMakeFiles/*
@@ -11,6 +12,8 @@ cmake.db
1112
*.sdf
1213
*.suo
1314
*.user
15+
*.wrap
16+
wrapdb.json
1417
#cmake generated files
1518
cmake_install.cmake
1619
cmake_uninstall.cmake
@@ -25,8 +28,11 @@ avsplus/
2528
SMP/
2629
VSNASM/
2730
VSYASM/
31+
libass*
32+
testbuild.bat
2833

2934
#*/build/.vs
35+
build/*
3036
*/build/Win32
3137
*/build/x64
3238
Test

.gitmodules

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

CMakeLists.txt

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,15 @@
1-
CMAKE_MINIMUM_REQUIRED(VERSION 3.12)
2-
PROJECT(assrender)
1+
cmake_minimum_required(VERSION 3.15)
2+
project(assrender)
33

44
include(GNUInstallDirs)
55

6-
ADD_SUBDIRECTORY(src)
6+
if(MINGW)
7+
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -static-libgcc -Wl,--add-stdcall-alias")
8+
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=c99 -Wpedantic")
9+
set(CMAKE_SHARED_LINKER_FLAGS_RELEASE "-s")
10+
endif()
711

8-
IF(MINGW)
9-
SET(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -static-libgcc -Wl,--add-stdcall-alias")
10-
SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=c99 -Wpedantic")
11-
SET(CMAKE_SHARED_LINKER_FLAGS_RELEASE "-s")
12-
SET(CMAKE_C_FLAGS_RELEASE "-O3")
13-
ENDIF()
12+
add_subdirectory(src)
1413

1514
# uninstall target
1615
configure_file(

SMP/fontconfig

Lines changed: 0 additions & 1 deletion
This file was deleted.

SMP/freetype2

Lines changed: 0 additions & 1 deletion
This file was deleted.

SMP/fribidi

Lines changed: 0 additions & 1 deletion
This file was deleted.

SMP/harfbuzz

Lines changed: 0 additions & 1 deletion
This file was deleted.

0 commit comments

Comments
 (0)