Skip to content

Commit

Permalink
vcpkg manifest;
Browse files Browse the repository at this point in the history
  • Loading branch information
RealChuan committed Mar 29, 2024
1 parent dfc0ae0 commit 0d9eeb3
Show file tree
Hide file tree
Showing 5 changed files with 89 additions and 27 deletions.
26 changes: 20 additions & 6 deletions .github/workflows/cmake.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ on:
- '.gitignore'
- 'LICENSE'
- 'README*'
- 'vcpkg.json'
pull_request:
paths-ignore: # 下列文件的变更不触发部署,可以自行添加
- '.github/workflows/clean_cache.yml'
Expand All @@ -26,6 +27,7 @@ on:
- '.gitignore'
- 'LICENSE'
- 'README*'
- 'vcpkg.json'

jobs:
build:
Expand All @@ -44,17 +46,21 @@ jobs:
- "RelWithDebInfo"
generators:
- "Ninja"
vcpkg_libs:
- breakpad
vcpkg_ffmpeg_features:
- opengl,ass,bzip2,freetype,fribidi,zlib,gpl,ffmpeg,ffplay,ffprobe

steps:
- name: Restore windows vcpkg
if: startsWith(matrix.os, 'windows')
uses: actions/cache/restore@v3
uses: actions/cache/restore@v4
with:
path: C:\vcpkg\installed
key: ${{ runner.os }}-vcpkg-installed-${{ matrix.os }}
- name: Restore macos or ubuntu vcpkg
if: startsWith(matrix.os, 'macos') || startsWith(matrix.os, 'ubuntu')
uses: actions/cache/restore@v3
uses: actions/cache/restore@v4
with:
path: /usr/local/share/vcpkg/installed
key: ${{ runner.os }}-vcpkg-installed-${{ matrix.os }}
Expand All @@ -66,7 +72,7 @@ jobs:
choco install ninja
ninja --version
cmake --version
vcpkg install breakpad ffmpeg[opengl,ass,bzip2,freetype,fribidi,zlib,gpl] --triplet x64-windows
vcpkg install ${{ matrix.vcpkg_libs }} ffmpeg[${{ matrix.vcpkg_ffmpeg_features }},amf,nvcodec,qsv] --triplet x64-windows
- name: Install dependencies on macos
if: startsWith(matrix.os, 'macos')
shell: bash
Expand All @@ -75,17 +81,18 @@ jobs:
ninja --version
cmake --version
clang --version
vcpkg install breakpad ffmpeg[opengl,ass,bzip2,freetype,fribidi,zlib,gpl] --triplet x64-osx
vcpkg install ${{ matrix.vcpkg_libs }} ffmpeg[${{ matrix.vcpkg_ffmpeg_features }}] --triplet x64-osx
- name: Install dependencies on ubuntu
if: startsWith(matrix.os, 'ubuntu')
shell: bash
run: |
sudo apt-get update
sudo apt-get install ninja-build nasm build-essential libgl1-mesa-dev
sudo apt-get install ninja-build nasm autopoint gperf libgl1-mesa-dev \
libxinerama-dev libxcursor-dev xorg-dev libglu1-mesa-dev
ninja --version
cmake --version
gcc --version
vcpkg install breakpad ffmpeg[opengl,ass,bzip2,freetype,fribidi,zlib,gpl] --triplet x64-linux
vcpkg install ${{ matrix.vcpkg_libs }} ffmpeg[${{ matrix.vcpkg_ffmpeg_features }},amf,nvcodec] --triplet x64-linux
- name: Install Qt
uses: jurplel/install-qt-action@v3
Expand All @@ -99,6 +106,13 @@ jobs:
with:
fetch-depth: 1

# jurplel/install-qt-action@v3, 这个action会修改默认的python版本,
# 会导致部分使用vcpkg的库编译失败,比如libsystemd,所以需要删除vcpkg.json
- name: Delete vcpkg.json
shell: bash
run: |
rm vcpkg.json
- name: Enable Developer Command Prompt
if: startsWith(matrix.os, 'windows')
uses: ilammy/msvc-dev-cmd@v1.12.1
Expand Down
19 changes: 13 additions & 6 deletions .github/workflows/qmake.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ on:
- '.gitignore'
- 'LICENSE'
- 'README*'
- 'vcpkg.json'
pull_request:
paths-ignore: # 下列文件的变更不触发部署,可以自行添加
- '.github/workflows/clean_cache.yml'
Expand All @@ -26,6 +27,7 @@ on:
- '.gitignore'
- 'LICENSE'
- 'README*'
- 'vcpkg.json'

jobs:
build:
Expand All @@ -40,17 +42,21 @@ jobs:
- ubuntu-latest
qt_ver:
- 6.6.2
vcpkg_libs:
- breakpad
vcpkg_ffmpeg_features:
- opengl,ass,bzip2,freetype,fribidi,zlib,gpl,ffmpeg,ffplay,ffprobe

steps:
- name: Restore windows vcpkg
if: startsWith(matrix.os, 'windows')
uses: actions/cache/restore@v3
uses: actions/cache/restore@v4
with:
path: C:\vcpkg\installed
key: ${{ runner.os }}-vcpkg-installed-${{ matrix.os }}
- name: Restore macos or ubuntu vcpkg
if: startsWith(matrix.os, 'macos') || startsWith(matrix.os, 'ubuntu')
uses: actions/cache/restore@v3
uses: actions/cache/restore@v4
with:
path: /usr/local/share/vcpkg/installed
key: ${{ runner.os }}-vcpkg-installed-${{ matrix.os }}
Expand All @@ -62,7 +68,7 @@ jobs:
choco install ninja
ninja --version
cmake --version
vcpkg install breakpad ffmpeg[opengl,ass,bzip2,freetype,fribidi,zlib,gpl] --triplet x64-windows
vcpkg install ${{ matrix.vcpkg_libs }} ffmpeg[${{ matrix.vcpkg_ffmpeg_features }},amf,nvcodec,qsv] --triplet x64-windows
- name: Install dependencies on macos
if: startsWith(matrix.os, 'macos')
shell: bash
Expand All @@ -71,17 +77,18 @@ jobs:
ninja --version
cmake --version
clang --version
vcpkg install breakpad ffmpeg[opengl,ass,bzip2,freetype,fribidi,zlib,gpl] --triplet x64-osx
vcpkg install ${{ matrix.vcpkg_libs }} ffmpeg[${{ matrix.vcpkg_ffmpeg_features }}] --triplet x64-osx
- name: Install dependencies on ubuntu
if: startsWith(matrix.os, 'ubuntu')
shell: bash
run: |
sudo apt-get update
sudo apt-get install ninja-build nasm build-essential libgl1-mesa-dev
sudo apt-get install ninja-build nasm autopoint gperf libgl1-mesa-dev \
libxinerama-dev libxcursor-dev xorg-dev libglu1-mesa-dev
ninja --version
cmake --version
gcc --version
vcpkg install breakpad ffmpeg[opengl,ass,bzip2,freetype,fribidi,zlib,gpl] --triplet x64-linux
vcpkg install ${{ matrix.vcpkg_libs }} ffmpeg[${{ matrix.vcpkg_ffmpeg_features }},amf,nvcodec] --triplet x64-linux
- name: Install Qt
uses: jurplel/install-qt-action@v3
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/readme.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 12.x
node-version: 20.x
# ISO Langusge Codes: https://cloud.google.com/translate/docs/languages
- name: Adding README - English
uses: dephraiim/translate-readme@main
Expand Down
32 changes: 18 additions & 14 deletions .github/workflows/toolchain.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,24 +22,20 @@ jobs:
- ubuntu-latest
qt_ver:
- 6.6.2
vcpkg_libs:
- breakpad
vcpkg_ffmpeg_features:
- opengl,ass,bzip2,freetype,fribidi,zlib,gpl,ffmpeg,ffplay,ffprobe

steps:
- name: Install Qt
uses: jurplel/install-qt-action@v3
with:
version: ${{ matrix.qt_ver }}
install-deps: 'true'
modules: 'qt5compat qtnetworkauth qtmultimedia qtimageformats'
cache: 'true'

- name: Install dependencies on windows
if: startsWith(matrix.os, 'windows')
shell: bash
run: |
choco install ninja
ninja --version
cmake --version
vcpkg install breakpad ffmpeg[opengl,ass,bzip2,freetype,fribidi,zlib,gpl] --triplet x64-windows
vcpkg install ${{ matrix.vcpkg_libs }} ffmpeg[${{ matrix.vcpkg_ffmpeg_features }},amf,nvcodec,qsv] --triplet x64-windows
- name: Install dependencies on macos
if: startsWith(matrix.os, 'macos')
shell: bash
Expand All @@ -48,28 +44,36 @@ jobs:
ninja --version
cmake --version
clang --version
vcpkg install breakpad ffmpeg[opengl,ass,bzip2,freetype,fribidi,zlib,gpl] --triplet x64-osx
vcpkg install ${{ matrix.vcpkg_libs }} ffmpeg[${{ matrix.vcpkg_ffmpeg_features }}] --triplet x64-osx
- name: Install dependencies on ubuntu
if: startsWith(matrix.os, 'ubuntu')
shell: bash
run: |
sudo apt-get update
sudo apt-get install ninja-build nasm build-essential libgl1-mesa-dev
sudo apt-get install ninja-build nasm autopoint gperf libgl1-mesa-dev \
libxinerama-dev libxcursor-dev xorg-dev libglu1-mesa-dev
ninja --version
cmake --version
gcc --version
vcpkg install breakpad ffmpeg[opengl,ass,bzip2,freetype,fribidi,zlib,gpl] --triplet x64-linux
vcpkg install ${{ matrix.vcpkg_libs }} ffmpeg[${{ matrix.vcpkg_ffmpeg_features }},amf,nvcodec] --triplet x64-linux
- name: cache windows vcpkg
if: startsWith(matrix.os, 'windows')
uses: actions/cache/save@v3
uses: actions/cache/save@v4
with:
path: C:\vcpkg\installed
key: ${{ runner.os }}-vcpkg-installed-${{ matrix.os }}
- name: cache macos or ubuntu vcpkg
if: startsWith(matrix.os, 'macos') || startsWith(matrix.os, 'ubuntu')
uses: actions/cache/save@v3
uses: actions/cache/save@v4
with:
path: /usr/local/share/vcpkg/installed
key: ${{ runner.os }}-vcpkg-installed-${{ matrix.os }}

- name: Install Qt
uses: jurplel/install-qt-action@v3
with:
version: ${{ matrix.qt_ver }}
install-deps: 'true'
modules: 'qt5compat qtnetworkauth qtmultimedia qtimageformats'
cache: 'true'
37 changes: 37 additions & 0 deletions vcpkg.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
{
"$schema": "https://raw.githubusercontent.com/microsoft/vcpkg-tool/main/docs/vcpkg.schema.json",
"name": "qt-ffmpeg",
"version": "0.0.1",
"description": "manifest",
"dependencies": [
"breakpad",
{
"name": "ffmpeg",
"features": [
"opengl",
"ass",
"bzip2",
"freetype",
"fribidi",
"zlib",
"gpl",
"ffmpeg",
"ffplay",
"ffprobe",
{
"name": "qsv",
"platform": "windows"
},
{
"name": "amf",
"platform": "windows | linux"
},
{
"name": "nvcodec",
"platform": "windows | linux"
}
]
}
],
"builtin-baseline": "3c76dc55f8bd2b7f4824bcd860055094bfbbb9ea"
}

0 comments on commit 0d9eeb3

Please sign in to comment.