Annotation of wikisrc/pkgsrc/macos_porting_notes.mdwn, revision 1.1
1.1 ! schmonz 1: # Darwin vs macOS
! 3: macOS consists of Darwin (kernel/userland) plus Mac stuff on top.
! 4: pkgsrc used to target Darwin, but given the tools issued discussed
! 5: below it is not clear that it works on Darwin without macOS. Darwin
! 6: from Apple is no longer open source.
! 8: Users of non-macOS Darwin are invited to submit patches to this file.
! 9: The only known project is:
! 10: http://www.puredarwin.org/
! 12: Until then, this file remains macOS-centric.
! 14: # system tools issues
! 16: ## native headers vs SDK
! 18: macOS used to include system headers in /usr/include, so that one
! 19: could treat it like a relatively normal POSIX system. Starting at
! 20: approximately 10.9, headers were no longer available at the standard
! 21: location, and one has to use an SDK that puts headers someplace else.
! 22: pkgsrc supports this, but there has been some confusion where a 10.9
! 23: system produced binaries for 10.10, which only mostly works. The
! 24: confusion is believed to be resolved.
! 26: ### SDK version issues
! 28: The SDK supported versions and default versions do are not always the
! 29: same as the current system version. The following may be useful in
! 30: understanding one's situation:
! 32: /usr/bin/xcrun --show-sdk-version
! 33: sw_vers -productVersion
! 35: pkgsrc attempts to query the system version, and then ask the sdk to
! 36: use that version. See mk/platform/Darwin.mk for the code.
! 38: ## gcc vs clang
! 40: Older versions of OS X (when XCode is installed) provided gcc, and
! 41: pkgsrc defaulted to using gcc. With 10.9, gcc is no longer present.
! 43: ## i386 vs x86_64 ABI issue
! 45: This entire section is only about Intel Macs.
! 47: OS X 10.6 and higher supports x86-64 binaries on Intel Macs with
! 48: x86-64 processors, which is now most of them. i386 binaries are also
! 49: supported on most (all?) Intel machines.
! 51: ### issues related to ABI 32 vs 64
! 53: Note that a pkgsrc package built in x86_64 mode will not run on an
! 54: Intel Mac that is i386 only. For a longer discussion, see:
! 55: http://mail-index.NetBSD.org/pkgsrc-users/2009/09/24/msg010817.html
! 57: Somewhat separately from pkgsrc's ABI choice, there have been issues
! 58: with packages which get confused because "MACHINE_ARCH" is in some OS
! 59: versions set to "i386" (on a 64-bit system!). As of 2016 this should
! 60: be mostly resolved.
! 61: version: uname -m : uname -p
! 62: 10.6: i386 : i386
! 63: 10.9: x86_64 : i386
! 65: ### default ABI
! 67: The ABI is chosen at bootstrap time and encoded into mk.conf. So a
! 68: change in the default is about what a new bootstrap will do;
! 69: already-bootstrapped systems should remain unchanged. They should be
! 70: able to build and run new packages using the old ABI value.
! 72: pkgsrc used to set the default ABI as i386, both on systems with i386
! 73: processors and on systems with x86_64 processors. On 2015-11-09 the
! 74: default was changed so that ABI=64 is chosen on machines where "uname
! 75: -m" reports x86_64. (It remains i386 on others, which are not capable
! 76: of running x86_64 binaries.)
! 78: Generally, users will not need to deal with the default ABI change,
! 79: except that packages are mostly only portable across machines with the
! 80: same bootstrapping parameters.
! 82: If one unpacks a new binary bootstrap kit over an existing
! 83: installation, one can end up with a mix. The standard advice is not to
! 84: do this, and to rrebuild/reinstall all packages from scratch or a
! 85: compatible binary package set. But, one could also mark packages with
! 86: the wrong ABI as rebuild=YES and use pkg_rolling-replace.
! 88: ### change in storage of ABI information
! 90: On 2016-01-24, the way ABI information was stored in pkgsrc was
! 91: rationalized and simplified. The new code could compute the wrong ABI
! 92: for some previously-bootstrapped installations. The problem can be
! 93: resolved by building bmake with MACHINE_ARCH=x86_64 and updating that
! 94: package, as described in mail archives:
! 96: https://mail-index.netbsd.org/pkgsrc-users/2016/01/25/msg022870.html
! 98: (One would expect to be able to use make replace to do this. One
! 99: minor issue is that it requires pkg_tarup, although that will be
! 100: present on systems of those who use make replace. There also may be
! 101: an error with architecture mismatch from pkg_install requiring a "-f"
! 102: option. Repeatable data about recovery is somewhat hard to obtain, as
! 103: most are past this issue already and no longer interested in
! 104: experimenting.)
! 106: # Developer tools and prerequisites
! 108: ## XCode
! 110: This section applies to 10.6 through 11.
! 112: If you haven't already, you will need to install the macOS
! 113: Developer Tools package (XCode) to obtain a compiler, etc. The
! 114: procedure depends on the version of macOS; recent versions use the
! 115: App Store.
! 117: ### Command-line Tools
! 119: If one installs "Commmand Line Tools", then pkgsrc can use the
! 120: compiler.
! 122: Since Xcode 7 (installed from the Apple Store) the development
! 123: environment can upgrade itself without interaction from the user, but
! 124: will not automatically update the Command Line Tools. This will
! 125: cause system header files like stdlib.h not to be found by pkgsrc.
! 126: The command `xcode-select --install' will install the Command Line
! 127: Tools for Xcode.
! 129: In the past at least, Command Line Tools for Xcode could be obtained
! 130: from https://developer.apple.com/downloads/
! 132: ## cvs
! 134: Note that as of 10.9, cvs is no longer provided by Apple. You can build
! 135: devel/scmcvs. To obtain pkgsrc in order to bootstrap and build cvs,
! 136: it may be useful to `git clone https://github.com/NetBSD/pkgsrc.git`.
! 138: ## X11
! 140: X11 used to be built into macOS, but as of 10.8 it is no longer
! 141: included. You can install XQuartz from
! 142: https://www.xquartz.org, or try the newly-added pkgsrc
! 143: version.
! 145: # macOS Versions
! 147: Because Apple drops support for previous hardware faster than the
! 148: hardware fails, many machines cannot be upgraded to recent versions of
! 149: macOS, creating a greater than usual desire to support old systems.
! 150: Because of the particular history of deprecation, most systems tend to
! 151: run relatively recent versions or specific older versions.
! 153: The stance of pkgsrc is generally to avoid breaking older systems
! 154: unless keeping support would cause difficulty, and to accept clean
! 155: patches when there is no harm to non-deprecated versions. This
! 156: section is partly to document what versions tend to be used and why,
! 157: and partly to enable cleaning up bug reports without fixes for very
! 158: old systems.
! 160: pkgsrc PRs about 10.12 or older that do not contain fixes may be closed
! 161: without fixing.
! 163: macOS 11 (major versions are now just digits) is the current version;
! 164: hardware before 2013 cannot be upgraded to this version. Also this
! 165: version introduces support for Apple M1 processors, using the aarch64
! 166: instruction set.
! 168: macOS 10.15 is maintained and supports the same hardware as 10.14.
! 170: macOS 10.14 is somewhat old but still maintained. It cannot be run on
! 171: hardware before 2012 and Macbooks before 2015.
! 173: macOS 10.13 is old; Apple ended support in January of 2021.
! 174: Significant amounts of entirely functional hardware cannot be upgraded
! 175: beyond this version.
! 177: macOS 10.12 is very old. There is no known reason to run it, as all
! 178: (most?) hardware that runs 10.12 can run 10.13.
! 180: OS X 10.11 is very old; some hardware cannot be upgraded beyond this
! 181: version, but most of it is old and slow, dating from approximately
! 182: 2010 or earlier.
! 184: OS X 10.10, 10.9 and 10.8 are extremely old; most hardware that can
! 185: run them can probably run 10.11.
! 187: OS X 10.7 is the last version that works on a few Intel Macs, e.g. the
! 188: Mac Pro 1.1 and 2.1 and some Mac Minis.
! 190: OS X 10.6 is the last version that works on Intel Macs lacking amd64
! 191: support, e.g. Mac Minis and Macbooks with Core Duo.
! 193: OS X 10.5 is the last version that works on PowerPC Macs.
! 195: OS X 10.4 (Darwin 8.11.0) is the last version that works on PowerPC G3
! 196: and slower G4 Macs.
! 198: # Bulk builds
! 200: Clearly, it is desirable for a bulk build to be useful on as many
! 201: computers as possible. The main issues are which ABI and which macOS
! 202: version. Targeting older versions makes a build run on more systems,
! 203: and targeting newer versions makes the build closer to what would be
! 204: obtained from bootstrapping on a newer version and thus avoids some
! 205: issues. This section has pointers to active bulk builds.
! 207: ## 10.4, --abi=32 powerpc, gcc
! 209: Sevan Janiyan <Sevan@NetBSD.org> provides a bulk build for the -current branch
! 210: (--abi=32, OS X 10.4/PowerPC, gcc 4.0.1 from Xcode 2.5, X11_TYPE=modular):
! 211: https://www.geeklan.co.uk/?p=1579
! 212: US repo: http://sevan.mit.edu/packages
! 213: Euro mirror: http://pkgsrc.geeklan.co.uk/packages/current/Darwin-8
! 214: See
! 215: https://mail-index.netbsd.org/pkgsrc-bulk/2015/11/07/msg012171.html
CVSweb for NetBSD wikisrc <wikimaster@NetBSD.org> software: FreeBSD-CVSweb