$NetBSD: README.MacOSX,v 1.20 2015/02/22 17:11:34 gdt Exp $

* system tools issues

** gcc vs clang

Older versions of Mac OS X (when XCode is installed) provided gcc, and
pkgsrc defaulted to using gcc.  With 10.9, gcc is no longer present.
(In 2014Q2 and earlier, one must explicitly bootstrap with
"--compiler=clang".)

** i386 vs x86_64 ABI issue

Mac OS X 10.6 through 10.10 supports 64-bit binaries on most Intel
Macs and builds those by default on such machine.  This has caused
problems with packages which get confused because "MACHINE_ARCH" is in
some OS versions set to "i386" (on a 64-bit system!).
  version:  uname -m : uname -p
  10.6: i386 : i386
  10.9: x86_64 : i386

There are of course some packages which will fail in i386 mode, and
some in x86_64 mode.  Because of all this, the default for pkgsrc was
set to use the 32-bit ABI, which results in packages being compiled
and run in i386 mode.  In addition, there are some Intel Macs (older
Mac Minis) which can only run i386 and not x86_64.  For a longer
discussion, see:
http://mail-index.NetBSD.org/pkgsrc-users/2009/09/24/msg010817.html

As of 2014, the decision to default to i386 should probably be
revisited.

** sed in 10.9

The sed that comes with 10.9 appears to be broken; it exits when
called on files with UTF-8 or other apparently-binary content.
Therefore, pkgsrc uses nbsed on 10.9.

* Developer tools and prerequisites

** basic tools

If you haven't already, you will need to install the Mac OS X
Developer Tools package (XCode) to obtain a compiler, etc.  The
procedure depends on the version of Mac OS X; recent versions use the
App Store.

Note that as of 10.9, cvs is no longer provided.  You can build
devel/scmcvs.  To obtain pkgsrc in order to bootstrap and build cvs,
it may be useful to `git clone https://github.com/jsonn/pkgsrc.git`.

** X11

X11 used to be built into Mac OS X, but as of 10.8 it is no longer
included.  Install XQuartz from http://xquartz.macosforge.org/landing/

* Mac OS X Versions

pkgsrc is a volunteer project, and individuals support/fix packages
and platforms as they choose.  However, pkgsrc contributors as a group
share both a bugtracker and norms about what is ok to break and what
is not.  To describe these norms, we define levels of concern, keeping
in mind that there are no guarantees:

  SUPPORTED doesn't mean that anyone is required to fix your problem; it
  means that we agree that it is broadly desireable that such problems
  be fixed and that we therefore allow them to be listed in our issue
  tracker.  Structural breakage is unacceptable.

  DEPRECATED means that individual problems are not of interest, but
  pkgsrc overall working is of enough interest to be allowed to be
  listed in the issue tracker.  Structural breakage is undesirable,
  but a fair topic of discussion if keeping support is painful.
  Individual pkg PRs may be bounced to authors to retest with newer
  versions, and closed if that doesn't happen in 14 days.

  IGNORED means we are not willing to expend issue tracker resources
  (clutter for those reviewing the db) at all.  PRs may be summarily
  closed.  We are also unconcerned with whether pkgsrc works on the
  system at all.

Given the above definitions, the pkgsrc developers label versions of
Mac OS X as follows:

  10.10: current. [SUPPORTED]

  10.9 (13.1.0): somewhat old but not that crufty.  [SUPPORTED]

  10.8: old.  [SUPPORTED]

  10.7: old.  [SUPPORTED]

  10.6 (10.8.0): very old [DEPRECATED] (But note that this is the
  Joyent i386-mode build target.)

  10.5 and below: ancient, and PRs will be summarily closed.  It is
	acceptable to give zero consideration to causing structural
	problems on 10.5 and below. [IGNORED]

Because Apple provides 10.9 as a no-cost upgrade (from 10.6 or higher,
it is fairly likely that 10.6-10.8 will become DEPRECATED faster than
they might have otherwise.  (The rationale for supporting versions
beyond the current and previous ones has been the difficulty for users
to upgrade.)

* Bulk builds

Clearly, it is desirable for a bulk build to be useful on as many
computers as possible.  The main issues are which ABI and which OS X
version.  Targetting older versions makes a build run on more systems,
and targetting newer versions makes the build closer to what would be
obtained from bootstrappping on a newer version and thus avoids some
issues.

** 10.6, --abi=32

Joyent provide a bulk build for quarterly branches (--abi=32, OSX
10.6, and therefore gcc 4.2.1, XQuartz, X11_TYPE=native):
  http://pkgsrc.joyent.com/install-on-osx/
which should run on any version from 10.6 and up.

Note that sed on 10.9 is broken, but a bootstrap on 10.6 will not
avoid it, so while one can install this bootstrap on 10.9 and run
binary packages, building packages will not in general work.

** 10.9, --abi=64 --compiler=clang

Joyent provide a build build for 10.9/x86_64, at the same URL as
above.
