Skip to content

Commit

Permalink
chore: Do more setup work to compile dav1d on windows
Browse files Browse the repository at this point in the history
  • Loading branch information
foresterre committed May 26, 2024
1 parent 31363f6 commit 93c4116
Show file tree
Hide file tree
Showing 7 changed files with 40 additions and 17 deletions.
2 changes: 1 addition & 1 deletion .justfiles/clippy.just
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
clippy:
cargo clippy --manifest-path {{justfile_directory() / 'Cargo.toml'}} --all-targets --all-features -- -D warnings
cargo clippy --manifest-path {{ join(justfile_directory(), 'Cargo.toml') }} --all-targets --all-features -- -D warnings
36 changes: 28 additions & 8 deletions .justfiles/dav1d.just
Original file line number Diff line number Diff line change
@@ -1,22 +1,42 @@
dav1d: install

clear:
rm -rf {{justfile_directory() / 'target' / 'dav1d_build' }}
dav1d: dirs

install-meson:
python --version
pip install -U meson setuptools ninja

clone:
-git clone --branch 1.3.0 --depth 1 https://code.videolan.org/videolan/dav1d.git {{justfile_directory() / 'target' / 'dav1d'}}
-git clone --branch 1.3.0 --depth 1 https://code.videolan.org/videolan/dav1d.git {{ join(justfile_directory(), 'target', 'dav1d') }}

[unix]
prepare: clone install-meson
pwd
meson setup -Denable_tools=false -Denable_examples=false --buildtype release {{ join(justfile_directory(), 'target', 'dav1d_build') }} {{ join(justfile_directory(), 'target', 'dav1d') }}

[windows]
prepare: clone install-meson
pwd
meson setup -Denable_tools=false -Denable_examples=false --buildtype release {{justfile_directory() / 'target' / 'dav1d_build' }} {{justfile_directory() / 'target' / 'dav1d' }}
$LinkGlob = "VC\Tools\MSVC\*\bin\Hostx64\x64"
$env:PATH = "$env:PATH;${env:ProgramFiles(x86)}\Microsoft Visual Studio\Installer"
$LinkPath = vswhere -latest -products * -find "$LinkGlob" | Select-Object -Last 1
$env:PATH = "$env:PATH;$LinkPath"
meson setup -Denable_tools=false -Denable_examples=false --buildtype release {{ join(justfile_directory(), 'target', 'dav1d_build') }} {{ join(justfile_directory(), 'target', 'dav1d') }}

compile: prepare
pwd
ninja -C {{justfile_directory() / 'target' / 'dav1d_build' }}
ninja -C {{ join(justfile_directory(), 'target', 'dav1d_build') }}

install: compile
ninja -C {{justfile_directory() / 'target' / 'dav1d_build' }} install
ninja -C {{ join(justfile_directory(), 'target', 'dav1d_build') }} install

dirs:
@echo {{ just_executable() }}
@echo {{ join(justfile_directory(), 'target', 'dav1d') }}
@echo {{ join(justfile_directory(), 'target', 'dav1d_build') }}
@echo 'After compiling dav1d set:'
@echo PKG_CONFIG_PATH={{ join(justfile_directory(), 'target', 'dav1d_build', 'pkgconfig') }}
@echo LD_LIBRARY_PATH={{ join(justfile_directory(), 'target', 'dav1d_build') }}

[confirm("Are you sure you want to remove dav1d and dav1d_build?")]
clear:
rm -rf {{ join(justfile_directory(), 'target', 'dav1d') }}
rm -rf {{ join(justfile_directory(), 'target', 'dav1d_build') }}
2 changes: 1 addition & 1 deletion .justfiles/deny.just
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
deny: workspace

workspace: install-cargo-deny
cargo deny --log-level error --workspace --manifest-path {{justfile_directory() / 'Cargo.toml'}} check
cargo deny --log-level error --workspace --manifest-path {{ join(justfile_directory(), 'Cargo.toml') }} check

install-cargo-deny:
cargo install cargo-deny
4 changes: 2 additions & 2 deletions .justfiles/fmt.just
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
fmt: run

run:
cargo fmt --all --manifest-path {{ justfile_directory() / 'Cargo.toml'}}
cargo fmt --all --manifest-path {{ join(justfile_directory(), 'Cargo.toml') }}

check:
cargo fmt --all --manifest-path {{ justfile_directory() / 'Cargo.toml'}} -- --check
cargo fmt --all --manifest-path {{ join(justfile_directory(), 'Cargo.toml') }} -- --check
4 changes: 2 additions & 2 deletions .justfiles/msrv.just
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
msrv: verify

run: install-cargo-msrv
cargo msrv --manifest-path {{justfile_directory() / 'Cargo.toml'}}
cargo msrv --manifest-path {{ join(justfile_directory(), 'Cargo.toml') }}

verify: install-cargo-msrv
cargo msrv verify --manifest-path {{justfile_directory() / 'Cargo.toml'}}
cargo msrv verify --manifest-path {{ join(justfile_directory(), 'Cargo.toml') }}

install-cargo-msrv:
cargo install cargo-msrv --version 0.16.0-beta.20
4 changes: 2 additions & 2 deletions .justfiles/test.just
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
test: all no-default-features

all:
cargo test --all
cargo test --all --manifest-path {{ join(justfile_directory(), 'Cargo.toml') }}

no-default-features:
cargo test --all --no-default-features
cargo test --all --no-default-features --manifest-path {{ join(justfile_directory(), 'Cargo.toml') }}
5 changes: 4 additions & 1 deletion justfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,10 @@ mod msrv '.justfiles/msrv.just'
mod test '.justfiles/test.just'
mod dav1d '.justfiles/dav1d.just'


[windows]
default:
@echo 'On Windows, run just using:'
@echo 'just --unstable --shell pwsh.exe --shell-arg -c'

before-push:
# do fmt
Expand Down

0 comments on commit 93c4116

Please sign in to comment.