Commit Graph
20799 Commits
Author SHA1 Message Date
Jack Nagel 37372fca3e libgcrypt: make universal optional
Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2013-01-26 12:29:40 -06:00
Jack Nagel e2a14048c1 jbigkit: make universal optional
Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2013-01-26 12:29:26 -06:00
Jack Nagel 0f1f0e5142 duplicity: make universal optional
Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2013-01-26 12:29:15 -06:00
Jack Nagel e23503af3d diffpdf: depends on popper with-qt4 2013-01-26 12:29:03 -06:00
Jack Nagel 343db7e49c pdf2svg: depends on poppler with-glib 2013-01-26 12:29:00 -06:00
Jack Nagel 8755c695c3 vtk: use current tab API 2013-01-26 12:28:56 -06:00
Jack Nagel 8899d9075e subversion: universal is now passed to deps automatically 2013-01-26 12:28:52 -06:00
Jack Nagel c69d7ffc14 gnome-doc-utils: depend on libxml2 'with-python'
Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2013-01-26 12:28:48 -06:00
Jack Nagel 9076baa3e9 postgresql: use new recommended deps support
Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2013-01-26 12:28:37 -06:00
Jack Nagel 86ee546abf mtr: use new optional deps support
Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2013-01-26 12:28:30 -06:00
Jack Nagel 9acf2b62dd audit: warn about nonexistent options passed to deps 2013-01-26 12:14:51 -06:00
Jack Nagel 7e8d110910 upgrade: use standard Tab accessor
Yes, the formula object does refer to a version that has not yet been
installed, but we were not looking into Formula#prefix, but #linked_keg,
which is version agnostic (since the original patch was committed, we
Tab#for_formula learned to look into #opt_prefix as well). The rest of
the logic is already embedded in the Tab accessors.
2013-01-26 12:14:51 -06:00
Jack Nagel 7e8d335789 Fix Dependencies -> Array conversion 2013-01-26 12:14:51 -06:00
Jack Nagel 97310a0fed Tag Xcode and CLT requirements as build-time
This way they can be skipped when installing bottles.
2013-01-26 12:14:50 -06:00
samueljohn 7bd5acd385 Add "depends_on :clt" 2013-01-26 12:14:50 -06:00
Jack Nagel 41980bdfdf Replace usages of recursive_deps with recursive_dependencies 2013-01-26 12:14:49 -06:00
Jack Nagel 569231f14d upgrade: offload dependency expansion to FormulaInstaller
Now that FormulaInstaller does dependency expansion the _right_ way,
avoid duplicating the logic in upgrade. Instead, offload it to the
installer, which will generate an exception in check_install_sanity that
we can safely ignore when formulae in the outdated list are upgraded as
part of the dependency tree of another outdated formula.
2013-01-26 12:14:49 -06:00
Jack Nagel 84d73f6afc uses: utilize modern dependency API 2013-01-26 12:14:49 -06:00
Jack Nagel 85a77eb1d0 missing: ignore unused optional and recommended deps 2013-01-26 12:14:48 -06:00
Jack Nagel 775184240d FormulaInstaller: construct new ARGV from an Options collection
The array of options that is passed to the spawned build process is a
combination of the current ARGV, options passed in by a dependent
formula, and an existing install receipt. The objects that are
interacting here each expect the resulting collection to have certain
properties, and the expectations are not consistent.

Clear up this confusing mess by only dealing with Options collections.
This keeps our representation of options uniform across the codebase.

We can remove BuildOptions dependency on HomebrewArgvExtension, which
allows us to pass any Array-like collection to Tab.create. The only
other site inside of FormulaInstaller that uses the array is the #exec
call, and there it is splatted and thus we can substitute our Options
collection there as well.
2013-01-26 12:14:47 -06:00
Jack Nagel 7a8935455b FormulaInstaller: allow formulae to pass options to deps
Formulae can now pass build options to dependencies. The following
syntax is supported:

  depends_on 'foo' => 'with-bar'
  depends_on 'foo' => ['with-bar', 'with-baz']

If a dependency is already installed but lacks the required build
options, an exception is raised. Eventually we may be able to just stash
the existing keg and reinstall it with the combined set of used_options
and passed options, but enabling that is left for another day.
2013-01-26 12:14:46 -06:00
Jack Nagel 0551dedf79 FormulaInstaller: don't install bottle if options were passed 2013-01-26 12:14:46 -06:00
Jack Nagel f76a8bdd1f FormulaInstaller: make tab an attr, but never a parameter 2013-01-26 12:14:46 -06:00
Jack Nagel f97b4a9509 Dependency.expand_dependencies
Move Formula.expand_dependencies into the Dependency class, and extend
it to allow arbitrary filters to be applied when enumerating deps.

When supplied with a block, expand_dependencies will yield a [dependent,
dependency] pair for each dependency, allowing callers to filter out
dependencies that may not be applicable or useful in a given situation.

Deps can be skipped by simple calling Dependency.prune in the block,
e.g.:

  Dependency.expand_dependencies do |f, dep|
    Dependency.prune if dep.to_formula.installed?
  end

The return value of the method is the filtered list.

If no block is supplied, a default filter that omits optional or
recommended deps based on what the dependent formula has requested is
applied.

Formula#recursive_dependencies is now implemented on top of this,
allowing FormulaInstaller to exact detailed control over what deps are
installed. `brew missing` and `brew upgrade` can learn to use this to
apply the installed options set when expanding dependencies.

Move Formula.expand_deps and Formula#recursive_deps into compat, because
these methods do not respect the new optional and recommended tags and
thus should no longer be used.
2013-01-26 12:14:46 -06:00
Adam Vandenberg 5b9909d4f5 Let option override with/without descriptions 2013-01-26 12:14:45 -06:00
Adam Vandenberg 4d2940e372 Add support for optional and recommended deps
Optional deps are not installed by default but generate a corresponding
"with-foo" option for the formula. Recommended deps _are_ installed by
default, and generate a corresponding "without-foo" option.
2013-01-26 12:14:45 -06:00
Adam Vandenberg 2baff20ea8 Formula::finalize_dsl 2013-01-26 12:14:45 -06:00
Jack Nagel f82ed2f33d FormulaInstaller: implement installation locks
FormulaInstaller now attempts to take a lock on a "foo.brewing" file for
the formula and all of its dependencies before attempting installation.

The lock is an advisory lock implemented using flock(), and as such it
only locks out other processes that attempt to take the lock. It also
means that it is never necessary to manually remove the lock file,
because the lock is not enforced by I/O.

The uninstall, link, and unlink commands all learn to respect this lock
as well, so that the installation cannot be corrupted by a concurrent
Homebrew process, and keg operations cannot occur simultaneously.
2013-01-26 12:14:45 -06:00
Jack Nagel d1dca30bef FormulaInstaller: skip build-time deps for bottles 2013-01-26 12:14:44 -06:00
Jack Nagel 0e5ca665bb FormulaInstaller: factor out dependency installation 2013-01-26 12:14:44 -06:00
Jack Nagel dc96fe8567 FormulaInstaller: factor out requirement checking 2013-01-26 12:14:44 -06:00
Jack Nagel f180a4f7dc Dependency#to_formula and associated helpers 2013-01-26 12:14:44 -06:00
Jack Nagel e95cebc146 Formula#recursive_dependencies
This behaves like recursive_deps, but the resulting list consists of
Dependency objects instead of Formula objects. The list maintains the
installable order property of recursive_deps.

While in the area, add some comments clarifying the purpose of related
methods.
2013-01-26 12:14:43 -06:00
Jack Nagel 5590331290 Tab#with? to mirror BuildOptions#with?
Eventually a common interface could be factored out into a module, but
for now this will suffice.
2013-01-26 12:14:43 -06:00
Jack Nagel a875e09217 Tests for BuildOptions 2013-01-26 11:37:02 -06:00
Jack Nagel 36939b4872 Move BuildOptions to a separate file 2013-01-26 11:37:02 -06:00
Jack Nagel 8f5ea8eea6 Refactor option handling internals
Currently we handle options in several ways, and it is hard to remember
what code needs an option string ("--foo"), what needs only the name
("foo") and what needs an Option object.

Now that Option objects can act as strings and be converted to JSON, we
can start using them instead of passing around strings between Formula
objects, Tab objects, and ARGV-style arrays.

The Options class is a special collection that can be queried for the
inclusion of options in any form: '--foo', 'foo', or Option.new("foo").
2013-01-26 11:37:01 -06:00
Jack Nagel 91f15daf73 BuildOptions: check has_option? for universal and 32-bit 2013-01-26 11:37:01 -06:00
Jack Nagel 7e5a869731 BuildOptions: simplify setting description 2013-01-26 11:37:01 -06:00
Jack Nagel 7a2e4e8cf8 Options can be dumped as JSON 2013-01-26 11:37:01 -06:00
Jack Nagel 56f72c4853 Options can be used interchangeably with Strings
We want to be able to use Option objects in place of strings and have
this be transparent. Defining to_str means that methods like
Kernel#system and Kernel#exec will be able to perform an implicit
conversion.
2013-01-26 11:37:01 -06:00
Jack Nagel 8d0c65e47b Move option comparison into BuildOptions 2013-01-26 11:37:00 -06:00
Jack Nagel 76c01e91e4 Clean up Tab creation 2013-01-26 11:37:00 -06:00
Christian Höltje b0f80273cd ruby: use opt_prefix in caveats
The gem's bindir is available in the opt_prefix; use
that instead of the Cellar location in the caveat.

Closes #17315.

Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2013-01-26 11:30:18 -06:00
Mike McQuaid afcb3d062f Allow depending on requirement class or instance. 2013-01-26 14:33:05 +00:00
Mike McQuaid 8cc8b46709 qt5: make keg_only due to qt conflict.
References #16471.
References #16921.
2013-01-26 14:13:58 +00:00
Mike McQuaid f40b309fb1 brew-cleanup: don't whine about permission denied.
Closes #14359.
2013-01-26 14:11:06 +00:00
Mike McQuaid 74832851a2 Add tmux warning for launchctl caveats.
References #13951.
2013-01-26 14:06:48 +00:00
Mike McQuaid b4d87c2ad4 We use formulae as the plural of formula. 2013-01-26 13:16:55 +00:00
Mike McQuaid b5069edcbd brew-test: use SHA-1 in all testballs. 2013-01-26 13:10:06 +00:00