Merge pull request #109368 from holymonson/check-headers

darwin: check apple headers
This commit is contained in:
Dmitry Kalinkin 2021-02-01 12:12:03 -05:00 committed by GitHub
commit f602c10ea7
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
18 changed files with 3443 additions and 1 deletions

View file

@ -6,6 +6,34 @@ appleDerivation {
cp include/* $out/include/CommonCrypto
'';
appleHeaders = ''
CommonCrypto/CommonBaseXX.h
CommonCrypto/CommonBigNum.h
CommonCrypto/CommonCMACSPI.h
CommonCrypto/CommonCRC.h
CommonCrypto/CommonCrypto.h
CommonCrypto/CommonCryptoError.h
CommonCrypto/CommonCryptoPriv.h
CommonCrypto/CommonCryptor.h
CommonCrypto/CommonCryptorSPI.h
CommonCrypto/CommonDH.h
CommonCrypto/CommonDigest.h
CommonCrypto/CommonDigestSPI.h
CommonCrypto/CommonECCryptor.h
CommonCrypto/CommonHMAC.h
CommonCrypto/CommonHMacSPI.h
CommonCrypto/CommonKeyDerivation.h
CommonCrypto/CommonKeyDerivationSPI.h
CommonCrypto/CommonNumerics.h
CommonCrypto/CommonRSACryptor.h
CommonCrypto/CommonRandom.h
CommonCrypto/CommonRandomSPI.h
CommonCrypto/CommonSymmetricKeywrap.h
CommonCrypto/aes.h
CommonCrypto/lionCompat.h
CommonCrypto/module.modulemap
'';
meta = with lib; {
maintainers = with maintainers; [ copumpkin ];
platforms = platforms.darwin;

View file

@ -29,4 +29,6 @@ appleDerivation {
cp ${Libc_old}/include/libkern/OSAtomic.h $out/include/libkern
cp ${Libc_old}/include/libkern/OSCacheControl.h $out/include/libkern
'';
appleHeaders = builtins.readFile ./headers.txt;
}

View file

@ -0,0 +1,138 @@
CrashReporterClient.h
NSSystemDirectories.h
_locale.h
_types.h
_types/_intmax_t.h
_types/_nl_item.h
_types/_uint16_t.h
_types/_uint32_t.h
_types/_uint64_t.h
_types/_uint8_t.h
_types/_uintmax_t.h
_types/_wctrans_t.h
_types/_wctype_t.h
_wctype.h
_xlocale.h
aio.h
alloca.h
ar.h
arpa/ftp.h
arpa/inet.h
arpa/nameser_compat.h
arpa/telnet.h
arpa/tftp.h
asl.h
assert.h
bitstring.h
cpio.h
crt_externs.h
ctype.h
db.h
dirent.h
disktab.h
err.h
errno.h
execinfo.h
fcntl.h
fmtmsg.h
fnmatch.h
fsproperties.h
fstab.h
fts.h
ftw.h
get_compat.h
getopt.h
glob.h
inttypes.h
iso646.h
langinfo.h
libc.h
libc_private.h
libgen.h
libkern/OSAtomic.h
libkern/OSCacheControl.h
libproc.h
limits.h
locale.h
malloc/malloc.h
memory.h
monetary.h
monitor.h
mpool.h
msgcat.h
ndbm.h
nl_types.h
nlist.h
os/assumes.h
os/debug_private.h
paths.h
poll.h
printf.h
protocols/routed.h
protocols/rwhod.h
protocols/talkd.h
protocols/timed.h
pthread.h
pthread_impl.h
pthread_spis.h
pthread_workqueue.h
ranlib.h
readpassphrase.h
regex.h
runetype.h
sched.h
search.h
secure/_common.h
secure/_stdio.h
secure/_string.h
semaphore.h
setjmp.h
sgtty.h
signal.h
spawn.h
stab.h
standards.h
stddef.h
stdint.h
stdio.h
stdlib.h
strhash.h
string.h
stringlist.h
strings.h
struct.h
sys/acl.h
sys/rbtree.h
sys/statvfs.h
sysexits.h
syslog.h
tar.h
termios.h
time.h
timeconv.h
ttyent.h
tzfile.h
ucontext.h
ulimit.h
unistd.h
util.h
utime.h
utmpx.h
utmpx_thread.h
vis.h
wchar.h
wctype.h
wordexp.h
xlocale.h
xlocale/__wctype.h
xlocale/_ctype.h
xlocale/_inttypes.h
xlocale/_langinfo.h
xlocale/_monetary.h
xlocale/_regex.h
xlocale/_stdio.h
xlocale/_stdlib.h
xlocale/_string.h
xlocale/_time.h
xlocale/_wchar.h
xlocale/_wctype.h

View file

@ -11,4 +11,40 @@ appleDerivation {
export DSTROOT=$out
sh xcodescripts/install_files.sh
'';
appleHeaders = ''
aliasdb.h
bootparams.h
configuration_profile.h
grp.h
ifaddrs.h
ils.h
kvbuf.h
libinfo.h
libinfo_muser.h
membership.h
membershipPriv.h
netdb.h
netdb_async.h
ntsid.h
printerdb.h
pwd.h
rpc/auth.h
rpc/auth_unix.h
rpc/clnt.h
rpc/pmap_clnt.h
rpc/pmap_prot.h
rpc/pmap_rmt.h
rpc/rpc.h
rpc/rpc_msg.h
rpc/svc.h
rpc/svc_auth.h
rpc/types.h
rpc/xdr.h
rpcsvc/yp_prot.h
rpcsvc/ypclnt.h
si_data.h
si_module.h
thread_data.h
'';
}

View file

@ -115,6 +115,8 @@ appleDerivation {
ln -s libresolv.9.dylib $out/lib/libresolv.dylib
'';
appleHeaders = builtins.readFile ./headers.txt;
meta = with lib; {
description = "The Mac OS libc/libSystem (tapi library with pure headers)";
maintainers = with maintainers; [ copumpkin gridaphobe ];

File diff suppressed because it is too large Load diff

View file

@ -13,6 +13,24 @@ appleDerivation {
DSTROOT = "$(out)";
appleHeaders = ''
architecture/alignment.h
architecture/byte_order.h
architecture/i386/alignment.h
architecture/i386/asm_help.h
architecture/i386/byte_order.h
architecture/i386/cpu.h
architecture/i386/desc.h
architecture/i386/fpu.h
architecture/i386/frame.h
architecture/i386/io.h
architecture/i386/pio.h
architecture/i386/reg_help.h
architecture/i386/sel.h
architecture/i386/table.h
architecture/i386/tss.h
'';
meta = with lib; {
maintainers = with maintainers; [ copumpkin ];
platforms = platforms.darwin;

View file

@ -164,6 +164,25 @@ let
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 // {
meta = (with lib; {
platforms = platforms.darwin;

View file

@ -1,4 +1,4 @@
{ appleDerivation, lib, headersOnly ? false }:
{ appleDerivation, lib, headersOnly ? true }:
appleDerivation {
installPhase = lib.optionalString headersOnly ''
@ -6,6 +6,39 @@ appleDerivation {
cp core/*.h $out/include/hfs
'';
appleHeaders = ''
hfs/BTreeScanner.h
hfs/BTreesInternal.h
hfs/BTreesPrivate.h
hfs/CatalogPrivate.h
hfs/FileMgrInternal.h
hfs/HFSUnicodeWrappers.h
hfs/UCStringCompareData.h
hfs/hfs.h
hfs/hfs_alloc_trace.h
hfs/hfs_attrlist.h
hfs/hfs_btreeio.h
hfs/hfs_catalog.h
hfs/hfs_cnode.h
hfs/hfs_cprotect.h
hfs/hfs_dbg.h
hfs/hfs_endian.h
hfs/hfs_extents.h
hfs/hfs_format.h
hfs/hfs_fsctl.h
hfs/hfs_hotfiles.h
hfs/hfs_iokit.h
hfs/hfs_journal.h
hfs/hfs_kdebug.h
hfs/hfs_key_roll.h
hfs/hfs_macos_defs.h
hfs/hfs_mount.h
hfs/hfs_quota.h
hfs/hfs_unistr.h
hfs/kext-config.h
hfs/rangelist.h
'';
meta = {
# Seems nobody wants its binary, so we didn't implement building.
broken = !headersOnly;

View file

@ -9,4 +9,18 @@ appleDerivation {
cp liblaunch/bootstrap.h $out/include/servers
cp liblaunch/bootstrap.h $out/include/servers/bootstrap_defs.h
'';
appleHeaders = ''
bootstrap.h
bootstrap_priv.h
launch.h
launch_internal.h
launch_priv.h
reboot2.h
servers/bootstrap.h
servers/bootstrap_defs.h
vproc.h
vproc_internal.h
vproc_priv.h
'';
}

View file

@ -5,4 +5,9 @@ appleDerivation {
mkdir -p $out/include
cp *.h $out/include/
'';
appleHeaders = ''
Block.h
Block_private.h
'';
}

View file

@ -22,4 +22,33 @@ appleDerivation {
typedef void* dispatch_block_t;
#endif'
'';
appleHeaders = ''
dispatch/base.h
dispatch/benchmark.h
dispatch/block.h
dispatch/data.h
dispatch/data_private.h
dispatch/dispatch.h
dispatch/group.h
dispatch/introspection.h
dispatch/introspection_private.h
dispatch/io.h
dispatch/io_private.h
dispatch/layout_private.h
dispatch/mach_private.h
dispatch/object.h
dispatch/once.h
dispatch/private.h
dispatch/queue.h
dispatch/queue_private.h
dispatch/semaphore.h
dispatch/source.h
dispatch/source_private.h
dispatch/time.h
os/object.h
os/object_private.h
os/voucher_activity_private.h
os/voucher_private.h
'';
}

View file

@ -5,4 +5,28 @@ appleDerivation {
mkdir $out
cp -r include $out/include
'';
appleHeaders = ''
_simple.h
libkern/OSAtomic.h
libkern/OSAtomicDeprecated.h
libkern/OSAtomicQueue.h
libkern/OSCacheControl.h
libkern/OSSpinLockDeprecated.h
os/alloc_once_impl.h
os/base.h
os/base_private.h
os/internal/atomic.h
os/internal/crashlog.h
os/internal/internal_shared.h
os/lock.h
os/lock_private.h
os/once_private.h
os/semaphore_private.h
platform/compat.h
platform/introspection_private.h
platform/string.h
setjmp.h
ucontext.h
'';
}

View file

@ -15,6 +15,40 @@ appleDerivation {
cp -r sys/_pthread/*.h $out/include/sys/_types/
'';
appleHeaders = ''
pthread/introspection.h
pthread/pthread.h
pthread/pthread_impl.h
pthread/pthread_spis.h
pthread/qos.h
pthread/sched.h
pthread/spawn.h
sys/_pthread/_pthread_attr_t.h
sys/_pthread/_pthread_cond_t.h
sys/_pthread/_pthread_condattr_t.h
sys/_pthread/_pthread_key_t.h
sys/_pthread/_pthread_mutex_t.h
sys/_pthread/_pthread_mutexattr_t.h
sys/_pthread/_pthread_once_t.h
sys/_pthread/_pthread_rwlock_t.h
sys/_pthread/_pthread_rwlockattr_t.h
sys/_pthread/_pthread_t.h
sys/_pthread/_pthread_types.h
sys/_types/_pthread_attr_t.h
sys/_types/_pthread_cond_t.h
sys/_types/_pthread_condattr_t.h
sys/_types/_pthread_key_t.h
sys/_types/_pthread_mutex_t.h
sys/_types/_pthread_mutexattr_t.h
sys/_types/_pthread_once_t.h
sys/_types/_pthread_rwlock_t.h
sys/_types/_pthread_rwlockattr_t.h
sys/_types/_pthread_t.h
sys/_types/_pthread_types.h
sys/qos.h
sys/qos_private.h
'';
meta = {
platforms = lib.platforms.darwin;
};

View file

@ -27,6 +27,14 @@ appleDerivation {
install_name_tool -id $out/lib/libutil.dylib $out/lib/libutil.dylib
'';
# FIXME: headers are different against headersOnly. And all the headers are NOT in macos, do we really want them?
# appleHeaders = ''
# libutil.h
# mntopts.h
# tzlink.h
# wipefs.h
# '';
meta = with lib; {
maintainers = with maintainers; [ copumpkin ];
platforms = platforms.darwin;

View file

@ -5,4 +5,9 @@ appleDerivation {
mkdir -p $out/include/
cp removefile.h checkint.h $out/include/
'';
appleHeaders = ''
checkint.h
removefile.h
'';
}

View file

@ -127,6 +127,8 @@ appleDerivation ({
mkdir $out/Library/PrivateFrameworks
mv $out/Library/Frameworks/IOKit.framework $out/Library/PrivateFrameworks
'';
appleHeaders = builtins.readFile ./headers.txt;
} // lib.optionalAttrs headersOnly {
HOST_CODESIGN = "echo";
HOST_CODESIGN_ALLOCATE = "echo";

File diff suppressed because it is too large Load diff