1648 Commits

Author SHA1 Message Date
Misty De Meo
2f2645e962 info: Add JSON output
Output JSON with the --json=v1 option. Output is in an array, and
supports one or more formulae (or all, with the --all option).

Why 'v1'? The format is unstable, presumably we'll deprecate it
someday. It should be solid by Homebrew 1.0.

Closes Homebrew/homebrew#13299.
2012-09-17 20:01:37 -05:00
Adam Vandenberg
88ad4c061d Support env :std, :userpaths
Closes Homebrew/homebrew#14654.
2012-09-14 09:14:48 -07:00
Adam Vandenberg
22685cb89d Install plists by default 2012-09-09 13:02:48 -07:00
Adam Vandenberg
f4d967e96e allow skip_clean :la 2012-09-09 13:01:56 -07:00
Max Howell
04173d55c2 Hide --disable-debug from non verbose output also 2012-08-31 10:22:09 -04:00
Max Howell
d4503b1202 Fixes Homebrew/homebrew#14542; ocaml superenv issues
This patch removes most of the settings for CC, CXX etc. because we are trying to be minimal. Then we force the compiler to Homebrew's choice underneath in superenv. We however leave LD because we prefer that build-systems use the c-compiler for linking, it generally works better (copiously tested), however when the build-system explicitly calls ld, we respect that. This gets around the ocaml bug in question, since somehow clang was crashing during link, but the ld tool itself (which is kind of clang, kind of llvm-gcc) is okay with this.

Also moved the setting of O (so that cc-args are refurbished) into a make wrapper. Not sure if this matter much, but seems more consistent.
2012-08-30 20:02:29 -04:00
Max Howell
5790f4b523 Display skip-clean warning only before clean
Not anytime the formula loads.
2012-08-29 15:43:28 -04:00
Max Howell
4feb8e1cb4 Deprecate skip_clean :all
This was mostly used to prevent stripping. Now we don't strip. Force formula to remove this setting or be more specific about folders they don't want pruned.
2012-08-29 14:45:04 -04:00
Max Howell
65d195dcaa superenv: build-environments that just work
1. A minimal build environment, we don't set CFLAGS, CPPFLAGS, LDFLAGS, etc. the rationale being, the less that is set, the less variables we are introducing that can break builds.
2. A set of scripts that replace cc, ld, etc. and inject the -I, -L, etc. flags we need into the args passed to the build-tools.

Because we now have complete control over compiler instantiations we do a variety of clean-up tasks, like removing bad flags, enforcing universal builds and ensuring makefiles don't try to change the order of library and include paths from ones that work to ones that don't.

The previous ENV-system is still available when --env=std is specified.

superenv applies to Xcode >= 4.3 only currently.
2012-08-29 12:41:34 -04:00
Max Howell
f02d81ecbf Create active symlinks for installed formula
Similar to the LinkedKegs record, we write a symlink for installed kegs to PREFIX/opt.

Unlike the linked-keg record, unlinking doesn't remove the link, only uninstalling, and keg-only formula have a record too.

The reason for this addition is so that formula that depend on keg-only formula can build against the opt directory and not the cellar keg. Thus surviving upgrades.

To enforce this fix_install_names and built were adapted to use the opt path.

Standard kegs also create an opt symlink so that caveats can now refer to the opt directory and thus provide steps that survive upgrades too.

Thus the choice of /opt. It is short, neat and the right choice: POSIX dictates that opt is for stand-alone prefixes of software.
2012-08-29 12:41:33 -04:00
Adam Vandenberg
dfd35db4d1 Formula factory: add comment 2012-08-26 17:08:09 -07:00
Adam Vandenberg
f1d0f7adbb Formula factory: re-raise certain NameErrors.
Some name errors, such as NoMethodError, represent programming errors.
Re-raise them to get a usable error message.

Closes Homebrew/homebrew#14467.
2012-08-26 17:06:38 -07:00
Jack Nagel
fd151f8999 factory: always check const_defined? before requiring
Specifying dependencies with a URL works, even if by accident, but
factory is called repeatedly on this URL and this results in multiple
downloads of the same file.

Fix this by checking const_defined? here too, and DRY up the code a bit.

Fixes Homebrew/homebrew#14285.

Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2012-08-23 18:13:54 -05:00
Jack Nagel
5e0cbdab9b factory: rescue NameError
Due to the new const_defined? checks, passing certain names (such as
those that start with a digit) that are illegal constant names will
raise NameError. Catch this and error out gracefully, as we would have
previously.

Fixes Homebrew/homebrew#14342.

Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2012-08-21 15:55:20 -05:00
Max Howell
ee11f32fb7 conflicts_with message: recommend unlink
Yes uninstall works, but lets not push people towards that, they can presumably guess that, in the rare case they'd prefer that option.
2012-08-21 12:09:06 -04:00
Max Howell
9274f7cda1 Formula.Enumerable
Deprecated Formula.all, replaced usage with more appropriate enumerable options. Just check out how much nicer `brew audit` runs now.
2012-08-21 12:09:05 -04:00
Jack Nagel
35e32f352d factory: don't reload previously defined formulae
build.rb calls Formula.factory to get a usable Formula object to pass to
its install method. However, because the formula file is the actual
executing script, its class is already defined, and loading it again
causes the class to be re-evaluated, which, unfortunately, is not
idempotent.

This bug has existed for a very long time, and its side effects include
duplicate entries the deps array and mirrors array, among others.
Fortunately, the fix is very simple.

Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2012-08-19 12:04:44 -05:00
Jack Nagel
c6b3cd7cf4 Don't lie about upgrading up-to-date formulae
Usually, the "foo-version already installed" error is printed by
FormulaInstaller. However, if an up-to-date formula that has outdated
deps is passed on the command line, we proceed to upgrade the deps and
then print a message saying that the formulae given on the command line
is already installed.

Catch this earlier, when the outdated list is being populated, print an
appropriate message, and skip the up-to-date formula.

Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2012-08-18 19:33:39 -05:00
Jack Nagel
329f0a8490 Replace version strings with Version objects 2012-08-18 11:12:08 -05:00
Jack Nagel
53cf970312 build: expand requirements recursively when modifying ENV
Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2012-08-14 22:35:28 -05:00
Max Howell
b0e50ba13d Formula.select and Formula.installed 2012-08-13 10:14:59 -04:00
Jack Nagel
a054dc5019 Add :when_xquartz_installed as a keg-only reason
Using :when_xquartz_installed will tell the keg-only machinery to activate
if XQuartz is installed.

Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2012-08-12 17:28:15 -05:00
Misty De Meo
d1c0d4c879 Fix normalization of old- and new-style options
When combining the set of old-style and new-style options, make sure
that the leading "--" is stripped.

Fixes displaying options in `brew options`, and the exotic case of
declaring options using the old syntax and then checking them with
`build.include?`
2012-08-11 16:54:03 -05:00
Jack Nagel
f5eaef0aee Deprecate ancient formula syntax
Closes Homebrew/homebrew#13444.

Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2012-08-09 23:56:54 -05:00
Adam Vandenberg
d1d52b3467 Add option to the DSL
Closes Homebrew/homebrew#9982
2012-08-08 22:01:27 -07:00
Jack Nagel
4f809d0311 Simplify printing conflicts in brew info
Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2012-08-07 14:24:54 -05:00
Jack Nagel
82d3890495 Fix typo in conflicts_with DSL method
Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2012-08-07 14:24:34 -05:00
Adam Vandenberg
8c8701f268 Allow multiple unsatisfied fatal requirements
Closes Homebrew/homebrew#13335.
2012-08-07 10:49:45 -07:00
Misty De Meo
0c237a8679 Add conflicts_with DSL method
conflicts_with is a thin wrapper around Requirement which simplifies
marking conflicts between formulae.

Closes Homebrew/homebrew#13687.

Signed-off-by: Misty De Meo <mistydemeo@gmail.com>
2012-07-30 13:47:12 -03:00
Jack Nagel
c71002a4a3 Formula: mirrors are always non-nil
Since 3ee9b7bd88a2d9017cdf005b10567a1d6d8ec211 ("SoftwareSpec:
initialize @mirrors"), @active_spec.mirrors will always be non-nil.

Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2012-07-17 03:23:59 -05:00
Jack Nagel
56fe164e95 Teach download strategies to take a SoftwareSpec
Now that a URL, version, and the (for lack of a better term) "specs"
associated with said URL (e.g. the VCS revision, or a download strategy
hint) are neatly bundled up in a SoftwareSpec object, it doesn't make
sense to pass them individually to download strategy constructors. These
constructors now take only the formula name and a SoftwareSpec as
parameters.

This allows us to move mirror handling out out of Formula#fetch and into
the download strategies themselves. While doing so, we adjust the mirror
implementation a bit; mirrors now assume the same "specs" as their
owner's URL. They are still only useable by the CurlDownloadStrategy,
but this provides a basis for extending mirror support to other
strategies.

Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2012-07-04 22:47:35 -05:00
Jack Nagel
76b2eee777 Refactor checksumming
Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2012-07-04 22:47:33 -05:00
Jack Nagel
98a11b8e57 Introduce new formula specs 2012-07-04 22:47:32 -05:00
Charlie Sharpsteen
d1a4806390 std_cmake_args: Search for Frameworks last
Most Homebrew builds produce libraries, so CMake should give priority to
libraries when resolving dependencies.

Closes Homebrew/homebrew#12497.

Signed-off-by: Charlie Sharpsteen <source@sharpsteen.net>
2012-06-03 10:03:56 -07:00
Jack Nagel
a13857b150 Introduce std_cmake_args method
This differs from the current std_cmake_parameters in that it returns an
array instead of a string. Doing so makes dealing with it in formulae
much more pleasant, and for new formula hackers, less surprising.

std_cmake_parameters is retained in compat to maintain compatibility
with external formulae.

Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2012-05-22 16:32:12 -05:00
Max Howell
4a48a5f7a3 Don't fall into the no-extension OK trap
`require` is OK without an .rb extension, but the rest of our code will be confused and generate weird errors.

Fixes Homebrew/homebrew#11558.
2012-05-15 02:27:11 -04:00
Adam Vandenberg
e8c0b01f24 patches - support detection of compression types 2012-05-02 19:57:33 -07:00
Mike McQuaid
995186a72c Fix Ruby warnings.
Fixes Homebrew/homebrew#11966.
2012-05-01 20:45:17 +08:00
Mike McQuaid
0eb97d5c32 Generate the bottle download URL correctly.
Fixes Homebrew/homebrew#11561.
Fixes Homebrew/homebrew#11614.
2012-04-24 18:53:45 +10:00
Mike McQuaid
47b2eedddc Revert "Generate the bottle download URL correctly."
This reverts commit 092004e7820791030f568af0e3b03389ea4f7ee3.
2012-04-24 18:10:06 +10:00
Mike McQuaid
2c46c4e0c2 Generate the bottle download URL correctly.
Fixes Homebrew/homebrew#11561.
Fixes Homebrew/homebrew#11614.
2012-04-24 18:08:14 +10:00
Jack Nagel
9614301be4 Fix protection against overriding Formula#brew
The test for this previously passed, but only because the constructor
for SoftwareSpecification was raising an exception. method_added needs
to be a class method because methods are being defined on the class, not
the object, and to test it properly we have to eval the class in the
test itself.

Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2012-04-06 17:32:43 -05:00
Mike McQuaid
62a98753ec Populate empty mirror_list for bottles.
Fixes Homebrew/homebrew#11434.
2012-04-04 20:50:22 +10:00
Mike McQuaid
a947064994 Version bottles. 2012-04-03 11:43:41 +10:00
Jack Nagel
de444ead0b New fails_with infrastructure
- Formulae can now declare failures on any compiler.
 - FailsWithLLVM and associated formula elements have been moved to
   compat.

Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2012-04-01 12:39:59 -05:00
Mike McQuaid
49b16f3462 Fix broken default bottle URL. 2012-03-23 05:58:14 +13:00
Adam Vandenberg
7c50020822 Use Patches 2012-03-19 18:50:17 -07:00
Mike McQuaid
85452c5e91 Fix bottles on non-Lion. 2012-03-18 20:48:11 +13:00
Mike McQuaid
64457b2315 Remove reliance of bottle DSL on EOCLASS. 2012-03-18 20:38:18 +13:00
Misty De Meo
aa91bd27d2 Implement new bottle syntax in formula.rb
Signed-off-by: Mike McQuaid <mike@mikemcquaid.com>
2012-03-18 20:38:18 +13:00