remove zlib from nix, add to build

This commit is contained in:
Emil Lerch 2025-09-09 13:58:33 -07:00
parent b26d139244
commit c7a9808052
Signed by: lobo
GPG key ID: A7B62D657EF764F8
3 changed files with 10 additions and 1 deletions

View file

@ -6,6 +6,10 @@ pub fn build(b: *std.Build) void {
const vosk_dep = b.dependency("vosk", .{}); const vosk_dep = b.dependency("vosk", .{});
const zlib_dep = b.dependency("zlib", .{
.target = target,
.optimize = optimize,
});
// We need to use curl for this as the domain doesn't work with zig TLS // We need to use curl for this as the domain doesn't work with zig TLS
const model_step = ModelDownloadStep.create(b); const model_step = ModelDownloadStep.create(b);
@ -30,6 +34,7 @@ pub fn build(b: *std.Build) void {
exe.linkLibC(); exe.linkLibC();
exe.addIncludePath(vosk_dep.path("")); exe.addIncludePath(vosk_dep.path(""));
exe.addLibraryPath(vosk_dep.path("")); exe.addLibraryPath(vosk_dep.path(""));
exe.linkLibrary(zlib_dep.artifact("z"));
exe.linkSystemLibrary("vosk"); exe.linkSystemLibrary("vosk");
exe.linkSystemLibrary("asound"); exe.linkSystemLibrary("asound");

View file

@ -8,6 +8,10 @@
.url = "https://github.com/alphacep/vosk-api/releases/download/v0.3.45/vosk-linux-x86_64-0.3.45.zip", .url = "https://github.com/alphacep/vosk-api/releases/download/v0.3.45/vosk-linux-x86_64-0.3.45.zip",
.hash = "N-V-__8AAF22jAFTSU4AVxFCNWtotf7OD8gM33Y_ScIrCeu7", .hash = "N-V-__8AAF22jAFTSU4AVxFCNWtotf7OD8gM33Y_ScIrCeu7",
}, },
.zlib = .{
.url = "git+https://github.com/allyourcodebase/zlib#61e7df7e996ec5a5f13a653db3c419adb340d6ef",
.hash = "zlib-1.3.1-ZZQ7lbYMAAB1hTSOKSXAKAgHsfDcyWNH_37ojw5WSpgR",
},
}, },
.paths = .{ .paths = .{
"build.zig", "build.zig",

View file

@ -15,7 +15,7 @@
devShells.default = pkgs.mkShell { devShells.default = pkgs.mkShell {
buildInputs = with pkgs; [ buildInputs = with pkgs; [
pkg-config pkg-config
zlib # zlib # handled directly in zig build
alsa-lib alsa-lib
alsa-plugins alsa-plugins
SDL2 SDL2