Binary pkgsrc packages for Mac OS X Maverics (Darwin 13.0.0)

Pkgsrc is a great packaging framework, originally developed for NetBSD.

It's too much hassle to build binary packages from sources everywhere you install pkgsrc. There is pkgin that solves the problem. But unfortunately pkgsrc team doesn't build binaries for Mac, so there is no official repository. Some people, like  Jonathan Perkin, build the packages and publish them.

The Jonathan's binaries are built for old Mac OS (which is good) but they are built for i386. Sometimes you need a library that you want to use for development, in that case you need a 64-bit ABI support.

Recently I built a few packages for current pkgsrc with 64-bit ABI and decided to publish them too. Here it is.

To install pkgin utility (that is very much like apt-get on debian based linux distros) all you need to do is run:

curl http://umc8.ru/~a/packages/Darwin-13.0.0/current/pkg.tar.gz | gzip -dc | sudo tar -C /usr -xf -

What this does is it fetches pkg.tar.gz tarball and unpacks it's content to /usr. That is one directory pkg-current and a symlink pkg that points to pkg-current.

After you extracted the tarball, you need to add /usr/pkg/sbin and /usr/pkg/bin to your path. That can be done by putting this paths to /etc/paths.d/90-pkgsrc-current or by adding PATH=$PATH:/usr/pkg/sbin:/usr/pkg/bin to .profile in your home directory.

I build everything on Maverics (OS X 10.9), so you need to upgrade if you're still using an older version (Maverics is free by the way).

Try it and tell me if anything is wrong. For now there is not much in the repo. There will be more as they're built.

Almost forgot! Here are some pkgin basics:

pkgin update # (re)fetch packages index

pkgin search zsh # look for something zsh-alike in repository

pkgin install mercurial # install mercurial control version system

How to remove everthing that pkgin installed? I configured pkgsrc so that it installs everything under /usr/pkg-current even packages' meta info and pkgin db. So 

sudo rm -rf /usr/pkg-current /usr/pkg

is enough to kill the whole thing.