38364 Commits

Author SHA1 Message Date
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
Max Howell
9f07e5d9fd Handle $EDITOR with spaces
Fixes Homebrew/homebrew#40
2009-09-10 18:16:49 +01:00
Max Howell
c92e566976 We should certainly have a Formula::share()
I removed this months back as I found it confusing, does it mean:

prefix+'share' or prefix+'share'+name()

But honestly, it's obvious, it's the former. It's the same as the other path
functions.
2009-09-10 17:21:14 +01:00
Max Howell
edc0f7ba20 Include OS X version with fatal error details
So when people do what it says and list the info we know in advance their OS
version.
2009-09-10 17:21:14 +01:00
Pierre Riteau
5bf6cf06ff rm -rf .git in the README uninstallation guide
Signed-off-by: Max Howell <max@methylblue.com>

I also added the essential missing `brew prune` step.
2009-09-10 17:21:08 +01:00
Étienne Barrié
3809c0b419 Add support for SHA256 2009-09-07 16:10:50 +02:00
Étienne Barrié
b2e12c4517 Add test for SHA1 2009-09-07 15:26:43 +02:00
Max Howell
fc52e1a69d brew make' becomes brew create'
This is because I have observed two people confuse make with the "make" tool
and thus assume `brew make' is `brew install'.

`brew make' will be deprecated at 0.7, until then it shows a warning.
2009-09-07 01:34:40 +01:00
Max Howell
de620e4396 No spurious error due to Interrupt during curl
Only delete the file that is downloaded if an error occurs while downloading it.
2009-09-05 20:47:15 +01:00
Max Howell
680e201923 Fix double newline after Interrupt
Seems to be an issue with Ruby system() call doing a double fork.
2009-09-05 20:46:07 +01:00
Max Howell
64e767155a FIX installed but not installed state.
Pressing CTRL-C during installs would remove the prefix but not the keg directory. brew list would then report this keg as installed, even though it was empty.
2009-09-05 20:45:21 +01:00
scoates
7709c3699a Use ENV[EDITOR] if possible
Defaulting to EDITOR, then checking for the mate command, and then using
vim as a last resort.

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

Plain brew edit still uses Textmate though because a client that
supported a project concept is required for that particular feature.
Patches for that welcome.
2009-09-05 19:10:56 +01:00
Max Howell
c7976fcca2 Typo in usage
I patched the patch wrongly.
2009-09-05 16:22:06 +01:00
Andre Arko
c4041f4492 `brew search' command
Example usage:
  brew search w  # formulae containing w
  brew search ^w # formulae starting with w

No parameters lists all packages.

Also adds puts_columns to util, and uses it for output.

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

I changed the command from 'available' to search because this is more similar
to how other tools call this function.

The short form is -S, which is the "pacman" tool equivalent.
2009-09-05 15:09:17 +01:00
Max Howell
a2cd3367a8 ENV.no_optimization
For when we optimize too much and things seem to break. In my experience the
GCC optimizer is pretty safe nowadays, but at least this allows you to test
the hypothesis the optimization is breaking the build.
2009-09-05 14:38:38 +01:00
Max Howell
87605d534b Don't trim ohai message in verbose mode 2009-09-05 14:35:26 +01:00
Max Howell
e30c1c8850 Cache ARGV calcs
Means unshift doesn't work, but well, that's almost a feature :P
2009-09-05 14:35:26 +01:00
Eloy Duran
a4ba1c137f watch_out_for_spill
New method which uses RubyCocoa with the FSEvents API from Rucola to watch if
files aren't installed outside the Homebrew prefix. Right now the paths being
watched are: /System, /usr, /etc, /sbin, /bin, and /Applications.
2009-09-05 14:35:15 +01:00
Adam Vandenberg
ef88db9d38 Nehalem supports SSE4.2
Signed Off By: Max Howell <max@methylblue.com>

I realised that -msse4.1 and -msse4.2 aren't supported by GCC 4.0, so I made
the brash decision that we require GCC 4.2. It comes with Xcode 3.1 so people
can upgrade if they have to.

Requiring a single compiler is better for us anyway -- less possible errors
and failures.

Formulae can still request gcc-4.0.1, but at least then those formulae still
only use a single compiler and not possibly two.
2009-09-04 18:54:43 +01:00
Max Howell
ee0459a087 More tweaks to the README
Still too long, but it reads marginally better.
2009-09-04 18:46:16 +01:00
Bjørn Arild Mæland
8b1b3d2a97 Sort the output from brew install 2009-09-04 16:14:51 +01:00
Max Howell
d11165cd97 Fixes Homebrew/homebrew#30 -- GCC can't create executables
The fix is to error out if GCC isn't installed, and to ensure we aren't
setting CC and CXX to something that doesn't exist.
2009-09-04 15:54:27 +01:00
Tom von Schwerdtner
4d940628cc Plain Core Duo can't execute 64 bit code 2009-09-04 15:40:31 +01:00
Ben Alpert
c6d98678ac Fix SSE support on Core 2 processors
DRY it off a bit.
2009-09-04 15:30:45 +01:00
Max Howell
0543bbcccc Fixes Homebrew/homebrew#32 -- Create directory, don't symlink perl5/site_perl 2009-09-03 23:17:02 +01:00
Max Howell
a12569699e Fix some "GCC cannot create executables"
This regards Issue Homebrew/homebrew#30.

Turns out -march=native isn't supported by Apple's GCC, but while investigating it I found they'd back ported the -march=core2 option, so we win anyway.

Logic reverted to how it was yesterday.

I moved the gcc options stuff back to brewkit.rb as we manipulate the cflags more later and it seemed bad form to split the logic for this area over two files.

Additionally the brew command exits immediately on powerpc now. Brewkit doesn't throw as theoretically it is a useful library file for other projects.
2009-09-03 22:39:49 +01:00
Max Howell
18d9fbee98 Closes Homebrew/homebrew#27 (permissions to strict)
I went with 0555 as the permissions changing only occurs to bin, sbin and lib, so there shouldn't be any files in there for editing in general anyway.

Formulae can specify not to "clean" any particular file by reimplementing the skip_clean? function, in case some config file or what not ends up in there.

Also committing cosmetic fix to pretty_duration function.
2009-09-03 20:58:33 +01:00
Ask Solem
21df479f1b Thrift formula
Thrift is a software framework for scalable cross-language services
development. It combines a powerful software stack with a code generation
engine to build services that work efficiently and seamlessly between C++,
Java, Python, PHP, and Ruby. Thrift was developed at Facebook and released as
open source.
2009-09-03 16:34:35 +01:00
spicyj
ba8ba4c451 Improvements to build environment determination
Simplified hardware model testing.

Even smarter compiler option generation using sysctl and new GCC 4.2 features.

Get processor count from sysctl and thus remove our dependency on RubyCocoa.
2009-09-03 16:34:31 +01:00
nmeans
91d9a707b6 Fixes HOMEBREW_PRFIX when brew is outside $PATH
If brew is called with an explicit path, eg. './bin/brew',
HOMEBREW_PREFIX is set to an empty string resulting in failure of all
brew commands using HOMEBREW_PREFIX. This commit forces Pathname to
compile an absolute path, setting HOMEBREW_PREFIX correctly.
2009-09-03 00:26:02 +01:00
Max Howell
5eb51cb766 If the download fails, delete the half-file
Otherwise next time it will assume the half-file is the whole file and fail
the md5 check.
2009-09-02 23:24:14 +01:00
Max Howell
ce3b7c9826 Fix apr formula by aliasing deparallelize to j1 2009-09-02 23:20:15 +01:00
Max Howell
4c09e3ef2b brew info FIX if git isn't installed 2009-09-02 15:44:10 +01:00