Commit Graph
50 Commits
Author SHA1 Message Date
Jack Nagel 70069c5d75 Separate formula conflicts from requirements
Closes #20357.
2013-06-09 13:45:25 -05:00
Mike McQuaid 4ae8aed783 Bottle DSL: allow checksums access. 2013-06-08 16:41:44 +01:00
Jack Nagel f155d31943 Decouple bottle tags from MacOS.cat 2013-06-06 16:02:27 -05:00
Jack Nagel dc315dc525 Use ivar accessors 2013-06-06 12:10:41 -05:00
Jack Nagel 0759cce3c2 Extract attr_rw from Formula for reuse
Closes #20239.
2013-06-04 11:06:18 -05:00
Adam Vandenberg 577cb5a2b2 Audit url/devel/head for redundant :using 2013-05-27 22:25:34 -07:00
Mike McQuaid d6dae4544f Remove cat_without_underscores bottle methods. 2013-05-25 16:02:18 +01:00
Jack Nagel cdf99a0afa Remove dead code
This is initialized in #initialize.
2013-04-08 00:27:47 -05:00
Jack Nagel c75e144452 Rename checksums.rb to match class name 2013-04-04 12:34:24 -05:00
Jack Nagel fe3eb72733 Suppress uninitialized instance variable warnings 2013-03-28 17:37:29 -05:00
Jack Nagel 31fd139e57 Simplify SoftwareSpec checksum methods
Reader methods for specific checksum types have been absent from the
Formula class for some time, so there isn't any reason to expose them in
SoftwareSpec, either.

Thus, these methods now only act as setters, and #checksum should be
used to access the constructed Checksum object.
2013-03-18 15:10:36 -05:00
Jack Nagel e5a103b3b8 Pass filename and lineno arguments to class_eval 2013-03-12 00:38:52 -05:00
Mike McQuaid 98047d08c4 Relocate bottles using install_name_tool.
This has two parts:

1. Bottles are temporarily relocated on bottling and tested if that is
sufficient for them to contain no longer reference the prefix or
cellar. If so, they are marked as relocatable.
2. On installation if bottles are marked as relocatable they will be
relocated using install_name_tool to the current prefix and cellar.

Closes #18374.
2013-03-11 18:58:37 +00:00
Jack Nagel ec90af1eca Remove redundant attr_readers
These are redefined later for use in the bottle DSL.
2013-03-09 22:44:53 -06:00
Mike McQuaid febd499cd5 bottles: remove unused 'version' from DSL. 2013-03-09 21:27:41 +00:00
Mike McQuaid 82ecb69a53 Add non-/usr/local bottles support.
Signed-off-by: Mike McQuaid <mike@mikemcquaid.com>
2013-03-01 17:49:09 +00:00
Mike McQuaid d1cd6b2d86 Add custom bottle URL support.
Signed-off-by: Mike McQuaid <mike@mikemcquaid.com>
2013-03-01 17:49:09 +00:00
Mike McQuaid f99e05bb49 Cleanup bottle DSL.
* Remove legacy url syntax.
* Use revision instead of version.

Signed-off-by: Mike McQuaid <mike@mikemcquaid.com>
2013-03-01 17:49:09 +00:00
Jack Nagel d39678612f Avoid nil in URL specs 2013-02-11 20:52:07 -06:00
Mike McQuaid 3318b08a2e Don't use underscores in (new) bottle filenames.
Closes #14270
2013-01-29 17:14:09 -08: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 761acc47a7 Test coverage for DownloadStrategyDetector
While at it, make it use class methods instead; no reason to instantiate
an object for this.

Eventually there should be some functional tests for the individual
strategies as well.

Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2012-10-15 17:45:48 -05:00
Mike McQuaid b946bf758a Fix keg-only on pre-Mountain Lion formulae. 2012-08-23 09:49:08 -07:00
Jack Nagel 803535556c Simplify build options API
Simplify access to the different forms of a formula's build options by
making options into real objects rather than strings, and expose both
the 'name' and 'flag' form.
2012-08-20 14:16:08 -05:00
Jack Nagel db7a800130 Add support for custom version schemes
A version scheme is a class that inherits from Version and reimplements
Version#<=>. This will allow formulae to specify a custom comparison
method that will be used instead of the default, for cases where the
default is insufficient.
2012-08-18 11:12:09 -05:00
Jack Nagel e53bb4f18b SoftwareSpec: simplify conditional 2012-08-18 11:12:09 -05:00
Jack Nagel 9e80ec2c11 Add Version#detected_from_url? 2012-08-18 11:12:09 -05:00
Jack Nagel 4affbabfb7 Replace version strings with Version objects 2012-08-18 11:12:08 -05:00
Jack Nagel 2eef46ae5a 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
Jack Nagel e532239fea Fix writing build options to install receipt
Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2012-08-12 13:37:40 -05:00
Jack Nagel 598a60db10 BuildOptions: store option tuples in a Set
As options are stored in an object owned by the eigenclass of a formula,
options defined in the Formula#options method can be added multiple
times if the formula is instantiated multiple times.

Store them in a set to prevent duplicates.

Fixes #14133.

Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2012-08-12 00:58:48 -05:00
Adam Vandenberg 8ab3b16876 New style is for option descriptions to not end with periods 2012-08-09 21:35:56 -07:00
Adam Vandenberg 5f5a1eb176 options: remove duplicate function 2012-08-09 07:20:14 -07:00
Adam Vandenberg 402bd729f7 Add option to the DSL
Closes #9982
2012-08-08 22:01:27 -07:00
Misty De Meo 3ee9b7bd88 SoftwareSpec: initialize @mirrors
Since methods were being called on it without verifying its type.
2012-07-05 13:11:44 -05:00
Jack Nagel 886f64a53c Give SoftwareSpec an initializer
Tools like `brew create` need to create and manipulate SoftwareSpec
objects. It is useful to be able to do this directly, rather than by
proxy through the special methods that serve the main formula DSL.

Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2012-07-04 22:47:35 -05:00
Jack Nagel f6a67ea017 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 078cfc5158 Refactor download strategy detection
Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2012-07-04 22:47:34 -05:00
Jack Nagel 0c18ffd7fa Refactor checksumming
Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2012-07-04 22:47:33 -05:00
Jack Nagel cb94753b88 Introduce new formula specs 2012-07-04 22:47:32 -05:00
Mike McQuaid 548d6a54ad Fix Ruby warnings.
Fixes #11966.
2012-05-01 20:45:17 +08:00
Jack Nagel b36f59dd3c 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
Adam Vandenberg 7831b929f8 Move llvm method to FailsWithLLVM 2012-03-05 21:14:48 -08:00
Adam Vandenberg bcf5ee2e39 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