Compare commits

...

4 Commits

Author SHA1 Message Date
2e69dae28b Release
Some checks failed
Release / release (push) Failing after 3m7s
Test / test (push) Successful in 3m40s
2025-05-16 10:27:52 -05:00
e121945a7c Update CHANGELOG. 2025-05-16 10:27:36 -05:00
6a2182ce52 chore: Update to Bevy 0.16. 2025-05-16 10:26:13 -05:00
7b0b3d8262 chore: Add Nix-based build and CI configuration. 2025-05-16 10:05:46 -05:00
8 changed files with 144 additions and 29 deletions

1
.envrc Normal file
View File

@ -0,0 +1 @@
use flake

View File

@ -6,11 +6,7 @@ on:
jobs:
test:
strategy:
matrix:
# os: [windows-latest, ubuntu-latest, macos-latest]
os: [ubuntu-latest]
runs-on: ${{ matrix.os }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/cache@v4
@ -26,12 +22,7 @@ jobs:
~/.cargo/git/db/
target/
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
- uses: dtolnay/rust-toolchain@master
with:
toolchain: stable
components: rustfmt, clippy
- name: install Linux build dependencies
run: sudo apt-get update; sudo apt-get install -y --no-install-recommends libasound2-dev libudev-dev libwayland-dev libclang-dev cmake
if: runner.os == 'linux'
- uses: actions/setup-python@v3
- uses: pre-commit/action@v3.0.1
- name: Install Nix
uses: https://github.com/cachix/install-nix-action@v31
- name: Test
run: nix develop --command pre-commit run -a

3
.gitignore vendored
View File

@ -1,3 +1,4 @@
/target
*.dll
Cargo.lock
Cargo.lock
.direnv

View File

@ -2,6 +2,13 @@
All notable changes to this project will be documented in this file.
## Version 0.10.0 - 2025-05-16
### Miscellaneous Tasks
- Add Nix-based build and CI configuration.
- Update to Bevy 0.16.
## Version 0.9.1 - 2025-01-07
### Miscellaneous Tasks

View File

@ -1,6 +1,6 @@
[package]
name = "bevy_synthizer"
version = "0.9.1"
version = "0.10.0"
authors = ["Nolan Darilek <nolan@thewordnerd.info>"]
description = "A Bevy plugin for Synthizer, a library for 3D audio and synthesis with a focus on games and VR applications"
license = "MIT OR Apache-2.0"
@ -10,12 +10,12 @@ repository = "https://labs.lightsout.games/projects/bevy_synthizer"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[dependencies]
bevy = { version = "0.15", default-features = false, features = ["bevy_asset"] }
bevy = { version = "0.16", default-features = false, features = ["bevy_asset"] }
synthizer = "0.5.6"
thiserror = "1"
thiserror = "2"
[dev-dependencies]
bevy = { version = "0.15", default-features = true }
bevy = { version = "0.16", default-features = true }
[package.metadata.release]
publish = false

61
flake.lock Normal file
View File

@ -0,0 +1,61 @@
{
"nodes": {
"nixpkgs": {
"locked": {
"lastModified": 1747312588,
"narHash": "sha256-MmJvj6mlWzeRwKGLcwmZpKaOPZ5nJb/6al5CXqJsgjo=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "b1bebd0fe266bbd1820019612ead889e96a8fa2d",
"type": "github"
},
"original": {
"owner": "NixOS",
"ref": "nixpkgs-unstable",
"repo": "nixpkgs",
"type": "github"
}
},
"root": {
"inputs": {
"nixpkgs": "nixpkgs",
"utils": "utils"
}
},
"systems": {
"locked": {
"lastModified": 1681028828,
"narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
"owner": "nix-systems",
"repo": "default",
"rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",
"type": "github"
},
"original": {
"owner": "nix-systems",
"repo": "default",
"type": "github"
}
},
"utils": {
"inputs": {
"systems": "systems"
},
"locked": {
"lastModified": 1731533236,
"narHash": "sha256-l0KFg5HjrsfsO/JpG+r7fRrqm12kzFHyUHqHCVpMMbI=",
"owner": "numtide",
"repo": "flake-utils",
"rev": "11707dc2f618dd54ca8739b309ec4fc024de578b",
"type": "github"
},
"original": {
"owner": "numtide",
"repo": "flake-utils",
"type": "github"
}
}
},
"root": "root",
"version": 7
}

54
flake.nix Normal file
View File

@ -0,0 +1,54 @@
{
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
utils.url = "github:numtide/flake-utils";
};
outputs =
{
self,
nixpkgs,
utils,
}:
utils.lib.eachDefaultSystem (
system:
let
pkgs = import nixpkgs { inherit system; };
in
{
devShell =
with pkgs;
mkShell.override { stdenv = pkgs.clangStdenv; } rec {
nativeBuildInputs = [
cargo
rustc
rustfmt
rustPackages.clippy
cmake
pkg-config
pre-commit
git-cliff
cargo-release
cargo-outdated
];
buildInputs = [
udev
alsa-lib
vulkan-loader
xorg.libX11
xorg.libXcursor
xorg.libXi
xorg.libXrandr
libxkbcommon
wayland
];
shellHook = ''
export LIBCLANG_PATH="${pkgs.libclang.lib}/lib"
export RUSTFLAGS="-C link-arg=-Wl,-rpath,${lib.makeLibraryPath buildInputs}"
pre-commit install
'';
RUST_SRC_PATH = rustPlatform.rustLibSrc;
};
}
);
}

View File

@ -188,7 +188,7 @@ fn update_listener(
context: ResMut<Context>,
listener: Query<Option<&GlobalTransform>, With<Listener>>,
) {
if let Ok(transform) = listener.get_single() {
if let Ok(transform) = listener.single() {
let transform: Transform = transform
.map(|v| {
let transform: Transform = (*v).into();
@ -272,9 +272,9 @@ fn add_source_handle(
fn add_generator(
context: Res<Context>,
buffers: Res<Assets<Buffer>>,
mut query: Query<(Entity, Option<&Parent>, &mut Sound)>,
mut query: Query<(Entity, Option<&ChildOf>, &mut Sound)>,
mut sources: Query<&mut Source>,
parents: Query<&Parent>,
parents: Query<&ChildOf>,
) {
for (entity, parent, mut sound) in &mut query {
if sound.generator.is_some() {
@ -286,11 +286,11 @@ fn add_generator(
let mut parent = parent;
let mut target = None;
while let Some(p) = parent {
if sources.get(**p).is_ok() {
target = Some(**p);
if sources.get(p.parent()).is_ok() {
target = Some(p.parent());
break;
}
parent = parents.get(**p).ok();
parent = parents.get(p.parent()).ok();
}
target.map(|v| sources.get_mut(v).unwrap())
} else {
@ -341,7 +341,7 @@ fn add_generator(
fn add_sound_without_source(
mut commands: Commands,
query: Query<Entity, (Added<Sound>, Without<Source>)>,
parents: Query<(&Parent, Option<&Source>)>,
parents: Query<(&ChildOf, Option<&Source>)>,
) {
for entity in &query {
let mut has_source = false;
@ -351,7 +351,7 @@ fn add_sound_without_source(
has_source = true;
break;
}
target = **parent;
target = parent.parent();
}
if !has_source {
commands.entity(entity).insert(Source::default());
@ -709,10 +709,10 @@ fn events(
if *generator.handle() == event.source {
match event.r#type {
syz::EventType::Finished => {
output.send(SynthizerEvent::Finished(entity));
output.write(SynthizerEvent::Finished(entity));
}
syz::EventType::Looped => {
output.send(SynthizerEvent::Looped(entity));
output.write(SynthizerEvent::Looped(entity));
}
_ => {}
}