Using pkgsrc
安裝已經 build 的套件,參考連結
http://www.perkin.org.uk/posts/7000-packages-for-osx-lion.html
: Download and install the bootstrap containing pkgin and the packaging tools
$ curl http://pkgsrc.smartos.org/packages/Darwin/bootstrap/bootstrap-2013Q2.tar.gz | sudo gnutar -zxpf - -C /
: Packages are kept under /usr/pkg, add to $PATH
$ PATH=/usr/pkg/sbin:/usr/pkg/bin:$PATH
$ sudo pkgin -y update
$ pkgin avail | wc -l
7374
$ pkgin search ...
$ sudo pkgin -y install ...
以原始檔的方式安裝
參考 http://amin.bitbucket.org/posts/pkgsrc-in-mac-os-x.html
Build a disk for pkgsrc
$ sudo hdiutil create -fs "Case-sensitive HFS+" -volname pkgsrc -type SPARSE \
-stretch 4g -size 3g /usr/pkgsrc
$ sudo hdiutil attach -readwrite /usr/pkgsrc.sparseimage
$ ls /Volumes/pkgsrc
$ cd /Volumes/pkgsrc
$ mkdir pkg pkgsrc
Checkout pkgsrc by git. Automatically updated conversion of the “pkgsrc” module from anoncvs.netbsd.org
$ cd /Volumes/pkgsrc
$ git clone https://github.com/jsonn/pkgsrc.git
Build it by Bootstrap
$ cd /Volumes/pkgsrc/pkgsrc/bootstrap
$ sudo ./bootstrap --prefix=/Volumes/pkgsrc/pkg --pkgdbdir=/Volumes/pkgsrc/pkg/db \
--abi=64 --compiler=clang
Packaging. Once the bootstrap is in place, use its bmake to build rest of packages.
$ cd /Volumes/pkgsrc/pkgsrc/databases/openldap-server
$ ../../bootstrap/work/bin/bmake install