Skip to content

Commit

Permalink
Put AVIF native decoder behind conditional compilation instead of a g…
Browse files Browse the repository at this point in the history
…lobal disable
  • Loading branch information
foresterre committed Jan 3, 2025
1 parent d137bf3 commit df94cbc
Show file tree
Hide file tree
Showing 6 changed files with 214 additions and 8 deletions.
88 changes: 87 additions & 1 deletion .github/workflows/msrv.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,18 @@ on:
jobs:
msrv_stable:
name: msrv_stable
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
build: [ ubuntu, macos, windows ]
include:
- build: ubuntu
os: ubuntu-latest
- build: macos
os: macos-latest
- build: windows
os: windows-latest
runs-on: ${{ matrix.os }}
continue-on-error: true
steps:
- name: checkout_repo
Expand All @@ -28,9 +39,84 @@ jobs:
- name: install_nasm
uses: ilammy/setup-nasm@v1

- name: feature_dav1d_setup
uses: actions/setup-python@v4
with:
python-version: '3.9'

- name: feature_dav1d_pip
run: |
pip install -U pip
pip install -U wheel setuptools
pip install -U meson ninja
- name: feature_dav1d_build_david_ubuntu
if: ${{ matrix.build == 'ubuntu' }}
env:
DAV1D_DIR: libdav1d
LIB_PATH: lib/x86_64-linux-gnu
run: |
git clone --branch 1.5.0 --depth 1 https://code.videolan.org/videolan/dav1d.git
cd dav1d
meson build -Dprefix=$HOME/$DAV1D_DIR -Denable_tools=false -Denable_examples=false --buildtype release
ninja -C build
ninja -C build install
echo "PKG_CONFIG_PATH=$HOME/$DAV1D_DIR/$LIB_PATH/pkgconfig" >> $GITHUB_ENV
echo "LD_LIBRARY_PATH=$HOME/$DAV1D_DIR/$LIB_PATH" >> $GITHUB_ENV
- name: feature_dav1d_build_david_macos
if: ${{ matrix.build == 'macos' }}
env:
DAV1D_DIR: libdav1d
LIB_PATH: lib
run: |
git clone --branch 1.5.0 --depth 1 https://code.videolan.org/videolan/dav1d.git
cd dav1d
meson build -Dprefix=$HOME/$DAV1D_DIR -Denable_tools=false -Denable_examples=false --buildtype release
ninja -C build
ninja -C build install
echo "PKG_CONFIG_PATH=$HOME/$DAV1D_DIR/$LIB_PATH/pkgconfig" >> $GITHUB_ENV
echo "LD_LIBRARY_PATH=$HOME/$DAV1D_DIR/$LIB_PATH" >> $GITHUB_ENV
- uses: ilammy/msvc-dev-cmd@v1
if: ${{ matrix.build == 'windows' }}

- name: feature_dav1d_build_david_windows_env
if: ${{ matrix.build == 'windows' }}
shell: bash
run: |
echo "PKG_CONFIG=c:\build\bin\pkg-config.exe" >> $GITHUB_ENV
echo "PKG_CONFIG_PATH=C:\build\lib\pkgconfig" >> $GITHUB_ENV
echo "C:\build\bin" >> $GITHUB_PATH
- name: feature_dav1d_build_david_windows_pkg_config
if: ${{ matrix.build == 'windows' }}
run: |
git clone --branch meson-glib-subproject --depth 1 https://gitlab.freedesktop.org/tpm/pkg-config.git
cd pkg-config
meson build -Dprefix=C:\build --buildtype release
ninja -C build
ninja -C build install
- name: feature_dav1d_build_david_windows
if: ${{ matrix.build == 'windows' }}
run: |
git clone --branch 1.5.0 --depth 1 https://code.videolan.org/videolan/dav1d.git
cd dav1d
meson build -Dprefix=C:\build -Denable_tools=false -Denable_examples=false --buildtype release
ninja -C build
ninja -C build install
- name: run_cargo_msrv_verify
run: cargo msrv verify --output-format json

- name: run_cargo_msrv_on_verify_failure
if: ${{ failure() }}
run: cargo msrv find --output-format json

- name: run_cargo_msrv_verify
run: cargo msrv verify --features dav1d --output-format json

- name: run_cargo_msrv_on_verify_failure
if: ${{ failure() }}
run: cargo msrv find --features dav1d --output-format json
4 changes: 2 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,11 @@ changes.

### Notable dependency updates

- Updated [image](https://github.com/image-rs/image) to 0.25.2
- Updated [image](https://github.com/image-rs/image) to 0.25.5

### Disabled

- Disabled AVIF decoder for now due to cross-platform compilation issues (dav1d-rs).
- Disabled AVIF decoder by default due to cross-platform compilation issues (enable on compile time using feature "dav1d"; requires libdav1d to be present).

## [0.22.4] - 2023-09-17

Expand Down
120 changes: 117 additions & 3 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ keywords = ["image", "converter", "cli", "front-end", "image-cli"]
categories = ["multimedia::images", "command-line-utilities"]

edition = "2021"
rust-version = "1.79"
rust-version = "1.80"

[package.metadata.release]
tag-prefix = ""
Expand Down Expand Up @@ -56,6 +56,7 @@ yare = "3"
default = ["imageproc-ops", "nasm"]
imageproc-ops = ["sic_core/imageproc-ops", "sic_cli_ops/imageproc-ops", "sic_image_engine/imageproc-ops", "sic_parser/imageproc-ops"]
nasm = ["sic_core/nasm"]
dav1d = ["sic_core/dav1d"]

output-test-images = []

Expand Down
3 changes: 2 additions & 1 deletion crates/sic_core/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ repository = "https://github.com/foresterre/sic"
readme = "../../README.md"

edition = "2021"
rust-version = "1.61"
rust-version = "1.80"

[dependencies]
image = { version = "0.25.5", features = ["rayon"] }
Expand All @@ -18,4 +18,5 @@ thiserror = "2"

[features]
nasm = ["image/nasm"]
dav1d = ["image/avif-native"]
imageproc-ops = ["imageproc", "ab_glyph"]
4 changes: 4 additions & 0 deletions deny.toml
Original file line number Diff line number Diff line change
Expand Up @@ -25,3 +25,7 @@ expression = "BSD-3-Clause"
license-files = [
{ path = "LICENSE.md", hash = 0xf0600744 },
]

[[licenses.exceptions]]
allow = ["MPL-2.0"]
name = "mp4parse"

0 comments on commit df94cbc

Please sign in to comment.