darwin.apple-source-releases: implement headers check

This commit is contained in:
Monson Shao 2021-01-23 21:49:13 +08:00
parent 4bc22226a2
commit c12df57435
No known key found for this signature in database
GPG Key ID: 163271C707982C65

View File

@ -165,6 +165,25 @@ let
enableParallelBuilding = true; enableParallelBuilding = true;
# In rare cases, APPLE may drop some headers quietly on new release.
doInstallCheck = attrs ? appleHeaders;
passAsFile = [ "appleHeaders" ];
installCheckPhase = ''
cd $out/include
result=$(diff -u "$appleHeadersPath" <(find * -type f | sort) --label "Listed in appleHeaders" --label "Found in \$out/include" || true)
if [ -z "$result" ]; then
echo "Apple header list is matched."
else
echo >&2 "\
Apple header list is inconsistent, please ensure no header file is unexpectedly dropped.
$result
"
exit 1
fi
'';
} // attrs // { } // attrs // {
meta = (with lib; { meta = (with lib; {
platforms = platforms.darwin; platforms = platforms.darwin;