1486 Commits

Author SHA1 Message Date
Jack Nagel
67c3f1b2b4 Extend FileUtils rather than include it
Fixes Homebrew/homebrew#10729.

Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2012-03-06 19:23:51 -06:00
Jack Nagel
ed5f7dfbaa Require specialties at the end of formula.rb
classes in formula_specialties.rb need Formula, so it has to be last.

Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2012-03-06 00:28:50 -06:00
Adam Vandenberg
962f4fa9ef Move llvm method to FailsWithLLVM 2012-03-05 21:14:48 -08:00
Adam Vandenberg
fca0a66649 shrink 2012-03-05 21:14:39 -08:00
Adam Vandenberg
ee5193e3e8 invert condition 2012-03-05 21:14:39 -08:00
Adam Vandenberg
6af1aae50b Move specialized formulae base classes into a new file 2012-03-05 21:14:39 -08:00
Adam Vandenberg
1b372d7840 Move path utils out of formula.rb
Make a new module for our FileUtils extensions and use that instead.
2012-03-05 21:14:39 -08:00
Adam Vandenberg
e6f8f16183 Formula.rb: update a comment 2012-02-29 21:45:47 -08:00
Adam Vandenberg
d22eed3f16 Add support for Luarocks dependencies. 2012-02-29 20:52:20 -08:00
Adam Vandenberg
93b4a131d0 Only call patches once 2012-02-25 17:24:45 -08:00
Adam Vandenberg
ed57279256 Add "require hardware" to formula.rb
Now individual formulae don't need to require this if they want to use
Hardware methods outside of `def install`.
2012-02-25 15:22:32 -08:00
Second Planet
8a4cb8c0ac Add more external dep options
* Chicken Scheme
* Node.js
* Rubinius

Closes Homebrew/homebrew#8466.

Signed-off-by: Adam Vandenberg <flangy@gmail.com>
2012-02-25 10:19:59 -08:00
Adam Vandenberg
01a6daa4d4 Add buildpath to Formula 2012-02-24 21:35:51 -08:00
Adam Vandenberg
554d5a2670 Introduce block form of mkdir 2012-02-24 21:35:51 -08:00
Jack Nagel
a9e6f07732 Formula#system: sanitize args before exec
This prevents passing nested arrays to exec; the same thing is done in
safe_system.

Fixes Homebrew/homebrew#10295.

Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2012-02-24 17:29:02 -06:00
Jack Nagel
f295661ca6 Remove unused :force switches
The :force behavior for ENV.gcc has been the default for some time, and
was used to force vanilla gcc in case the gcc symlink pointed at
llvm-gcc; for ENV.clang, this doesn't mattera as clang is just clang.

Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2012-02-21 00:22:27 -06:00
LeFnord
b0ece7613f cast name to string
Some times a Pathname is passed in here

Signed-off-by: Adam Vandenberg <flangy@gmail.com>
2012-02-17 18:59:36 -08:00
Jack Nagel
c1fecab365 Don't return nil from Formula#linked_keg
Doing so was the result of a quick hack to fix the "deps installed as
upgrades don't get linked" bug, but it was a mistake. Instead, always
return the LinkedKegs entry as a Pathname object, and let callers be
responsible for checking that it exists.

Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2012-02-10 23:52:01 -06:00
Mike McQuaid
27ecdb4266 Split bottle logic.
Fixes Homebrew/homebrew#8805.
2012-02-09 21:05:17 +00:00
Adam Vandenberg
fe6ab92857 Split some classes to formula_support
formula.rb is getting big, let's start splitting things out.
2012-02-04 18:45:08 -08:00
Adam Vandenberg
d312a54d46 Remove aka warning 2012-02-03 20:02:41 -08:00
Jack Nagel
3001391a5d Add and use plist helper methods
These will be used to unify the label namespaces in embedded plists,
i.e. 'homebrew.mxcl.<formula>'.

plist_path returns the full path to a plist file located at the top
level of the keg; plist_path.basename can be used if just the filename
is needed.

c.f. Homebrew/homebrew#9346.

Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2012-02-03 19:50:58 -06:00
Misty De Meo
b6fa08f2d2 devel: reset mirrors when building devel
Otherwise stable mirrors will be considered when the devel download
fails.

Fixes Homebrew/homebrew#9910.
2012-02-02 13:13:07 -06:00
Misty De Meo
d121bcdada Add devel to the DSL, + stable and bottle blocks
This commit adds a `devel` entry to the DSL, allowing formulae to
specify an unstable branch.

`devel` takes a block, which should contain standard `url` and `md5`
fields (and `version`, if necessary). This must come after the standard
DSL fields.

This commit also migrates over all formulae currently using `devel` to
the new syntax, as well as formulae which used `head` for non-VCS urls.

The new syntax is also available for `stable` and `bottle`. `stable` is
an option alongside the old syntax. `bottle` replaces the old syntax.

Note that the @stable ivar in Formula has been renamed to @standard,
and the @bottle ivar has been renamed to @bottle_url.

Closes Homebrew/homebrew#9735.

Signed-off-by: Misty De Meo <mistydemeo@gmail.com>
2012-01-25 21:45:19 -06:00
Mike McQuaid
555e7ff893 Don't try and use GCC on Xcode 4.2: it's gone Jim.
Closes Homebrew/homebrew#9622.

Signed-off-by: Mike McQuaid <mike@mikemcquaid.com>
2012-01-16 21:00:24 +00:00
Mike McQuaid
c28779d4e0 Bump highest seen LLVM version.
Signed-off-by: Mike McQuaid <mike@mikemcquaid.com>
2012-01-16 21:00:24 +00:00
Jack Nagel
411d15d407 Unlink old keg when upgrading dependencies
Installing a formula via `brew install` may trigger upgrades of its
dependencies if the dependencies are installed but outdated. However, we
never unlinked the existing keg in FormulaInstaller#install_dependency
which caused the link step to fail.

Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2012-01-15 17:18:17 -06:00
Charlie Sharpsteen
acc33a56e7 Allow Formula.canonical_name to use Pathname objects 2011-12-26 11:58:25 -08:00
Charlie Sharpsteen
33db0a9665 formula.rb: Don't apply fails_with_llvm to Clang
Clang is vastly different than LLVM-GCC and is under active development. Using
Clang is a viable solution to formula that fail with LLVM and a suggested
recourse for users of XCode 4.2 or newer.

Fixes Homebrew/homebrew#9242.
2011-12-24 12:48:10 -08:00
Adam Vandenberg
2dba766fda Expose stable/unstable specs 2011-12-18 16:24:56 -08:00
Adam Vandenberg
fd082f63b6 Extract checksum type function 2011-12-18 16:24:56 -08:00
Adam Vandenberg
f052bcbd62 Simplify a couple of comments 2011-12-18 16:24:55 -08:00
Charlie Sharpsteen
94f84544c6 formula.rb: Fix use of xcode_version in LLVM check
Should be `MacOS.xcode_version`.

Fixes Homebrew/homebrew#8966.
2011-12-04 10:12:40 -08:00
Charlie Sharpsteen
ec71780612 formula.rb: Change fails_with_llvm for XCode 4.2
Suggest trying `--use-clang` instead of `--use-gcc` (which does nothing).

Signed-off-by: Adam Vandenberg <flangy@gmail.com>
2011-12-03 12:33:02 -08:00
Charlie Sharpsteen
0d08a5af00 formula.rb: Initialize path to nil or a Pathname
For consistency, ensure that the `path` member of formula objects is always a
`Pathname`.
2011-11-27 16:44:42 -08:00
Charlie Sharpsteen
b5f942764a Re-work ARGV filtering to properly handle --HEAD
Previously, stripping arguments like `--HEAD` for dependencies failed because
that flag affects the installation prefix encoded into formula objects. The
previous implementation of `ARGV` filtering tried to contain all changes to a
single method call before the `FormulaInstaller` forks. This update spreads
things out a bit:

  - The Homebrew `ARGV` extension adds a new method, `filter_for_dependencies`
    which strips flags like `--HEAD`, yields to a block, then restores the
    original contents of ARGV.

  - The `explicitly_requested?` test, which returns true or false depending on
    if a formula object is a member of `ARGV.formulae`, is now a method of
    `Formula` objects.

  - `FormulaInstaller` objects now execute the installation of dependencies
    inside an `ARGV.filter_for_dependencies` block if the dependency was
    `explicitly_requested?`.

Fixes Homebrew/homebrew#8668.
Closes Homebrew/homebrew#7724.
2011-11-27 14:37:31 -08:00
Jack Nagel
0a49981a30 Add an attr_reader for 'head'
This allows `brew audit` to inspect the head URLs, for example; until
now, that check was failing silently.

Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2011-10-10 15:34:28 -05:00
Charlie Sharpsteen
e7aaeda953 formula.rb: Don't attempt to mirror unstable URLs
If a build is being influenced by an option such as `--HEAD`. Don't attempt
mirrors if a download fails.

Fixes Homebrew/homebrew#7971.
2011-10-04 18:36:31 -07:00
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