2 | | '''Last updated 1/26/12''' |
3 | | |
4 | | This document applies to BOINC version 6.13.9 and later. It has instructions for building the BOINC Client and Manager for Macintosh OS X. For information on building science project applications to run under BOINC on Macintosh OSX, see BuildMacApp. |
5 | | |
6 | | Note: the information in this document changes from time to time for different versions of BOINC. For any version of BOINC source files, the corresponding version of this document can be found in the source tree at: |
| 2 | '''Last updated 7/17/12''' |
| 3 | |
| 4 | This document applies to BOINC version 7.0.32 and later. It has instructions for building the BOINC Client and Manager for Macintosh OS X. For information on building science project applications to run under BOINC on Macintosh OSX, see BuildMacApp. |
| 5 | |
| 6 | '''Note''': the information in this document changes from time to time for different versions of BOINC. For any version of BOINC source files, the corresponding version of this document can be found in the source tree at: |
25 | | You need to take certain steps to ensure that you use only APIs that are available in all the OS versions BOINC supports for each architecture. The best way to accomplish this is to use a single development system running OS 10.7.x and cross-compile for the various platforms. The remainder of this document describes that process. |
26 | | |
27 | | '''The above requirements apply not only to BOINC itself, but also to the !WxWidgets, JPEG, c-ares and cURL libraries, as well as all project applications.''' Note: only the JPEG library must be built for the x86_64 architecture, since it is used by the libboinc_graphics_api library. |
| 25 | You need to take certain steps to ensure that you use only APIs that are available in all the OS versions BOINC supports for each architecture. The best way to accomplish this is to use a single development system running OS 10.7.x or OS 10.8.x and cross-compile for the various platforms. The remainder of this document describes that process. |
| 26 | |
| 27 | '''The above requirements apply not only to BOINC itself, but also to the !WxWidgets, c-ares, cURL and openSSL libraries, as well as all project applications.''' |
42 | | '''Building BOINC now requires Xcode Tools version 3.2 or later but Xcode 4.2 or later is recommended.''' |
43 | | |
44 | | If you have the OS 10.6 installation DVD for your system, you can install XCode Tools at the time you install the OS, or you can install it later by opening the file `Optional Installs/XCode Tools/XCodeTools.mpkg`. |
45 | | |
46 | | You can download Xcode 3.2 or 4.2 from Apple's web site (it is large: 1.1 GB). You must be a member of the Apple Developer Connection to download the software, but you can join for free at: |
47 | | http://connect.apple.com |
| 40 | '''Building BOINC now requires Xcode Tools version 3.2 or later but Xcode 4.3 or later is recommended.''' |
| 41 | |
| 42 | You can download Xcode 4.3 or Xcode 4.4 from Apple's App Store (it is large: about 2 GB). If you are a member of Apple's Mac Developer Program, you can also download it from Apple's web site: http://developer.apple.com. |
89 | | These are not done by either the XCode projects which come with wxMac-2.8.10, nor the !AutoMake scripts supplied with wxMac-2.8.10, c-ares-1.7.4, curl-7.21.7, or jpeg-6b. So be sure to use our special scripts to build these packages. |
90 | | |
91 | | 1. Create a parent directory within which to work. In this description , we will call it BOINC_dev, but you can name it anything you wish. |
92 | | 2. Put the following 3 directories inside the BOINC_dev folder (omit any you don't need): |
93 | | {{{ |
94 | | c-ares-1.7.4 |
95 | | curl-7.21.7 |
| 90 | These are not done automatically by either the Xcode projects which come with wxMac-2.8.10, nor the AutoMake scripts supplied with wxMac-2.8.10, c-ares-1.9.1, curl-7.26.0 and openssl-1.0.1c. So be sure to use our special scripts to build these packages. |
| 91 | |
| 92 | 1. Create a parent directory within which to work. In this description , we will call it BOINC_dev, but you can name it anything you wish. |
| 93 | |
| 94 | 2. Put the following 3 directories inside the BOINC_dev folder (omit any you don't need): |
| 95 | {{{ |
| 96 | c-ares-1.9.1 |
| 97 | curl-7.26.0 |
| 98 | openssl-1.0.1c |
98 | | Important: do not change the names of any of these 3 directories. |
99 | | 3. Get the BOINC source tree from SVN, and put it in the same BOINC_dev folder. To do this, type the following in Terminal: |
| 101 | Important: do not change the names of any of these 4 directories. |
| 102 | |
| 103 | '''Note:''' Building wxMac-2.8.10 requires the MacOSX10.6.sdk, which is not included in Xcode 4.4 and later. If you are building wxMac-2.8.10 with Xcode 4.4, see the section [#InstallingandsettingupXcode Installing and setting up Xcode] for further information. |
| 104 | |
| 105 | 3. Get the BOINC source tree from SVN, and put it in the same BOINC_dev folder. To do this, type the following in Terminal: |
104 | | (You may change the name of the `boinc` directory to anything you wish.) Hint: if you have trouble getting this to work, try using `https` instead of `http`. |
105 | | |
106 | | The command above retrieves the source code from the HEAD (TRUNK) or development branch of the SVN repository. See more information on [SourceCode getting the BOINC source code]. |
107 | | 4. Run the script to build the c-ares, curl, jpeg and wxMac libraries as follows: |
| 110 | (You may change the name of the `boinc` directory to anything you wish.) Hint: if you have trouble getting this to work, try using `https` instead of `http`. |
| 111 | |
| 112 | The command above retrieves the source code from the HEAD (TRUNK) or development branch of the SVN repository. See more information on [SourceCode getting the BOINC source code]. |
| 113 | |
| 114 | 4. Run the script to build the c-ares, curl, openssl and wxMac libraries as follows: |
112 | | If you don't wish to force a full rebuild of everything, omit the -clean argument. |
113 | | |
114 | | Note: this script builds c-ares and curl first, followed by jpeg and finally wxMac. If you haven't downloaded wxMac because you aren't building the BOINC Manager, the script will build c-ares, curl and jpeg. Likewise, if you downloaded only c-ares and curl because you aren't building the BOINC Manager, the script will build c-ares, curl and jpeg before quitting. |
115 | | 5. Build BOINC as follows: |
116 | | |
117 | | BOINC itself is built using the '''boinc.xcodeproj''' file. You can either build directly in XCode (more information below) or run the '''BuildMacBOINC.sh''' script: |
| 119 | If you don't wish to force a full rebuild of everything, omit the -clean argument. |
| 120 | |
| 121 | '''Note 1:''' Be sure to run the script using the source command. Do not double-click on the scripts or use the sh command to run them. |
| 122 | |
| 123 | '''Note 2:''' this script builds c-ares and curl first, followed by openssl and finally wxMac. If you haven't downloaded wxMac because you aren't building the BOINC Manager, the script will build c-ares, curl and openssl before quitting. |
| 124 | |
| 125 | 5. Build BOINC as follows: |
| 126 | |
| 127 | BOINC itself is built using the '''boinc.xcodeproj''' file. You can either build directly in XCode (more information below) or run the '''BuildMacBOINC.sh''' script: |
152 | | '''Note:''' To perform a release build under Xcode 4.2 when not using the BuildMacBOINC.sh script, select "Build for archiving" from Xcode's Product menu. Do '''not''' select "Archive." |
153 | | |
154 | | The standard release of BOINC version 6.13.0 and later builds only for Macintosh computers with Intel processors. Most of the executables are built only for the i386 architecture. The libraries and the screensaver are built as universal binaries containing builds for two architectures: i386 and x86_64. |
155 | | |
156 | | '''Important compatibility note:''' Xcode 4.x comes with only two Mac SDKs: MacOSX10.6.sdk and MacOSX10.7.sdk. The BOINC Xcode project uses MacOSX10.6.sdk so that it can build with either Xcode 4.x or Xcode 3.2. However, a couple of the libraries in MacOSX10.6.sdk require OS 10.6 or later to run. If you are building only to run on OS 10.6 or later, you don't need to do anything else. |
157 | | |
158 | | However, if you want to build BOINC so it will run on OS 10.4 and OS 10.5, you must either: |
159 | | * build with Xcode 3.2, or |
160 | | * build with Xcode 4.x after copying the MacOSX10.5.sdk from an older version of Xcode to your /Developer/SDKs/ folder. The BOINC Xcode project will automatically detect the presence of that SDK and use the two older libraries needed for backward compatibility. |
| 162 | '''Note:''' To perform a release build under Xcode 4.3 when not using the BuildMacBOINC.sh script, select "Build for archiving" from Xcode's Product menu. Do '''not''' select "Archive." |
| 163 | |
| 164 | The standard release of BOINC version 6.13.0 and later builds only for Macintosh computers with Intel processors. Most of the executables are built only for the i386 architecture. The BOINC libraries and the screensaver are built as universal binaries containing builds for two architectures: i386 and x86_64. |
174 | | Substitute the 3 parts of the BOINC version number for x y and z in the above. For example, to build the installer for BOINC version 6.13.9, the command would be |
175 | | |
176 | | {{{ |
177 | | source {path}/BOINC_dev/boinc/mac_installer/release_boinc.sh 6 13 9 |
178 | | }}} |
179 | | |
180 | | This will create a directory 'BOINC_Installer/New_Release_6_13_9' in the BOINC_dev directory, and the installer will be located in `{path}/BOINC_dev/BOINC_Installer/New_Release_6_13_9/boinc_6.13.9_macOSX_universal`. |
| 178 | Substitute the 3 parts of the BOINC version number for x y and z in the above. For example, to build the installer for BOINC version 7.0.32, the command would be |
| 179 | |
| 180 | {{{ |
| 181 | source {path}/BOINC_dev/boinc/mac_installer/release_boinc.sh 7 0 32 |
| 182 | }}} |
| 183 | |
| 184 | This will create a directory 'BOINC_Installer/New_Release_7_0_32' in the BOINC_dev directory, and the installer will be located in `{path}/BOINC_dev/BOINC_Installer/New_Release_7_0_32/boinc_7.0.32_macOSX_i686`. |
| 185 | |
| 186 | |
| 187 | == Code Signing the BOINC Manager Installer and Uninstaller == |
| 188 | |
| 189 | Mac OS 10.8 introduces a security feature called Gatekeeper, whose default settings won't allow a user to run applications or installers downloaded from the Internet unless they are signed by a registered Apple Developer. The `release_boinc.sh` script looks for a file `~/BOINCCodeSignIdentity.txt` containing the name of a valid code signing identity stored in the user's Keychain. If this is found, the script will automatically sign the BOINC installer and BOINC uninstaller using that identity. For example, if your user name is John Smith, the first line of `~/BOINCCodeSignIdentity.txt` would be something like the following: |
| 190 | {{{ |
| 191 | Developer ID Application: John Smith |
| 192 | }}} |
| 193 | |
| 194 | If there is no `~/BOINCCodeSignIdentity.txt` file, then the script will not sign the installer or uninstaller. For more information on code signing identities see the documentation for the [https://developer.apple.com/library/mac/documentation/Darwin/Reference/ManPages/man1/codesign.1.html `codesign`] utility and Apple's [https://developer.apple.com/library/mac/documentation/Security/Conceptual/CodeSigningGuide/ Code Signing Guide]. |
| 195 | |
| 216 | |
| 217 | == Installing and setting up Xcode == |
| 218 | |
| 219 | Versions of Xcode prior to Xcode 4.3 have an installer package. After downloading Xcode, mount the disk image file by double-clicking on it, then double-click the installer package. |
| 220 | |
| 221 | Starting with Xcode 4.3, the disk image contains a copy of Xcode itself. After mounting the disk image, drag the Xcode icon to the folder where you wish it to reside. In most cases, this will be the `/Applications/` folder. Unmount the disk image by dragging it to the trash. Finally, double-click on the installed Xcode icon to run Xcode. Xcode will display a dialog allowing you to finish the installation; you must do this before running BOINC's build scripts. (Some versions of Xcode may not display this dialog until you open a file with Xcode.) |
| 222 | |
| 223 | Building wxMac-2.8.10 requires the MacOSX10.6.sdk, which is not included in Xcode 4.4 and later. If you are building wxMac-2.8.10 with Xcode 4.4, you must install the OS 10.6 SDK as follows: |
| 224 | 1. Download a version of Xcode for OS 10.7 Lion (such as Xcode 4.3.3.) |
| 225 | |
| 226 | 2. Mount the disk image file by double-clicking on it. Do '''not''' drag-install this older version of Xcode. |
| 227 | |
| 228 | 3. On the disk image, control-click on the Xcode icon and select `Show Package Contents`. |
| 229 | |
| 230 | 4. On the older Xcode disk image, browse to the directory: |
| 231 | {{{ |
| 232 | /Volumes/Xcode/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/ |
| 233 | }}} |
| 234 | You should see a folder named `MacOSX10.6.sdk`. |
| 235 | |
| 236 | 5. Control-click on your newer Xcode icon (which you previously installed on your hard drive) and select `Show Package Contents`. |
| 237 | |
| 238 | 6. In your newer Xcode Browse to the directory: |
| 239 | {{{ |
| 240 | /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/` |
| 241 | }}} |
| 242 | (or the equivalent if you installed it somewhere other than your `/Applications/` folder.) |
| 243 | |
| 244 | 7. Copy the `MacOSX10.6.sdk` folder from the SDKs folder on the older disk image to the SDKs folder in the newer Xcode. |
| 245 | |
| 246 | 8. Unmount the disk image by dragging it to the trash. |