898 Commits

Author SHA1 Message Date
Charlie Sharpsteen
d05478e85b formula.rb: Move cache dir creation to fetch
So that the cache directory will get created if the user runs `brew fetch`
instead of `brew install` as the first command.
2011-09-19 19:05:44 -07:00
Max Howell
6bd47cf0f9 Only try mirrors for CurlDownloadStrategies
Also adjust output text slightly for prettiness.

A possibly useful side effect here is safe_system has a defined Exception (subclassing RuntimeError) now.
2011-09-19 23:30:10 +01:00
Jack Nagel
1dc0775a15 Revert "Pretty-print the "Trying a mirror" message"
This reverts commit af8e3b5aeacdb10a412560e131d631ba733a8346.

Sorry for the noise.

Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2011-09-19 12:19:50 -05:00
Jack Nagel
9b3c22c7bd Pretty-print the "Trying a mirror" message
Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2011-09-19 12:15:56 -05:00
Charlie Sharpsteen
9d19506ee9 mirror support: Add mirror method to Formula.rb
Mirrors can now be declared using the `mirror` method which works similar to
`depends_on` and takes the same arguments as `url`.

The formula class now has a public `fetch` method that cycles through the
mirror list if the downloader for the primary URL throws a `DownloadError`.
Other brew commands, like brew-fetch, also benefit from mirror support by using
this method.

Closes Homebrew/homebrew#7574.
2011-09-19 09:24:43 -07:00
Charlie Sharpsteen
94dba21f7d Centralize definition of rack in formula.rb
`rack` is a commonly used alias for `formula.prefix.parent`---so common that it
gets defined and used quite a bit. This patch makes `rack` an official method
of the `Formula` class.
2011-09-16 08:55:38 -07:00
Max Howell
bf3433bde7 With xcodebuild don't set CC, CXX, etc.
The compiler setting in the xcodeproj is overridden by the CC setting in the environment. This is a bit insane IMO since the xcodeproj itself has detailed decisions about what tools to use.

Fixes Homebrew/homebrew#6406.
2011-09-10 11:30:00 +01:00
Max Howell
d37918b20f If LLVM isn't installed then fails_with_llvm? is true
This makes sense, I assure you. Fixes Homebrew/homebrew#7458.
2011-09-06 17:51:23 +01:00
Max Howell
06795b8953 Allow :force for ENV.gcc
This is used with fails_with_llvm so that if GCC cannot be found (and we suspect this is the case with Xcode 4.2) the build will fail.

Quite possibly it should be the default.
2011-09-06 11:22:22 +01:00
Max Howell
d71e1d0786 Use GCC if we tested against the latest LLVM
Latest is hardcoded, so we'll have to update as new Xcode's come along.
2011-09-01 14:33:54 +01:00
Max Howell
a27eda9df2 Allow fails_with_llvm {}
And fix node and ruby to use LLVM without complaint with Xcode 4.1 and Lion.
2011-09-01 10:29:31 +01:00
Max Howell
00cd7a3a9b cp CMakeCaches.txt not CMakeLists.txt
CMakeLists.txt is the build instructions not the build logs. The cache is not much better, but there is no equivalent of config.log, so…
2011-09-01 10:28:45 +01:00
Max Howell
abc8c2f9d7 Restore previous fails_with_llvm? behaviour
I've not been very careful lately, I apologise.

Fixes Homebrew/homebrew#7338.
2011-09-01 09:39:54 +01:00
Rory O'Connell
9520b6cc3c Fix type checking in fails_with_llvm
Signed-off-by: Adam Vandenberg <flangy@gmail.com>
2011-08-31 14:46:44 -07:00
Max Howell
3b689db6d3 Missing end. Doing too many things at once. Sorry. 2011-08-31 17:37:38 +01:00
Max Howell
b309396b02 cp over CMakeLists.txt if cmake builds fail
The self help text does not mention the log, but we can add this later, and for now at least the file is salvaged.

Closes Homebrew/homebrew#5940.
2011-08-31 17:36:41 +01:00
Max Howell
cf1a6e185c Don't fail to build with llvm if llvm build is newer 2011-08-31 17:36:41 +01:00
Max Howell
b5c709e2ed Save config.log to ~/Library/Logs/Homebrew
Also tidied error output. Still could be tidied quite a lot but I am still considering how best to go about it.
2011-08-31 15:35:59 +01:00
Charlie Sharpsteen
2e0a2cb175 formula.rb: Don't curl when DATA is the only patch
Executing `curl(*patches)` was failing on Leopard when `patches` was an empty
list. `git-bisect` identified 48552bb42a69ece4eb2a6d9acf81a0b47adb19c9 as the
commit that caused this bug to surface by adding `--insecure` to the arg list
on Leopard. This is odd because the following both exit with status 2:

    curl
    curl --insecure

The only apparent difference is that `curl --insecure` prints "no URL
specified!" to stderr along with the usage message.

Also renamed `patches` to `external_patches` as it is more descriptive.
2011-08-29 15:01:38 -07:00
Max Howell
f52955ec98 Correct typo 2011-08-26 16:55:12 +01:00
Max Howell
fd96bb6e3a Apologies, forgot to amend the commit 2011-08-26 14:48:47 +01:00
Max Howell
0822907d6d Some more sanity with ENV.compiler
Deprecated use_clang? etc. since the logic was such that multiple states could be set, when in reality only one compiler can be set.

Changed fails_with_llvm handling so if HOMEBREW_USE_LLVM is set then it tries to build even if the formula has fails_with_llvm set. Rationale: mostly they will no longer fail and we need to catch these cases.
2011-08-26 14:21:37 +01:00
Charlie Sharpsteen
f7bd98875b Leopard: Fix undefined method count for Array
Leopard runs Ruby 1.8.6 while Snow Leopard runs 1.8.7 and `Array.count` was not
introduced until 1.8.7.

Using `Array.length` instead.
2011-08-24 17:45:19 -07:00
Max Howell
6ac0a28523 Implement bottles again
Bottles now pour purely, without doing all the other unnecessary stuff that happened before the `brew upgrade` code shuffle.

Formula.pourable? removed since it was install-specific metadata and not related to the formula itself. Now all such logic is in the FormulaInstaller which is much cleaner.

I also changed the bottle cache location to the normal directory and added a .bottle pre-extension. Thus you can see everything in one directory without messing about.
2011-08-24 22:30:43 +01:00
Max Howell
4dc8318dc3 Observe all applicable options in handle_llvm_failure 2011-08-24 22:30:43 +01:00
Max Howell
39453f5a9d Auto-substitute certain variables in DATA patches
HOMEBREW_PREFIX for example.
2011-08-24 22:30:43 +01:00
Adam Vandenberg
0818189b5d Fix stripping of keg-only reasons 2011-07-30 10:11:35 -07:00
Max Howell
7e2411eb4d Remove "boring" args from the pretty_args only
Dumb mistake. Sorry.

Closes Homebrew/homebrew#6722
2011-07-30 11:20:23 +01:00
Max Howell
3cda43a681 Don’t display boring configure arguments 2011-07-29 11:58:41 +01:00
Adam Vandenberg
02b09e311f formula.rb: put bottle attrs on separate line
This line is getting long, and having these on a separate line
will help with some rebasing in some work-in-progress branches.
2011-06-22 14:13:44 -07:00
Mike McQuaid
f2e018d747 Return an array from options. 2011-06-22 17:48:20 +01:00
Mike McQuaid
6d3c488d4a Renaming pouring method to pourable?. 2011-06-22 17:48:20 +01:00
Mike McQuaid
bd2fa562c3 Add stub options method. 2011-06-21 22:28:54 +01:00
Mike McQuaid
5d7e796617 Only pour bottles when not building from source. 2011-06-21 19:25:39 +01:00
José Martínez
d1aac6bc03 Allow --use-clang to override fails_with_llvm
Signed-off-by: Adam Vandenberg <flangy@gmail.com>
2011-06-16 20:45:56 -07:00
Adam Vandenberg
8f896f9d2c Style changes related to bottling. 2011-06-16 08:41:16 -07:00
Mike McQuaid
31dea3b800 Add changes to Homebrew internals for bottling. 2011-06-08 22:19:10 +01:00
Adam Vandenberg
760bbb4e36 Remove debugging puts 2011-06-08 11:34:01 -07:00
Adam Vandenberg
5d5a8ed32f Better support for brew install <url>
Brews installed via URL are now checked from the cache when
other commands are run. This allows for instance:

    brew install <vim-url>
    brew info vim
2011-06-08 11:13:50 -07:00
Jack Nagel
4e65175564 Fix misspelled method name: Formula.canonical_name
Signed-off-by: Adam Vandenberg <flangy@gmail.com>
2011-05-07 21:50:37 -07:00
Adam Vandenberg
145bafbc4e Move 'fails_with_llvm' into formula DSL.
Existing method moved to compatibility layer.
2011-03-25 23:31:28 -07:00
eregon
b6506fb4ea use Module#const_get instead of eval
* may be a problem if the constant is scoped (like A::B), but this is not the case
  (const.split('::').inject(Object) { |c, part| c.const_get part } would solve that)
* this was noticed in a comment of 9afc85ad but it has disappeared

Signed-off-by: Adam Vandenberg <flangy@gmail.com>
2011-03-20 19:12:29 -07:00
Yasuharu NAKANO
aefb144048 Fix for installing from_url
Signed-off-by: Adam Vandenberg <flangy@gmail.com>
2011-03-20 09:06:51 -07:00
Camillo Lugaresi
22afb1cc43 make fails_with_llvm work when cc is llvm-gcc
Closes Homebrew/homebrew#4693.

Signed-off-by: Mike McQuaid <mike@mikemcquaid.com>
2011-03-17 17:49:14 +00:00
Adam Vandenberg
de5ac72534 Fix keg-only, non-system dupes 2011-03-15 22:46:20 -07:00
Adam Vandenberg
63846c7a92 keg-only: provide more info about system dupes
System duplicates can now provide more information about why
they are included in Homebrew.
2011-03-15 22:03:23 -07:00
Adam Vandenberg
498ef3372c Fix inheritance in formula.rb 2011-03-12 17:48:48 -08:00
Adam Vandenberg
2e340625f8 Allow 'brew install' on relative paths 2011-03-12 16:37:56 -08:00
Adam Vandenberg
4f22b70b47 Complain if a formula in core won't import. 2011-03-12 11:55:11 -08:00
Adam Vandenberg
2a5f757816 Use + instead of /. 2011-03-12 11:55:07 -08:00