Closed Bob620 closed 2 years ago
The hello world program is just supposed to print "hello world", so it seems like you were able to get it compiled and working successfully.
I will have to spend some time later understanding why the ls check failed and gen_sdk_package.sh failed and what to do about it. It is unfortunate that the macOS SDK cannot be downloaded directly from Apple or redistributed, so that is why you have to go through some extra steps.
Everything should be fixed now. I updated nixcrpkgs to use the latest gen_sdk_package.sh
script from the osxcross project and I updated my sdk_builder.sh
script to fix the redundant v1
directory. I tested that macos.hello_cpp
compiles successfully both using my old MacOS10.14.sdk.tar.xz and a MacOS12.3.sdk.tar.bz2 which I just generated today.
This is my first experience with nixcrpkgs.
I initially cloned and ran the repo on my nixos machine for windows and it worked perfectly (for windows).
Unfortunately, I need to also support mac and here is where the issues started.
The first issue is that the
macos/gen_sdk_package.sh
does not work(?) with current XCode. It silently fails after finding Xcode. I remedied this by cloning tpoechtrager/osxcross and using their up-to-datetools/gen_sdk_package.sh
.After transferring the MacOSX sdk file over to my nix machine and running
macos.hello
to compile the hello example app. After a bit it gave me the errorls: cannot access 'usr/include/c++/iterator': No such file or directory
.The issue seems to be the same as #4 where the
SDKSettings.json
andusr/include/c++/v1/iterator
may not be the best options to check for anymore. The commit #4 provides, 28dc022, does not seem to work either as XCode uses BPlist rather than just Plist.As commented in #4
I tried just removing the
ls
check and it all compiled properly and created a working Mac build, however It had no UI. No clue how to even go about debugging that issue as it doesn't throw any errors.When running the program on the same Mac that the SDK was made on:
And when run manually via terminal:
Mac was only used to generate the sdk and run the final compiled program, otherwise everything was run on the nix box.