This commit allows to extract the Command Line Tools pkg with a not standard name from the .dmg.
For example the Command_Line_Tools_macOS_10.11_for_Xcode_8.2.dmg contains "Command Line Tools (macOS El Capitan version 10.11).pkg" and the Command_Line_Tools_OS_X_10.11_for_Xcode_7.3.dmg contains "Command Line Tools (OS X 10.11).pkg"
Since cmake 3.20, "-D" prevents any build options (--build, --target, -j,
etc) from working. It will abort with an "unrecognized argument" error.
Fix the issue by passing the toolchain file as an env variable to cmake,
not with -D.
I tried to follow the instructions outlined in PACKAGING THE SDK,
and as it turns out the instructions for Linux required more than
40GB of disk space. That's why I think it would be best to tell
readers that they might need up to 45GB of space rather than
up to 25GB. I'm not sure if the instructions are simply outdated
in this regard or if the space requirements are just different for
other reasons, however I highly suspect the former to be the case.
This change updates the exit code for `verify_sdk_version` to `1` function if the SDK is not found.
This should help to stop the build in automatic scripts when the SDK_VERSION env variable is set to a invalid value.
As OpenSSL is expected to be in a standard UNIX location but that's not always the case on macOS, this works around the issue regardless of package manager used as long as pkg-config is installed into $PATH
Macports default prefix is /opt/local
Homebrew on M1 uses /opt/homebrew
Move setting build_complete_file to after fetching project_name using
get_project_name_from_url. Avoids empty ".FOO_build_complete" file name.
* Fix up a number of shellcheck issues in get_sources().
Signed-off-by: Ben Kochie <superq@gmail.com>
Being able to extract SDKs from Command Line Tools for Xcode instead
of the full Xcode package saves bandwidth, disk space, and time.
Two scripts are added:
* tools/gen_sdk_package_tools.sh: extracts SDKs from installed
Command Line Tools on macOS (/Library/Developer/CommandLineTools)
or from a path specified via XCODE_TOOLS_DIR
* tools/gen_sdk_package_tools_dmg.sh: unpacks the content of provided
Command_Line_Tools_for_Xcode.dmg and extracts SDKs via the above
script.
Tested with Command Line Tools for Xcode 12.x.