Commit graph

16 commits

Author SHA1 Message Date
Stephen Gutekanst
f2a904e17a sysaudio: fix broken sysjs dependency include
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2023-04-30 16:57:19 -07:00
Ali Chraghi
ed05166348
sysaudio: improve backend selection; remove i8 sample support (#767)
* sysaudio: fix compilation errors
* re-order backend selection
* remove i8 samples support from backends and disable signedToSigned convertion for now
* update sine-wave example
2023-04-30 16:36:39 -07:00
Vivek Roy
ff0258f27d all: use std.Build.installArtifact 2023-04-25 15:06:11 -07:00
Ali Chraghi
edd2117174 all: build: update to zig version 0.11.0-dev.6883+da0509750 2023-03-24 23:22:59 -07:00
Stephen Gutekanst
6bd4d91932 all: cache module() returns to avoid duplicate modules
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2023-03-15 21:20:28 -07:00
Stephen Gutekanst
46a805bc90 sysaudio: update to latest Zig build API
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2023-02-12 10:05:03 -07:00
Ali Chraghi
05968f0496 sysaudio: load libpipewire-0.3.so dynamically 2023-01-20 14:53:22 -07:00
Ali Chraghi
655e061d50 sysaudio: load libasound.so dynamically 2023-01-20 14:53:22 -07:00
Ali Chraghi
bb6a654c90 sysaudio: pipewire backend
missing features:\n - volume adjustment\n - device watcher\n - device listing (default device)
2023-01-20 14:53:22 -07:00
Stephen Gutekanst
a750e31d11 Revert "all: build: fix sdkPath for relative @src.file / fix autocompletion with ZLS / IDEs (#661)"
This reverts commit a1fe671db8.

Lue suggested reverting #661 because ZLS worked around the issue of @src
being relative in that environment: https://github.com/zigtools/zls/pull/898

This is not a perfect solution (what zls did seems to be a workaround), but
is good enough for us until Zig gets an official package manager.
2023-01-10 01:57:52 -07:00
Lue
a1fe671db8
all: build: fix sdkPath for relative @src.file / fix autocompletion with ZLS / IDEs (#661)
* all: build: fix sdkPath for relative @src.file

Prior to this commit, the build system heavily assumed that the result
`@src.file` would always be absolute, but this is no longer
guaranteed, likely due to there being no such thing as an "absolute
path" in WASI.

It appears that for normal invocations of `zig build`, it is safe to
assume that `@src.file` is absolute. However, when ZLS uses a custom
`build_runner.zig` to collect build configuration, `@src.file` is
actually relative to the current working directory, at least on my
system. For a while, this led to ZLS completions breaking entirely,
but presently it actually causes ZLS to crash!

The solution is not as simple as using relative `sdkPath` results
as-is, because the build system may attempt to resolve these paths
relative to build root, when the paths are actually relative to the
current working directory.

This leads to a sticky situation: the current working directory is a
runtime concept, but `@src.file` is resolved at compile time. However,
it appears that the build runner does not change current working
directory in between compilation and execution, so it is probably safe
to calculate `sdkPath` using runtime current working directory.

Still, this requires major changes with how `sdkPath` works, since
runtime computation and allocations are required. So pretty much
anything that relied on `sdkPath` being comptime-known has been
refactored in this commit.

The most severe result of this is that, for example, `gpu.pkg` can no
longer be a comptime-known constant: it has to be a runtime function
that takes a `*Builder` and returns a `Pkg`.

This commit deals with usages of `*.pkg` and `sdkPath` within Mach
itself, but projects that depend on Mach such as `mach-examples` will
almost certainly require changes as well.

* all: update README to reflect change in pkg usage

For details on updating your code to use this version, see: 88b1106953

Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
Co-authored-by: Stephen Gutekanst <stephen@hexops.com>
2023-01-02 01:23:46 -07:00
Ali Chraghi
0f3e28bc2a sysaudio: rewrite in zig
removes libsoundio dependency
2022-12-18 18:02:31 -07:00
Slava Mostovoy
9b9852b56e
sysaudio: add ability to provide system_sdk options (#619) 2022-11-20 11:45:07 -07:00
Ali Chraghi
82e10f4f28
all: build: thisDir improvements (#570)
* build:all: thisDir improvements

more performant output, usage code reducement and compileError for wrong usage

* glfw: update deprecated code
2022-09-29 08:41:46 -07:00
Stephen Gutekanst
2ba7e48ac2 {sysjs,mach}: correctly pass sysjs dependency to sdk
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2022-09-09 21:55:38 -07:00
Stephen Gutekanst
7511392a02 sysaudio: switch to sdk builder pattern for system_sdk access
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2022-09-10 04:06:16 +00:00