Skip to content

Commit e891b8e

Browse files
committed
Add nix flake and MacOS build support
1 parent 08cd0a9 commit e891b8e

5 files changed

Lines changed: 105 additions & 4 deletions

File tree

Cargo.lock

Lines changed: 1 addition & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,9 @@ features = ["mp3", "ogg", "wav", "pcm"]
5555
default-features = false
5656
version = "0.5.3"
5757

58+
[patch.crates-io]
59+
audiopus_sys = { git = 'https://github.com/sevenc-nanashi/audiopus_sys', rev = '00e9d16' }
60+
5861
[workspace.dependencies]
5962
regex = "1"
6063
anyhow = "1"

flake.lock

Lines changed: 61 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

flake.nix

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
{
2+
inputs = {
3+
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable-small";
4+
flake-utils.url = "github:numtide/flake-utils";
5+
};
6+
outputs =
7+
{
8+
nixpkgs,
9+
flake-utils,
10+
...
11+
}:
12+
flake-utils.lib.eachDefaultSystem (
13+
system:
14+
let
15+
pkgs = import nixpkgs { inherit system; };
16+
in
17+
{
18+
devShell = pkgs.mkShell {
19+
env = {
20+
RUSTC_BOOTSTRAP = "1";
21+
RUST_SRC_PATH = pkgs.rustPlatform.rustLibSrc;
22+
};
23+
24+
nativeBuildInputs = with pkgs; [
25+
rustc
26+
cargo
27+
clippy
28+
rustfmt
29+
30+
mold
31+
cmake
32+
];
33+
34+
hardeningDisable = [ "fortify" ];
35+
};
36+
}
37+
);
38+
}

tts_events/src/ready.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,14 @@ use tts_core::{
1111
};
1212
use tts_tasks::Looper;
1313

14-
#[cfg(unix)]
14+
#[cfg(target_os = "linux")]
1515
fn clear_allocator_cache() {
1616
unsafe {
1717
libc::malloc_trim(0);
1818
}
1919
}
2020

21-
#[cfg(not(unix))]
21+
#[cfg(not(target_os = "linux"))]
2222
fn clear_allocator_cache() {}
2323

2424
fn generate_status(

0 commit comments

Comments
 (0)