hashdist/hashdist — pull request #168 by ahmadia (2013-12-21 07:18:06+00:00)
Title: proof of concept

Per https://github.com/hashdist/hashdist/issues/167 - this set of changes implements proof-of-concept integration of the Homebrew package manager into HashDist.

It is now possible to use Homebrew to satisfy HashDist dependencies.

There are about a million things needed to take this from proof-of-concept to reality, among them:

[ ] normalizing Pythonic hashstack2 names with a `python-` prefix (apparently the rest of the world thinks `sphinx` is something else :)
[ ] tests
[ ] documentation (especially warnings that this is unsupported by the Homebrew developers)
[ ] allowing for more isolation, so that the user can specify an independent Homebrew stack
[ ] better build hashing/verification
[ ] hashing/including the `INSTALL_RECEIPT.json` as part of the build
[ ] ensuring consistency of externally managed builds (assuming idempotence, re-running externally managed builds)
[ ] allowing users to select precedence of (HashStack packages, package managers)
[ ] dependency handling

Here's how to test this out for yourself.

Install this hashdist branch. Modify your `.hashdist/config.yaml` to include the following:

```
homebrew: /path/to/a/homebrew/install
```

I recommend making a new Homebrew install via `git clone https://github.com/Homebrew/homebrew.git` in this directory. I **don't** recommend using your system Homebrew.

Now just call `hit build` normally. Hashdist will resolve dependencies from Homebrew first, then fall back to your `pkgs` directory. Here's a simple test profile:

```
extends:
- file: osx.yaml

packages:
ack:
```

My current approach is to copy `bin/brew` and `Library` over from the "store" Homebrew, then symlinking into Cellar. This approach isn't quite what was recommended by the Homebrew developers, but it seems to not be breaking anything so far, and promises the ability to cache builds. With more effort, we could try and capture installed builds more carefully, archive them into `.bld`, and repopulate the Cellar as needed.

Please let me know if you get this working and find it useful.