-
Notifications
You must be signed in to change notification settings - Fork 38
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Nix and COREAUDIO_SDK_PATH fails to find AudioUnit/AudioUnit.h #78
Comments
I'm honestly not sure what's causing this error. Like, I'm betting you have a |
Yup,
Trying to determine where it's actually looking right now. Assuming it isn't looking in that location.. at least. |
Currently, the fyrox engine is using 'coreaudio-sys,' and the build is failing in the same way on x86-64 darwin (Nix-Darwin). However, it builds successfully and runs without issues on m2. |
When building with Nix, you have to use |
I tried to figure this out for a few hours, with no luck. Here was the flake.nix I unsuccessfully used. {
description = "skilltree flake";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
# eachDefaultSystem and other utility functions
utils.url = "github:numtide/flake-utils";
# Replacement for rustup
fenix = {
url = "github:nix-community/fenix";
inputs.nixpkgs.follows = "nixpkgs";
};
};
outputs = { self, nixpkgs, utils, fenix, }:
# This helper function abstracts over the host platform.
# See https://github.com/numtide/flake-utils#eachdefaultsystem--system---attrs
utils.lib.eachDefaultSystem (system:
let
pkgs = nixpkgs.legacyPackages.${system};
# Brings in the rust toolchain from the standard file
# that rustup/cargo uses.
rustToolchain = fenix.packages.${system}.fromToolchainFile {
file = ./rust-toolchain.toml;
sha256 = "sha256-Q9UgzzvxLi4x9aWUJTn+/5EXekC98ODRU1TwhUs9RnY=";
};
rustPlatform = pkgs.makeRustPlatform.override { stdenv = pkgs.clangStdenv; } {
inherit (rustToolchain) cargo rustc;
};
llvm = pkgs.llvmPackages;
# See https://discourse.nixos.org/t/develop-shell-environment-setup-for-macos/11399/6
coreAudio = if pkgs.stdenv.isDarwin then
pkgs.symlinkJoin {
name = "sdk";
paths = with pkgs.darwin.apple_sdk.frameworks; [
AudioToolbox
AudioUnit
CoreAudio
CoreFoundation
CoreMIDI
OpenAL
];
postBuild = ''
mkdir $out/System
mv $out/Library $out/System
'';
}
else
"";
in
# See https://nixos.wiki/wiki/Flakes#Output_schema
{
# `nix develop` pulls all of this in to become your shell.
devShells.default = pkgs.mkShell.override { stdenv = pkgs.clangStdenv; } {
nativeBuildInputs = [
rustToolchain
rustPlatform.bindgenHook
# Common cargo tools we often use
pkgs.cargo-deny
pkgs.cargo-expand
pkgs.cargo-binutils
];
buildInputs = [
# This is missing on mac m1 nix, for some reason.
# see https://stackoverflow.com/a/69732679
pkgs.libiconv
coreAudio
];
# NOTE: coreaudio-sys still doesn't build despite my best efforts! If
# you know how to fix this please reach out.
shellHook = ''
export LIBCLANG_PATH="${llvm.libclang.lib}/lib"
export COREAUDIO_SDK_PATH="${coreAudio}"
'';
};
# This only formats the nix files.
formatter = pkgs.nixpkgs-fmt;
}
);
} |
This works for me. The only modifications I made were to pass the dependencies directly and drop the shell hook. I had to create a |
Weird, that does solve it. I think I like @reckenrode's approach more though. |
This worked for me as well. Thank you! |
* according to RustAudio#78 (comment)
Hmm, even with this, i still get this error:
I experienced it on Monterey, upgraded to Ventura (13.3) out of curiosity and still see it. I'm not sure what the latest is settings i should use are, but i have the env set to:
Though i'm also using Nix (on Mac, ofc), and trying various things to get it working there with no luck either. Perhaps this should be a new issue.
Any thoughts? Note that
coreaudio-sys
is currently on 0.2.12. I also tried it againstmaster
to no avail.edit: Hmm, no this looks to be a completely unrelated error? Just lots of path finding errors in this repo, all unique .. hm. Apologies, will open a new issue.
Originally posted by @leeola in #75 (comment)
The text was updated successfully, but these errors were encountered: