From 0d9eeb308d3d09f79b0935ce1309e6c02ea2af44 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=B5=AE=E7=94=9F=E8=8B=A5=E6=A2=A6?= <1070753498@qq.com> Date: Fri, 29 Mar 2024 19:09:25 +0800 Subject: [PATCH] vcpkg manifest; --- .github/workflows/cmake.yml | 26 +++++++++++++++++------ .github/workflows/qmake.yml | 19 +++++++++++------ .github/workflows/readme.yml | 2 +- .github/workflows/toolchain.yml | 32 +++++++++++++++------------- vcpkg.json | 37 +++++++++++++++++++++++++++++++++ 5 files changed, 89 insertions(+), 27 deletions(-) create mode 100644 vcpkg.json diff --git a/.github/workflows/cmake.yml b/.github/workflows/cmake.yml index e63fb41..a6c01ed 100644 --- a/.github/workflows/cmake.yml +++ b/.github/workflows/cmake.yml @@ -14,6 +14,7 @@ on: - '.gitignore' - 'LICENSE' - 'README*' + - 'vcpkg.json' pull_request: paths-ignore: # 下列文件的变更不触发部署,可以自行添加 - '.github/workflows/clean_cache.yml' @@ -26,6 +27,7 @@ on: - '.gitignore' - 'LICENSE' - 'README*' + - 'vcpkg.json' jobs: build: @@ -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 }} @@ -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 @@ -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 @@ -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 diff --git a/.github/workflows/qmake.yml b/.github/workflows/qmake.yml index cfd0ad2..be27b3d 100644 --- a/.github/workflows/qmake.yml +++ b/.github/workflows/qmake.yml @@ -14,6 +14,7 @@ on: - '.gitignore' - 'LICENSE' - 'README*' + - 'vcpkg.json' pull_request: paths-ignore: # 下列文件的变更不触发部署,可以自行添加 - '.github/workflows/clean_cache.yml' @@ -26,6 +27,7 @@ on: - '.gitignore' - 'LICENSE' - 'README*' + - 'vcpkg.json' jobs: build: @@ -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 }} @@ -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 @@ -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 diff --git a/.github/workflows/readme.yml b/.github/workflows/readme.yml index aff09d7..7079ea6 100644 --- a/.github/workflows/readme.yml +++ b/.github/workflows/readme.yml @@ -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 diff --git a/.github/workflows/toolchain.yml b/.github/workflows/toolchain.yml index 594d3a1..693634a 100644 --- a/.github/workflows/toolchain.yml +++ b/.github/workflows/toolchain.yml @@ -22,16 +22,12 @@ 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 @@ -39,7 +35,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 @@ -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' diff --git a/vcpkg.json b/vcpkg.json new file mode 100644 index 0000000..cc21a93 --- /dev/null +++ b/vcpkg.json @@ -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" +} \ No newline at end of file