pkgsrc on Mac OS X
Amitai Schlair
The NetBSD Project
What's strange about Mac OS X?
- Kernel: not BSD-like (affects kernel-aware packages such as LKMs)
- Userland:
- Was NeXT-like
- Is FreeBSD-like, yet diverges from that too:
- NetInfo, lookupd
- No user(8) or group(8) utilities
- launchd instead of rc.d (and more)
- By default, case-insensitive filesystem (HFS+):
- Cannot cvs co pkgsrc onto it
- But DISTDIR, PACKAGES, WRKOBJDIR can be on it
- Preprocessor: by default, behaves incompatibly from GNU cpp
- Has a libtool(1), but it's not GNU libtool
- Linker: not GNU ld
- No ldd(1); otool(1) does some similar things
- Object format: not a.out, not ELF... Mach-O
- Link with shared libraries by providing full path to installed library
- Dynamic shared object loading API: not dlopen(3)
How does pkgsrc accommodate?
- sysutils/user_darwin: key features of user(8) and group(8) sufficient for PKG_{USERS,GROUPS}
- pkgtools/rc.subr: enough for most pkgsrc rc.d scripts to function
- bootstrap/ufsdiskimage: creates mountable filesystem image containing case-sensitive UFS
- CPP_PRECOMP_FLAGS: induces GNU-compatible behavior in cpp
- Patches to GNU libtool have been merged upstream
- Mach-O-aware shared library (.dylib) PLIST handling in bsd.pkg.mk
- buildlink2's design was influenced by pkgsrc portability problems with OS X
- Wrapper scripts translate most common compiler and linker arguments as needed
- CONFIG_{GUESS,SUB}_OVERRIDE replaces outdated copies of platform-specific files in packages
- devel/dlcompat: provides compatibility dlopen(3)-style functions
- workarounds for individual packages to build and/or run
Where can we improve?
- Mac OS X 10.4 (Tiger) can optionally install onto case-sensitive HFS+. Works great with pkgsrc.
- Full clones of user(8) and group(8)
- A cross-platform way to integrate pkgsrc rc.d scripts into ${OPSYS}'s boot sequence
- Make it easier to track pkgtools/rc.subr from src
- Treat bootstrap packages as normal packages, and other bootstrap improvements
- Better support alternate compilers, such as IBM's xlC
- Steal package-specific OS X fixes from Fink and Darwinports
- Provide Mac OS X disk images of pkgsrc-current and pkgsrc-stable
- Provide binary packages in native OS X format
- Provide a Mac OS X native GUI pkgsrc browser
- Regular bulk builds
Discussion
- Issues on other platforms? Solaris, IRIX, AIX are some tough ones.
FIN