How to cross-compile for iPhone with nix?

Viewed 133

I've been attempting to get cross-compilation to an iOS target working via nix. My tenative expression starts out like this:

{iphone ? false}:

let
  crossSystem = if iphone then {
    config = "aarch64-apple-ios";
    sdkVer = "13.7";
    xcodeVer = "11";
    xcodePlatform = "iPhoneOS";
    useiOSPrebuilt = true;
    platform = {};
  } else null;

  pkgs_fn = (import ../repo.nix).nixos_2009;
  cmake = (pkgs_fn {}).cmake;
  pkgs = pkgs_fn { config.allowUnfree = true; crossSystem = crossSystem; };
in
pkgs.stdenv.mkDerivation rec {
  nativeBuildInputs = [
    cmake
  ];
  buildInputs = [
    pkgs.zlib
    # ...
  ];
}

The problem I run into is that the current xcode package does not have hashes that seem to correspond to any version I can download on Apple's website. In addition, the versions it nominally supports are extremely old (only the 10.x series and 11).

What's the idiomatic way to get this working? Thanks.

0 Answers
Related