aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Homebrew/formula.rb
AgeCommit message (Collapse)Author
2012-11-09Formula#system: don't try to close a closed streamJack Nagel
The new formula debugger users continuations to jump back up the stack, and thus anything that has the potential to be executed twice (i.e. ensure blocks) needs to to be essentially idempotent. Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2012-11-06Move conflict message into conflict classJack Nagel
2012-10-31Fix build failure being non-verbose when --verboseMax Howell
2012-10-28formula: shorten path helpersAdam Vandenberg
2012-10-28debrew: formula debugging for homebrewCamillo Lugaresi
A new feature for easing the pain of working with complex formulas, or formulas for large packages. When running brew in debug mode (-d), if an exception propagates outside the formula's install method, you now get a menu which lets you return to the point where the exception was raised and perfom several useful actions, such as: - printing a backtrace - entering IRB to examine the context and test ruby code - entering the debugger (if ruby-debug is available) - entering a shell - ignoring the exception or proceeding with the raise as normal Signed-off-by: Max Howell <mxcl@me.com> * Fixed conflict in build.rb. * Removed old debug handling in Formula.brew. Closes Homebrew/homebrew#10435.
2012-10-21Allow varags to skip_cleanAdam Vandenberg
2012-10-15Manage Requirements using ComparableSetMisty De Meo
ComparableSet only allows a single object of a given class, choosing the object with the greatest value. This was mainly created for Requirements, so that, e.g., two X11Dependencies of differing strictness don't both end up in the same requirement set. Fixes Homebrew/homebrew#15240.
2012-10-09Don't munge tapped formula names in Formula.factoryJack Nagel
This started happening as a result of bbc167b, which avoids reloading previously defined formulae. The exception alters its message if the name parameter appears to be a tapped formula, but this is lost if we only pass in the "stem" of the pathname. Long-term this probably needs some restructuring, perhaps with a separate exception for tapped formula, but for now this should re-enable the more useful error message. Fixes Homebrew/homebrew#15374. Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2012-09-28Only handle build-errors when it's a build-errorMax Howell
Refs Homebrew/homebrew#15164.
2012-09-27Make FileUtils extension available globallyJack Nagel
Now that we are monkeypatching copy_metadata, we should load our extension up front for consistency. Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2012-09-27Don't set $VERBOSE when building nonverboselyMisty De Meo
Setting $VERBOSE in the environment makes the haskell-platform build fall down, which is surely one of the odder bugs I've run into. See Homebrew/homebrew#15164.
2012-09-27When builds fail verbosely, be verboseMax Howell
2012-09-25Clean up and improve build-error output and logsMax Howell
All logs are now stored from each command executed in Formula.install. Error output is truncated to five lines in an attempt to not overwhelm the user and to encourage users to read the error output and report the bug properly. Maybe we can get that figure up from 70% to 90%.
2012-09-17info: Add JSON outputMisty De Meo
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-14Support env :std, :userpathsAdam Vandenberg
Closes Homebrew/homebrew#14654.
2012-09-09Install plists by defaultAdam Vandenberg
2012-09-09allow skip_clean :laAdam Vandenberg
2012-08-31Hide --disable-debug from non verbose output alsoMax Howell
2012-08-30Fixes Homebrew/homebrew#14542; ocaml superenv issuesMax Howell
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-29Display skip-clean warning only before cleanMax Howell
Not anytime the formula loads.
2012-08-29Deprecate skip_clean :allMax Howell
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-29superenv: build-environments that just workMax Howell
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-29Create active symlinks for installed formulaMax Howell
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-26Formula factory: add commentAdam Vandenberg
2012-08-26Formula factory: re-raise certain NameErrors.Adam Vandenberg
Some name errors, such as NoMethodError, represent programming errors. Re-raise them to get a usable error message. Closes Homebrew/homebrew#14467.
2012-08-23factory: always check const_defined? before requiringJack Nagel
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-21factory: rescue NameErrorJack Nagel
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-21conflicts_with message: recommend unlinkMax Howell
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-21Formula.EnumerableMax Howell
Deprecated Formula.all, replaced usage with more appropriate enumerable options. Just check out how much nicer `brew audit` runs now.
2012-08-19factory: don't reload previously defined formulaeJack Nagel
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-18Don't lie about upgrading up-to-date formulaeJack Nagel
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-18Replace version strings with Version objectsJack Nagel
2012-08-14build: expand requirements recursively when modifying ENVJack Nagel
Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2012-08-13Formula.select and Formula.installedMax Howell
2012-08-12Add :when_xquartz_installed as a keg-only reasonJack Nagel
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-11Fix normalization of old- and new-style optionsMisty De Meo
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-09Deprecate ancient formula syntaxJack Nagel
Closes Homebrew/homebrew#13444. Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2012-08-08Add `option` to the DSLAdam Vandenberg
Closes Homebrew/homebrew#9982
2012-08-07Simplify printing conflicts in `brew info`Jack Nagel
Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2012-08-07Fix typo in conflicts_with DSL methodJack Nagel
Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2012-08-07Allow multiple unsatisfied fatal requirementsAdam Vandenberg
Closes Homebrew/homebrew#13335.
2012-07-30Add conflicts_with DSL methodMisty De Meo
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-17Formula: mirrors are always non-nilJack Nagel
Since 3ee9b7bd88a2d9017cdf005b10567a1d6d8ec211 ("SoftwareSpec: initialize @mirrors"), @active_spec.mirrors will always be non-nil. Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2012-07-04Teach download strategies to take a SoftwareSpecJack Nagel
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-04Refactor checksummingJack Nagel
Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2012-07-04Introduce new formula specsJack Nagel
2012-06-03std_cmake_args: Search for Frameworks lastCharlie Sharpsteen
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-05-22Introduce std_cmake_args methodJack Nagel
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-15Don't fall into the no-extension OK trapMax Howell
`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-02patches - support detection of compression typesAdam Vandenberg