coreaudio-sys
coreaudio-sys copied to clipboard
Add a github action to check cross-compilation from Linux
This is a port of the old travis-ci cross-compile check, which currently does not seem to be working.
Downloading the SDK works fine, but initially building produces a "missing libclang.so" error.
On NixOS I threw together a small nix shell to get fix the clang error by setting LIBCLANG_PATH and automating the SDK install, however I ran into another error where bindgen seems unable to find the "AudioToolbox/AudioToolbox.h" for some reason. I don't have time to dive deeper into this atm, but thought I'd post my efforts so far in case someone finds them useful.
Nix exprs
Here are my nix expressions in case anyone using nix happens to be digging into this. Using these are not necessary to solve the CI build issues though.
macosx-sdk.nix - Simple package that downloads and "installs" the SDK
{ stdenv, fetchurl, clang }:
stdenv.mkDerivation {
name = "macosx-sdk";
src = fetchurl {
url = https://github.com/phracker/MacOSX-SDKs/releases/download/10.13/MacOSX10.13.sdk.tar.xz;
sha256 = "1az86x4lk6l3kxbxa1ppsahnwgpka1a6vpavazrv91wjms4n92xj";
};
dontConfigure = true;
dontBuild = true;
installPhase = ''
mkdir -p $out
cp -r ./ $out/MacOSX10.13.sdk
'';
}
coreaudio-dev.nix - Simple shell that includes macosx-sdk, libclang and sets the environment variables
with import <nixpkgs> {};
let
macosx-sdk = callPackage ./macosx-sdk.nix {};
in
stdenv.mkDerivation {
name = "coreaudio-dev";
buildInputs = [
llvmPackages.libclang
macosx-sdk
];
COREAUDIO_SDK_PATH = "${macosx-sdk}/MacOSX10.13.sdk";
LIBCLANG_PATH = "${llvmPackages.libclang}/lib";
}
Hi folks, just thought I'd mention that I don't have plans to finish this off in the near future, but would be more happy for someone to take over / finish this small PR :+1: