Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
417 commits
Select commit Hold shift + click to select a range
96dd052
Remove debug-print statement
Sep 5, 2018
babd0a2
Greatly simplify fetch-from-github script
Sep 5, 2018
79d0724
Remove unnecessary test
Sep 5, 2018
bf9b27f
Improve error handling
Sep 5, 2018
0b612b2
Add darwinbuild-codesign script
Sep 5, 2018
0a1857a
Disable code signing when calling xcodebuild
Sep 5, 2018
15ff8e7
Fix minor error in darwinbuild-codesign
Sep 5, 2018
358d154
Add explicit directory support to darwinbuild-codesign
Sep 6, 2018
348587d
Add Mojave support to installXcode_Modern
Oct 6, 2018
7688df1
Add support for non-standard Xcode locations
Oct 6, 2018
e8d540a
Fix typo in fetch-from-github script
Oct 6, 2018
3f85735
Resolve Xcode 10.0 update issues
Oct 6, 2018
85c3305
Update project to Xcode 10 format
Oct 6, 2018
c4f7178
Add Mojave support to setXcodePlatform script
Oct 6, 2018
c095e57
Use adhoc code-signing instead of disabling it
Oct 6, 2018
61e3674
Add explicit ordering support to darwinbuild-codesign
Oct 6, 2018
600cab0
Improve darwinbuild-codesign help text
Oct 6, 2018
519a0f3
Update URL in README
Oct 13, 2018
caae551
First draft of creating_darwinbuild_plists.md
Oct 13, 2018
70b4f8d
fix typo
csekel Oct 15, 2018
5a442df
Merge pull request #33 from PureDarwin/documentation
csekel Oct 15, 2018
3193e6c
Don't segregate installed roots by project
wjk Nov 27, 2018
0d6ff1f
Update contents of darwinbuild.xcconfig
wjk Nov 27, 2018
2a8c3cf
Reindent and clean up buildorder script
wjk Nov 27, 2018
41ce852
Adjust buildorder script to match PureDarwin idioms
wjk Nov 27, 2018
3714376
Typo fix
wjk Nov 27, 2018
e5171b8
Add support for copying tarballs from local sources
wjk Dec 4, 2018
aa0ef72
Don't set ADDITIONAL_SDKS
wjk Dec 6, 2018
816a5f7
Enable code signing for darwintrace and darwinxref
wjk Dec 6, 2018
b8055c0
Don't install the darwinxref headers
wjk Dec 6, 2018
433b6b6
Add files to create installer
wjk Dec 7, 2018
731af6a
Remove xcbuild. xcbuild is dead.
Dec 14, 2018
ff1c173
Get rid of support for Xcode 2.x and 3.x
Dec 14, 2018
e79b8cc
Simplify installXcode script
Dec 14, 2018
8584a9c
Get rid of unneeded plist files
Dec 14, 2018
1507ee9
Get rid of unused script
Dec 14, 2018
4ab8c4b
Add --prefix support to darwinbuild-codesign
Dec 18, 2018
447bcb2
Simplify sort call
Dec 18, 2018
ccc8acf
Remove get_bundle_identifier() function from darwinbuild-codesign
Dec 18, 2018
d7c05ac
Add darwinbuild-recursive script
Dec 18, 2018
8fcb76a
Add -recursive and -group flags to darwinbuild
Dec 18, 2018
77f9fa9
Improve darwinbuild-recursive error handling
Dec 18, 2018
ff60626
Remove reference to deleted script
Dec 18, 2018
0dbbab6
Install darwinbuild-codesign into bin directory
Dec 18, 2018
5f42766
Remove debug print from darwinbuild-codesign
Dec 18, 2018
550c52a
Resolve Xcode 10.2 update warnings
wjk Apr 15, 2019
5ed29eb
Enable code signing on all binaries
wjk Apr 15, 2019
12f0e70
Normalize indentation in distribution.xml file
wjk Apr 15, 2019
65488ad
Bump installer package version
wjk Apr 15, 2019
2aec0cf
Sign all binaries as Developer ID Application
wjk Apr 15, 2019
b11b289
Add installer/notarize.sh
wjk Apr 15, 2019
5796426
Fix another code signing error
wjk Apr 15, 2019
fa9ccc7
Globally enable hardened runtime
wjk Apr 15, 2019
36a5936
Use correct username in notrization script
wjk Apr 15, 2019
b8a5368
Explicitly specify Release configuration
wjk Apr 15, 2019
6e2ae06
Add entitlements file to darwinxref
wjk Apr 15, 2019
095893d
Bump installer package version
wjk Apr 15, 2019
b542485
Add timestamp support to darwinbuild-codesign
wjk Apr 15, 2019
17680df
Use stderr for all error output
wjk Apr 15, 2019
fd18a94
Use default prefix if none is specified
wjk Apr 15, 2019
be364cc
Improve darwinbuild-codesign error handling
wjk Apr 15, 2019
b8c3d13
Bump installer version
wjk Apr 15, 2019
dba18a4
Normalize indentation in createChroot script
wjk Apr 16, 2019
653d6a8
Remove unused variable
wjk Apr 16, 2019
3139727
Don't write "empty" darwinbuild receipts
wjk Apr 16, 2019
ca711bc
Update darwinbuild following previous commit
wjk Apr 16, 2019
e0ba782
Tweak status message
wjk Apr 16, 2019
4ce0261
Fix longstanding root-installation bug
wjk Apr 16, 2019
9705a9b
Install Xcode directly after creating the chroot
wjk Apr 16, 2019
7648f2a
Stylistic improvements to darwinbuild-recursive
wjk Apr 16, 2019
1d67168
Bump installer package version
wjk Apr 16, 2019
fd26bc0
Don't delete the DEPROOT
wjk Apr 16, 2019
0331202
Bump installer package version
wjk Apr 16, 2019
ece4a5c
Set LIBRARY_SEARCH_PATHS in darwinbuild.xcconfig files
wjk May 5, 2019
aa08d5c
Add nochroot support to darwinbuild-recursive
wjk May 5, 2019
43d7aba
Resolve Xcode 11 update warnings
wjk Jul 19, 2019
d998653
Rewrite instller/notarize.sh
wjk Jul 19, 2019
6832d75
Remove chroot support from darwinbuild
wjk Jul 19, 2019
a9e7f33
Remove createChroot script
wjk Jul 19, 2019
b750cdd
Remove installXcode script
wjk Jul 19, 2019
6f4d869
Remove extra_args support from darwinbuild-recursive
wjk Jul 19, 2019
f1314f3
Modernize the DEPROOT
wjk Jul 19, 2019
4d0d251
Copy the Xcode SDK into the buildroot
wjk Jul 19, 2019
4c3ae43
Remove the REAL_ prefix from the various roots
wjk Jul 19, 2019
27e0a90
Remove override of CODE_SIGN_IDENTITY
wjk Jul 19, 2019
36aa977
Add macOS Catalina support to setXcodePlatform script
wjk Jul 19, 2019
8adb992
Addendum to 4c3ae430ffef
wjk Jul 19, 2019
9784704
Bump installer component versions
wjk Jul 19, 2019
0453b4c
Fix embarrassing typo
wjk Jul 19, 2019
6a5672a
Rearrange Xcode SDK installation
wjk Jul 19, 2019
783ae0f
Remove installXcode leftovers
wjk Jul 19, 2019
805ec51
Strip leading indentation from darwinbuild.xcconfig file
wjk Jul 19, 2019
8caa3e5
Don't copy the Apple SDK into the build root
wjk Jul 19, 2019
49d5e79
Fix darwinbuild.xcconfig syntax
wjk Jul 19, 2019
03f1194
Back out pointless breaking change
wjk Jul 19, 2019
32bbf42
Use Python 3 instead of Python 2
wjk Jul 20, 2019
bb9c96a
Fix Python 3 compatibility errors
wjk Jul 20, 2019
e662bcc
Add in stub handling of the -chroot and -nochroot flags
wjk Jul 21, 2019
28440f4
Add a colon (no-op command) to prevent a syntax error
wjk Jul 21, 2019
b4d4ccf
Remove use of deprecated redo_prebinding tool
wjk Jul 21, 2019
32d775e
Add comment to clarify syntax choice
wjk Jul 21, 2019
8ed6f37
Add darwinbuild-codesign Swift taarget
wjk Jul 21, 2019
0659382
Require Xcode 11 to load project
wjk Jul 21, 2019
679fe86
Add SwiftCLI package reference
wjk Jul 21, 2019
d3beb16
Make StandardErrorWriter a struct
wjk Jul 22, 2019
050a0f3
Add Swift code to get and set the working directory
wjk Jul 22, 2019
e235c39
Add EnvironmentAccessor to Utilities.swift
wjk Jul 22, 2019
24cb8f4
Add isdir/isfile methods to Utility.swift
wjk Jul 22, 2019
eeed58b
Add joinPath function to Utilities.swift
wjk Jul 22, 2019
4081512
Start reimplementing darwinbuild-codesign in Swift
wjk Jul 22, 2019
7208c55
Continue reimplementing darwinbuild-codesign
wjk Jul 22, 2019
be94dba
Finish reimplmenting darinwbuild-codesign in Swift
wjk Jul 22, 2019
e4769b5
Fix darwinbuild-codesign bugs
wjk Jul 22, 2019
f7c991c
Remove Python darwinbuild-codesign
wjk Jul 22, 2019
18cd89a
Fix signing error
wjk Jul 22, 2019
3eb1362
Update xcodebuild arguments in installer/build.sh
wjk Jul 22, 2019
31e3171
Fix path name in status message
wjk Jul 22, 2019
718be77
Move scheme file into shared directory
wjk Jul 22, 2019
81f8527
Add darwinbuild-recursive Swift implementation
wjk Jul 22, 2019
6dde895
Update copyright header
wjk Jul 22, 2019
8a7c2f4
Clarify error message
wjk Jul 22, 2019
ce9091e
Fix several bugs in darwinbuild-recursive
wjk Jul 22, 2019
bbf2937
Fix readProcessOutput()
wjk Jul 22, 2019
7c94bfa
Use absolute path to darwinbuild
wjk Jul 22, 2019
a64355b
Fix darwinbuild flag typo
wjk Jul 22, 2019
eb07b4a
Use Swift implementation of darwinbuild-recursive
wjk Jul 22, 2019
df38732
Fix code signing
wjk Jul 22, 2019
a053a04
Install in correct location
wjk Jul 22, 2019
26c4f07
Add Swift implementation of fetch-from-github
wjk Jul 22, 2019
42d9723
Use the Swift implementation of fetch-from-github
wjk Jul 22, 2019
876c01b
Merge pull request #34 from PureDarwin/catalina
csekel Jul 26, 2019
6eca8e5
Remove isysroot override from darwinbuild.xcconfig
wjk Aug 1, 2019
e058c0c
Retarget Xcode project to 10.14
wjk Aug 1, 2019
04b9557
Fix code signing/notarization errors
wjk Aug 2, 2019
6386647
Remove accidentally committed file
wjk Aug 2, 2019
5b9b1e9
Revert "Remove override of CODE_SIGN_IDENTITY"
wjk Aug 2, 2019
349f155
Use correct variable name in notarize.sh
wjk Aug 2, 2019
5c2689d
Print log file URL before exiting with an error
wjk Aug 2, 2019
aa9e79f
Typo fix
wjk Aug 2, 2019
251fc74
Fix path error in fetch-from-github tool
wjk Aug 2, 2019
8291ae9
Reinstate default search paths in darwinbuild.xcconfig
wjk Aug 11, 2019
77408f0
Resolve Xcode 11.3 update warnings
wjk Jan 7, 2020
0b03218
Support building multiple projects in darwinbuild-recursive
wjk Jan 7, 2020
1705278
Support passing multiple projects to darwinbuild-recursive
wjk Jan 7, 2020
2aa2a10
Merge pull request #35 from PureDarwin/improve-recursive
csekel Jan 9, 2020
5eba45a
Remove explicit SPM clone commands from script
wjk Feb 16, 2020
b7c8f72
Remove 5-attempt limit from notarize.sh
wjk Feb 16, 2020
572169a
Remove empty Copy Files build phases
wjk Feb 16, 2020
56c2ff1
Resolve Xcode 11.4 update warnings
wjk Apr 28, 2020
16f9e40
Resolve Xcode update warnings
wjk May 1, 2020
114cf43
Don't pass RC_ProjectSourceVersion and similar to Xcode
wjk May 1, 2020
852c8d3
Merge pull request #36 from PureDarwin/version-flexibility
wjk May 1, 2020
f3c19da
Fix signing errors that Xcode inserted
wjk May 1, 2020
b12c764
Restore $RC_ProjectName
wjk May 25, 2020
daab8f2
Remove set -e from notarize.sh
wjk May 25, 2020
0c450eb
Merge branch 'master' of github.com:PureDarwin/darwinbuild
wjk May 31, 2020
0b16e68
Fix authoring errors in installer distribution file
wjk Jun 25, 2020
aeb26b4
Merge branch 'master' of github.com:PureDarwin/darwinbuild
wjk Jul 12, 2020
e6d7a3e
Fix indentation error
wjk Jul 12, 2020
ea66079
Add support for macOS Big Sur to setXcodePlatform script
wjk Aug 2, 2020
ce40759
Remove unused "Public" build configuration
wjk Aug 2, 2020
38ad722
Resolve Xcode 12 update warnings
wjk Aug 2, 2020
4f7c6dc
Retarget entire project to 10.15
wjk Aug 2, 2020
1a4649c
Vendor Tcl
wjk Aug 2, 2020
2ad3a6c
Add ~n suffixes before the filename extension
wjk Aug 2, 2020
51ca0c2
Install vendored copy of libtcl to share/darwinxref
wjk Aug 4, 2020
f5976f6
Link binary darwinxref plugins against vendored libtcl
wjk Aug 4, 2020
9e964f6
Merge pull request #38 from PureDarwin/logfile-extensions
wjk Aug 6, 2020
a7cb6c8
Merge pull request #37 from PureDarwin/big-sur
wjk Aug 6, 2020
ea11ba1
Fix signing errors in Xcode project
wjk Aug 6, 2020
0ab7faf
Install libtcl8.6.dylib using Xcode
wjk Aug 6, 2020
eacef69
Remove subversion integration
wjk Aug 17, 2020
52f0634
Error out if patch not downloaded
wjk Aug 17, 2020
19ef143
Remove branch command from darwinxref
wjk Aug 17, 2020
9d708e5
Do not use linker flags to link darwinxref with libtcl
wjk Aug 17, 2020
bae15fc
Minor cleanup
wjk Aug 17, 2020
a5d829d
Revert "Add ~n suffixes before the filename extension"
wjk Aug 17, 2020
abc366f
Merge pull request #39 from PureDarwin/refactoring-downloads
wjk Aug 18, 2020
9186dfb
Use CoreFoundation.framework from SDK
wjk Aug 18, 2020
92d5339
Resolve Xcode update warnings
wjk Oct 2, 2020
28ad54c
Rewrite darwinbuild-codesign tool
wjk Aug 17, 2020
6c120cf
Update installation directory of darwinbuild-codesign
wjk Aug 17, 2020
8f3ba10
Add -codesign flag to darwinbuld
wjk Aug 17, 2020
0af0f90
Always ensure the signing prefix ends in a dot
wjk Aug 17, 2020
692d230
Make darwinbuild-codesign print status messages
wjk Aug 17, 2020
8f899c4
Update error message
wjk Aug 17, 2020
28a8cb2
Change darwinbuild-codesign to take certificate name from command line
wjk Aug 19, 2020
a338504
Add -codesign flag to darwinbuild
wjk Aug 19, 2020
26cf7b6
Simplify syntax
wjk Aug 19, 2020
7b26562
Pass certificate name in darwinbuild script
wjk Aug 19, 2020
da94af0
Don't invoke darwinbuild-codesign if adhoc signing is used
wjk Sep 4, 2020
a2efd2b
Rename darwinbuild-codesign binary name to sign-tool
wjk Oct 2, 2020
1fe73a8
Remove support for specifying a signing certificate per-file
wjk Oct 3, 2020
8590f88
Add documentation on how to use darwinbuild-codesign
wjk Oct 3, 2020
fc0e005
Add session on keychain preparation to docs
wjk Oct 3, 2020
0a2c68a
Clean up grammar
wjk Oct 3, 2020
12b3f7c
Merge pull request #40 from PureDarwin/rewrite-codesign
csekel Oct 4, 2020
e1483c8
Update instructions in README
wjk Oct 4, 2020
1ace89d
Add CreatePureDarwinSDK function to darwinbuild.common
wjk Oct 3, 2020
19ee4f9
Add PDSDKSettings.plist
wjk Oct 3, 2020
290221f
Install PDSDKSettings.plist
wjk Oct 3, 2020
df283cb
Add code to darwinbuild to create the SDK
wjk Oct 3, 2020
c644581
Write SDKROOT settings into darwinbuild.xcconfig
wjk Oct 3, 2020
11f6f64
Ditto into PureDarwin.sdk
wjk Oct 3, 2020
787d499
Use BuildCache instead of var/tmp
wjk Oct 3, 2020
5392ce8
Show clang version instead of cctools
wjk Oct 3, 2020
08a808e
Remove RC_BuildRoot
wjk Oct 3, 2020
1b58389
Reinstate DEPROOT
wjk Oct 3, 2020
6aee0db
Typo fix
wjk Oct 3, 2020
3e3cdae
Fix copying of .h files
wjk Oct 3, 2020
8c8d099
Fix if test, add status message
wjk Oct 3, 2020
85382a6
Fix filename
wjk Oct 3, 2020
2eb60c3
Fix SDKROOT value
wjk Oct 3, 2020
a9b2ac2
Typo fix
wjk Oct 3, 2020
1b7e874
Delete stale symlinks to avoid following them
wjk Oct 3, 2020
5e05db2
Mark variables as local
wjk Oct 3, 2020
ac14d94
Reduce the number of basename and dirname calls
wjk Oct 3, 2020
fc804a2
Symlink darwinbuild receipts folder
wjk Oct 3, 2020
c1e59d6
Save and restore $IFS
wjk Oct 3, 2020
b1a21bd
Use cp instead of ditto
wjk Oct 3, 2020
531ec9e
Do not symlink frameworks when creating SDK
wjk Oct 3, 2020
1ad36fd
Ensure the SDK is created before it is used
wjk Oct 3, 2020
e985d40
Add extra safety check
wjk Oct 3, 2020
91d6782
Fix path error
wjk Oct 3, 2020
f016f9e
Remove "exit 2" debugging aids; remove extra popd
wjk Oct 3, 2020
2818e37
Add special-case handling for /usr/lib/swift/
wjk Oct 3, 2020
fdf6c27
Add -nosdk flag
wjk Oct 19, 2020
4b64f58
Don't create the SDK if -nosdk is specified
wjk Oct 27, 2020
6894e59
Make CreatePureDarwinSDK more efficient
wjk Oct 27, 2020
e9db182
Simplify specification of alternate SDK
wjk Oct 27, 2020
46e8241
Revert "Do not symlink frameworks when creating SDK"
wjk Nov 20, 2020
cfa0120
Use different method to copy roots into the BuildRoot
wjk Nov 20, 2020
9db2da0
Fix symlinking of SDK frameworks
wjk Nov 20, 2020
4682660
Squelch pointless Xcode warning
wjk Nov 20, 2020
a6b4e7d
Fix installation of header roots
wjk Nov 20, 2020
240526d
Simplify root-copying code significantly
wjk Nov 20, 2020
e63d991
Typo fix
wjk Nov 20, 2020
f4e9871
Don't follow symlinks into Xcode
wjk Nov 20, 2020
18e0d28
Add extra safety check
wjk Nov 20, 2020
39145ee
Delete symlinks (if any) before making directories
wjk Nov 20, 2020
43ff5ac
Keep failing rm call from stopping darwinbuild
wjk Nov 20, 2020
1724889
Prevent spurious rm error message
wjk Nov 20, 2020
7078f5b
Fix indentation error
wjk Nov 20, 2020
0e8f155
Copy symlinks before creating directories
wjk Nov 20, 2020
bce6651
Process links separately than other files
wjk Nov 21, 2020
4818ff9
Silence file-not-found message
wjk Nov 21, 2020
acc2413
Fix ugly perl dependancy
johnothwolo Jan 18, 2021
7d38cb0
Fix find invocation
wjk Jan 19, 2021
c6f3c42
Merge pull request #42 from jotbyte/master
wjk Jan 19, 2021
cde9443
Merge pull request #41 from PureDarwin/sdkroot
csekel Jul 17, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
build/
.DS_Store
darwinbuild.xcodeproj/project.xcworkspace/
darwinbuild.xcodeproj/xcuserdata/

# Build byproduct files
darwinxref/libtcl8.6.dylib

# Installer files
*.pkg
installer/payload
Empty file added .gitmodules
Empty file.
94 changes: 94 additions & 0 deletions Documentation/code_signing.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,94 @@
# Code Signing with darwinbuild

darwinbuild supports Apple code signing, both automatically via Xcode,
and manually from the command line. Code signing is enabled by passing
the `-codesign` flag on the command line, like this:

```shell
sudo darwinbuild -codesign='Developer ID Application' some_project
```

The string after the equals sign is the name of the certificate you want
Xcode to use. However, since darwinbuild must be run as root, it does not
have access to your personal keychain (which is where I presume you are storing
your signing materials). Therefore, you **must** run the steps under “Keychain
Preparation” below at least once before this will work, and ensure that the
DEVELOPER_TEAM property is set every time you build. You can either set this in
your project file, or via the `environment` key in the darwinbuild plist.
Passing the variable via `export` or `sudo env` will *not* work.

## Format of darwinbuild-codesign.plist

If you want to do manual code-signing (if your project is not built by Xcode,
for example), install a file called `darwinbuild-codesign.plist` in the
`/usr/local/darwinbuild` folder of your DSTROOT during the build. After the
build is complete, darwinbuild will locate the file, parse it, perform
the signing, and then delete it from the DSTROOT (so the codesign plists
do not collide, which would confuse darwinbuild no end).

Here is a sample `darwinbuild-codesign.plist` file:

```xml
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>hardened_runtime</key>
<true/>
<key>prefix</key>
<string>com.mycompany.</string>
<key>timestamp</key>
<true/>
<key>files</key>
<dict>
<key>/usr/local/bin/my_library</key>
<true/>
<key>/usr/local/lib/my_program</key>
<dict>
<key>identifier</key>
<string>com.mycompany.my_special_program</string>
<key>order</key>
<string>1</string>
</dict>
</dict>
</dict>
</plist>
```

At the top level are keys that provide settings for all files. These are:

* `hardened_runtime`: Boolean, default false. If true, `-o runtime` will be included in the codesign arguments.
* `prefix`: String, corresponds to the `--prefix` flag of codesign. If you provide a value, it must end in a `.`, or codesign will not create the signing identifier you expect (it won’t add the dot for you).
* `timestamp`: Either boolean or string. If `true` (default), use Apple’s timestamping service. If `false`, no timestamp server will be used. If a string, it will be interpreted as the URL of the timestamping server to use.

The `files` dictionary contains as keys list of files to sign. These are usually
provided as absolute paths, but are treated relative to the DSTROOT. If the
value of the key is `true`, all default settings (at the top level of the plist)
will be used. Otherwise, it is interpreted as a dictionary with the following keys:

* `identifier`: The code signing identifier. It will be used verbatim by codesign. Per the manual page, do **NOT** sign two different pieces of code with the same identifier.
* `hardened_runtime`: Overrides the default `hardened_runtime` setting, if present.
* `prefix`: Overrides the default `prefix` setting, if present.
* `dr`: The Designated Requirement for the code being signed. This is usually computed automatically during the sgning process.
* `order`: The order index at which the file will be signed.

Every file in the `files` dictionary has an order index. By default, all files
have an order index of 65535. If you override this setting with another value,
you can control in which order the files are signed. This can be useful when
signing bundles that contain other bundles that also need to be signed.
Files with the lowest index values are signed first.

## Keychain Preparation

By default, darwinbuild does not have access to your user keychain, because it
runs xcodebuild in a different user session than the sudo process provides. You
must therefore add the keychain with your signing materials (referred to below
as `$KEYCHAIN_PATH`). Follow the below steps.

1. `sudo su`; enter password
2. `security list-keychains -d user -s $KEYCHAIN_PATH /Library/Keychains/System.keychain`
3. `security unlock-keychain $KEYCHAIN_PATH`; enter password
4. `security list-keychains`; if `$KEYCHAIN_PATH` is listed in the output, you’re good to go.

This should only need to be done once per Mac. Note that there is a possibility
that macOS updates will undo this change. If this ever happens, simply repeat the above steps.
81 changes: 81 additions & 0 deletions Documentation/creating_darwinbuild_plists.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
# Creating Build Definition Property Lists

To use darwinbuild, you will need to create an XML-format property list that
contains the build definitions. A barebones example looks like this:

```xml
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>source_sites</key>
<array>
</array>

<key>build</key>
<string>PD17D4</string>

<key>environment</key>
<dict>
<key>MACOSX_DEPLOYMENT_TARGET</key>
<string>10.13</string>
<key>SDKROOT</key>
<string>macosx10.13</string>
</dict>

<key>projects</key>
<dict>
<key>xnubuild</key>
<dict>
<key>version</key>
<string>10.13</string>
</dict>
</dict>
</dict>
</plist>
```

Here is a key-by-key explanation of the above property list:

* **`source_sites`**
This is a list of URLs from which darwinbuild will attempt to download the
source code for the projects it will build. Each URL will be tried in the order
it is specified here. The desired filename will be appended to each URL. If
the download returns a 404 or other error, the next URL will be tried.

The only exception to the above logic is in the case of `opensource.apple.com`.
If the URL to download from contains the substring `opensource.apple.com/tarballs`,
then the project name (the part of the filename to download before the first hyphen)
will be prepended before the filename, like this: `opensource.apple.com/tarballs/<project>/<filename>`.
This is done to align with the way Apple organizes their website.
* **`build`**
This is the identifier of the “build” of PureDarwin the property list represents.
While there is no requirements for its format, it *must* match the filename exactly
(minus the `.plist` extension). Otherwise, darwinbuild will be unable to correctly
load the build definitions.
* **`environment`**
This dictionary contains a 1:1 mapping of environment variables that will
be propagated into each build command invoked by darwinbuild.
* **`projects`**
This is where the meat of the build definition is. The contents of
this dictionary will be described under “Project Definitions,” below.

### Project Definitions

A “project” is the core of the darwinbuild dependency model. The name of the project
is specified as the key in the `projects` dictionary. A project’s name is used to
refer to the project from both the command line, and from other projects as dependencies.

The “version” of a project is in practice an arbitrary string, and is specified as
the `version` key in the project definition. Apple open-source releases
use a dot-separated sequence of one to five positive numbers here, but the logic behind
the changing of these numbers has never been publicly described. There is no strict
interpretation of which version is “newer” than another; if the version number has changed
in any way, the the project sources have changed and must be rebuilt. darwinbuild supports
keeping multiple versions of the same project in the Sources subdirectory of the build directory.

The version does, however, determine the name of the source tarball to be downloaded.
It will always have the following format: `<project_name>-<version>.tar.gz`. The source
tarball must be available from one of the `source_sites` under this filename. If none
of the `source_sites` contain a copy of this file, darwinbuild also supports downloading
source archives from GitHub Releases; this is detailed in the “GitHub Releases Support” section.
Loading