33496 Commits

Author SHA1 Message Date
Max Howell
444e2e05fc Remove some ohai() use
Ohai is for titles, to separate sections of output so it is more readable, it
truncates long lines for this purpose. So don't use it if the line you are
outputting is likely to be long and important. Instead prefix that line with
a summary header.
2009-09-21 22:02:35 +01:00
Max Howell
01b85d8521 Automatically add keg_only? deps to relevent ENV
Eg gettext gets added into LDFLAGS, INCLUDE and that. I hope I got everything
that is typical. Prolly not. But we'll find out.

Made readline keg_only because the BSD version is provided by OS X, and I
don't want bug reports that are tricky to solve due to unexpected differences
between the two.
2009-09-21 20:23:09 +01:00
Max Howell
e9701dbc81 Merge branch 'deps'
Conflicts:
	Library/Formula/imagemagick.rb
	Library/Formula/taglib.rb
	Library/Homebrew/brew.h.rb
	Library/Homebrew/formula.rb
	bin/brew
2009-09-21 18:46:28 +01:00
Max Howell
77dd27e8e6 Dependency resolution with fancy syntax
Is it a DSL? No. But people call it that apparently.

To add a dependency:

class Doe <Formula
  depends_on 'ray'
  depends_on 'mee' => :optional
  depends_on 'far' => :recommended
  depends_on Sew.new
end

Sew would be a formula you have defined in this Formula file. This is useful,
eg. see Python's formula. Formula specified in this fashion cannot be linked
into the HOMEBREW_PREFIX, they are considered private libraries. This allows
you to create custom installations that are very specific to your formula.

More features to come, like specifying versions
2009-09-21 18:27:48 +01:00
Max Howell
3d421c8649 Update references to masterbrew
I left update_from_masterbrew! as a historical reference.
2009-09-18 14:32:21 +01:00
Max Howell
a8d6a695bc mkpath for all directories under lib/perl5
Don't symlink, as multiple formula will install to this directory.
2009-09-17 22:01:27 +01:00
Max Howell
ee2b521ca8 Solving the GNU GetText issues
GNU GetText breaks eg. Ruby 1.9 builds, and some other formula I have been building too. But it is required by eg. glib. So to solve this we are going to by default not symlink gettext into the Homebrew prefix.

Formula that depend on GetText will have the gettext paths added to the brewing environment automatically. Neat.
2009-09-17 22:01:27 +01:00
dbr
84c5f4e0b3 Added .md extension to README so Github renders markdown 2009-09-17 19:51:48 +01:00
dbr
51891b9ced "brew mk" -> "brew create" in readme 2009-09-17 19:51:48 +01:00
dbr
944517ddc0 The "brew gen" command doesn't seem to exist, changed to "brew create", which isn't otherwise mentioned 2009-09-17 19:51:48 +01:00
Max Howell
2149d9035a Delete the partial download with any exception
Don't delete it if it doesn't exist.
2009-09-17 18:42:56 +01:00
Max Howell
a7315fce20 Error out if HOMEBREW_PREFIX isn't writable 2009-09-17 18:42:56 +01:00
Max Howell
357751633e Prettier install output
This way caveats and other warnings/errors don't appear connected to the Summary text.
2009-09-17 18:42:56 +01:00
Max Howell
b3c6c3f591 Warning for bin dirs not in the PATH
Eg. sbin may be part of the formula, but that isn't in the default Mac PATH. Also will avoid bug reports for users who forget to amend their PATH and stick Homebrew somewhere different.
2009-09-17 18:42:56 +01:00
Max Howell
9d63bf9e14 Add license header to update.rb 2009-09-17 18:40:21 +01:00
Max Howell
710a160b8f Rename refresh_brew.rb to update.rb
I didn't change the class name, it's clear from the context where it is used what it does. However when just looking at files to figure out the nature of Homebrew I believe in clear naming.

Otherwise funny names earn you points.
2009-09-17 18:39:58 +01:00
Max Howell
cb28a0f477 Error out if a git command fails during update 2009-09-17 18:27:12 +01:00
Eloy Duran
7ebd012128 Made the Library tests green on 10.6.0 2009-09-17 00:24:59 +02:00
Eloy Duran
91736e24cb Changed verbose output of git commands during update to use the existing style. 2009-09-17 00:24:12 +02:00
Eloy Duran
d296038ead Don't break if RubyCocoa can't be loaded, but try to help the user. 2009-09-17 00:24:11 +02:00
Eloy Duran
3b8f3ad409 Made the output of updating a bit nicer and log more if --verbose. 2009-09-17 00:24:11 +02:00
Eloy Duran
bb03db8e6c Before trying to update, first checkout the masterbrew branch. 2009-09-17 00:24:11 +02:00
Eloy Duran
4691fcb3d7 Don't print that there are _and_ aren't formulae updates. 2009-09-17 00:24:11 +02:00
Eloy Duran
9ff551a524 Removed the old 'update' when clause and fixed a small spelling error. 2009-09-17 00:24:11 +02:00
Eloy Duran
c9f056c327 Make sure git commands in RefreshBrew are executed with the proper working dir. 2009-09-17 00:24:11 +02:00
Eloy Duran
52efea0e7d Added `update' to banner. 2009-09-17 00:24:11 +02:00
Eloy Duran
c1989b79ad Update Homebrew and list the updated formulae. 2009-09-17 00:24:11 +02:00
Max Howell
c71d4ad2bc Default to patch level 1
Having gone through our patches it's clear that p1 is more standard.

Also fixed a bug where returning DATA outside of an array would fail to patch.
2009-09-16 17:08:32 +01:00
Hunter Morris
aafbdcc115 Added 'man' to be ignored
Signed-off-by: Max Howell <max@methylblue.com>

Homebrew doesn't install to man, but if it's already there, we should indeed ignore it.
2009-09-16 15:05:22 +01:00
Darcy Laycock
8ecb7b0612 Add fish completions for the brew binary
See Library/Contributions
2009-09-16 14:49:06 +01:00
Max Howell
c28bd7b571 Allow formulae to use __END__
For this to work the "running script" must be the formulae file. Making this
so wasn't so hard, there is now an install.rb script which is included with
the -r flag to the ruby executable. An at_exit handler calls the install
function.

Having the install logic in its own file made it feel like there was so much
space that I added extra error handling. So there is something to be said for
separating functionality out into its own files.

Still the error handling sucks, we'll need to marshall the exception back to
the bin/brew command. Which is another PITA.

Still overall I think this will prove worthwhile. But if it doesn't we'll
revert.

As a first usage, you can put a diff after __END__ and return DATA from
Formula::patches to make Homebrew aware of it.
2009-09-16 14:49:06 +01:00
Max Howell
fd5ed391be Support patching using diffs on local filesystem 2009-09-16 14:49:05 +01:00
Brian Smyth
0a2cdea5fd Teach patch to uncompress patches if necessary.
This change also eliminates the somewhat duplicate codepath if patches
returns and Array rather than a Hash.
2009-09-16 14:49:05 +01:00
Joshua Peek
acd913593a Clear CDPATH to avoid make issues that depend on changing directories 2009-09-14 20:33:47 +01:00
David Höppner
f150e5ece2 Fix unittest test_arch_for_command for 10.5 2009-09-14 20:33:46 +01:00
Clinton R. Nixon
6ee6bee01f Clean up indentation
Signed-off-by: Max Howell <max@methylblue.com>

I didn't commit it all, apologies. But I just can't read the sections nearly as easily if you indent private and protected. If it's a Ruby convention it frankly seems at odds with the rest of Ruby spacing conventions.
2009-09-14 20:33:46 +01:00
Max Howell
3f11c4ab1f Escape $ inreplace 'after' parameter 2009-09-14 20:33:46 +01:00
Clinton R. Nixon
0df406ae4f Ant formula
Ant is a Java-based build tool. In theory, it is kind of like Make, without
Make's wrinkles and with the full portability of pure Java code.
2009-09-14 20:33:46 +01:00
Sean Wolfe
80a54dc5b2 Couchdb and dependency formulae
Signed-off-by: Max Howell <max@methylblue.com>

I squashed a number of commits here, and also replaced the use of nspr.prefix with HOMEBREW_PREFIX as in theory we are flexible with our requirement for dependencies, although with the limited build system that SpiderMonkey possesses this is difficult for us to achieve anyway…
2009-09-14 20:33:46 +01:00
Max Howell
46ac04e410 Formula::var
Points to eg. Cellar/wget/var rather than Cellar/wget/1.1.5/var

Discussion: 1689bbc326f1201ea979178ebcadba344abf2568
2009-09-14 20:33:46 +01:00
Max Howell
df521478d2 Why you wouldn't use Homebrew 2009-09-14 20:33:46 +01:00
Max Howell
c279ef8c45 Add IRC channel to README
Link to @ddemaree's installer .pkg.
2009-09-11 17:42:53 +01:00
Max Howell
f0f59659dd Overriding Object.class was not my intention
Renamed to Formula::class_s.
2009-09-11 17:42:53 +01:00
Max Howell
d62fd87436 Fix lame version, eg. 398-2
Included test this time!
2009-09-11 17:42:53 +01:00
Max Howell
a793e30405 Only allow --interactive with one formula argument
See comments in commit for details.
2009-09-10 19:23:03 +01:00
Max Howell
fdaa267fb9 Don't install dependencies that are already installed 2009-09-10 19:23:03 +01:00
Max Howell
0a31190fdc Dependency resolution
Specify dependencies in your formula's deps function. You can return an Array,
String or Hash, eg:

    def deps
      { :optional => 'libogg', :required => %w[flac sdl], :recommended => 'cmake' }
    end

Note currently the Hash is flattened and qualifications are ignored. If you
only return an Array or String, the qualification is assumed to be :required.

Other packaging systems have problems when it comes to packages requiring a
specific version of a package, or some patches that may not work well with
other software. With Homebrew we have some options:

1.  If the formula is vanilla but an older version we can cherry-pick the old
    version and install it in the Cellar in parallel, but just not symlink it
    into /usr/local while forcing the formula that depends on it to link to
    that one and not any other versions of it.
2.  If the dependency requires patches then we shouldn't install this for use
    by any other tools, (I guess this needs to be decided on a per-situation
    basis). It can be installed into the parent formula's prefix, and not
    symlinked into /usr/local. In this case the dependency's Formula
    derivation should be saved in the parent formula's file (check git or
    flac for an example of this).

Both the above can be done currently with hacks, so I'll flesh out a proper
way sometime this week.
2009-09-10 19:23:03 +01:00
Joshua Peek
111a75d262 Add llvm switch to ENV 2009-09-10 18:17:15 +01:00
Adam Vandenberg
981dba1b35 Function to return a binary's Mach-O architectures
Added a utility method to get an array of architecture names for
a given executable.

This will be useful for, say, figuring out what Python was compiled for,
to know what to compile a C-based module as.

Signed Off By: Max Howell <max@methylblue.com>

I added a test and made the function use `which` if the path provided is not
absolute. I considered allowing relative paths, but then it is possible for
the function to take eg. the svn binary from the current directory when you
meant the one in the path, and that could be a confusing bug.
2009-09-10 18:17:15 +01:00
Adam Vandenberg
c3169b5600 Display exit code when nonzero.
Brew fails if a tool (make, or whatever) doesn't return an exit code
of 0. This patch displays the non-zero code on failure, so we can
better diagnose what caused the build to fail (or if we need to add
that exit code as exception 'success code'.)
2009-09-10 18:17:15 +01:00