From 6f2df39b68d416899db79ff458e3200575cc9083 Mon Sep 17 00:00:00 2001 From: LuckyTurtleDev Date: Thu, 18 Apr 2024 17:43:07 +0200 Subject: [PATCH] add ffmpeg-build feature flag (#53) --- .github/workflows/rust.yml | 7 ++++++- mstickereditor/Cargo.toml | 5 +++++ mstickerlib/Cargo.toml | 7 ++++++- 3 files changed, 17 insertions(+), 2 deletions(-) diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index eb3e0ba..949a7fa 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -7,7 +7,8 @@ on: types: [released] env: - PACKAGES: libavc1394-dev libavdevice-dev + PACKAGES: libavc1394-dev libavdevice-dev nasm + #nasm is needed to build fmpeg from source, if ffmpeg-future is aviable jobs: test-linux: @@ -74,6 +75,10 @@ jobs: ~/.cargo/registry target key: "${{runner.os}} Rust ${{steps.rust-toolchain.outputs.cachekey}} Lock ${{hashFiles('Cargo.lock')}}" + - name: install cargo-all-features + uses: baptiste0928/cargo-install@v2 + with: + crate: cargo-all-features - run: cargo test --no-default-features --features ffmpeg,log -- --include-ignored if: github.event_name != 'pull_request' env: diff --git a/mstickereditor/Cargo.toml b/mstickereditor/Cargo.toml index f736166..8a5c71f 100644 --- a/mstickereditor/Cargo.toml +++ b/mstickereditor/Cargo.toml @@ -32,6 +32,7 @@ url = "2.2" [features] default = ["ffmpeg", "lottie"] ffmpeg = ["mstickerlib/ffmpeg"] +ffmpeg-build = ["ffmpeg", "mstickerlib/ffmpeg-build"] lottie = ["mstickerlib/lottie"] [profile.release] @@ -40,3 +41,7 @@ opt-level = 3 [lints] workspace = true + + +[package.metadata.cargo-all-features] +denylist = ["ffmpeg-build"] diff --git a/mstickerlib/Cargo.toml b/mstickerlib/Cargo.toml index e2b9ca4..82b23d0 100644 --- a/mstickerlib/Cargo.toml +++ b/mstickerlib/Cargo.toml @@ -46,6 +46,7 @@ rustc_version = "0.4.0" [features] default = ["ffmpeg", "log", "lottie"] ffmpeg = ["dep:ffmpeg", "dep:tempfile", "dep:webp-animation"] +ffmpeg-build = ["ffmpeg", "ffmpeg/build"] log = ["dep:log"] lottie = ["dep:lottieconv", "dep:tempfile", "dep:webp-animation", "dep:gif"] @@ -54,4 +55,8 @@ lto = true opt-level = 3 [lints] -workspace = true \ No newline at end of file +workspace = true + + +[package.metadata.cargo-all-features] +denylist = ["ffmpeg-build"]