1526 Commits

Author SHA1 Message Date
Jack Nagel
bac8cce29f Flush stdout before leaving Formula#system 2013-11-29 21:05:28 -06:00
Jack Nagel
aec457bb7c Replace error-prone superenv debug ouput with a separate log file 2013-11-17 19:04:21 -06:00
Jack Nagel
a2d9271bda Remove intermediate exception in Formula#system
Now that ErrorDuringExecution is only raised in one place, we can just
raise the BuildError directly instead.
2013-11-02 22:52:24 -05:00
Xiyue Deng
917b94df98 Add cxxstdlib_check method to request changing C++ stdlib checking.
* In certain cases, a C++ software may result in linking to a different
  and incompatible C++ standard library than its dependencies and still
  works fine because it is by design. Examples include GCC, which will
  bootstrap itself and self-host after finish.

* Add a cxxstdlib_check method to formula to request changing the C++
  standard library checking. Currently using "cxxstdlib_check :skip"
  will let a formula skip such checking. This should only be used on
  rare occasions and be very careful.

Closes Homebrew/homebrew#23687.
2013-11-02 17:30:05 -07:00
Jack Nagel
d35e465671 fetch: clear partial downloads when --force is given
Fixes Homebrew/homebrew#23764.
2013-10-31 14:29:38 -05:00
Stefan
71f0ad069d Generate logs in verbose mode
Closes Homebrew/homebrew#23654.

Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2013-10-31 14:24:48 -05:00
Mike McQuaid
a28b57d3fb git-etc: remove all code.
I've given up on this; too many edge cases.
If someone else wants to pick it up then send me a message and I'll walk
you through the approach.
2013-10-30 16:15:31 -07:00
Mike McQuaid
d9d2443d5d Cleanup use of some global constants. 2013-10-30 13:20:48 -07:00
Mike McQuaid
4c0fd46329 Formula: add tap? method. 2013-10-30 11:20:02 -07:00
Mike McQuaid
202c6ef826 global: add more tap regexes. 2013-10-30 11:19:46 -07:00
Jack Nagel
83d4ac5092 Remove "double negative" condition 2013-10-22 13:31:14 -05:00
Jack Nagel
63e1c71c50 Eagerly initialize formula specs
Declarations of dependencies, options, and resources in the DSL only
apply to specs that have already been initialized. For example, given
this snippet:

  url ...
  sha1 ...

  depends_on 'foo'

  devel do
    url ...
    sha1 ...
  end

The dependency 'foo' will be recorded for the stable spec, but not the
devel spec, since it was not initialized prior to the call to
depends_on.

While it is considered best practice to declare all specs (stable,
devel, head, and bottle) prior to other declarations, there is nothing
that enforces this ordering, so when it happens it can be confusing and
hard to debug.

To prevent this, we can initialize all specs up front. This comes with
a performance penalty for commands that load all formulae into memory,
but that is probably outweighed by what we gain in correctness.

Fixes Homebrew/homebrew#23425.
2013-10-22 13:31:08 -05:00
Mike McQuaid
6551643127 HOMEBREW_GIT_ETC: fix nil etc bug. 2013-10-19 14:24:33 +01:00
Mike McQuaid
ee7869b056 formula: fix git_etc bash_completion handling. 2013-10-19 13:54:49 +01:00
Mike McQuaid
a6e2245732 git_etc: update based on bottle etc/var changes. 2013-10-10 16:46:47 +01:00
Mike McQuaid
af4247429b formula: add bottle_prefix method. 2013-10-10 16:46:47 +01:00
Mike McQuaid
caa2f87728 InstallRenamed: don't overwrite etc files; rename.
If an etc file exists on installation instead of overwriting it (or
requiring all the manual checks in formula) simply copy it with the
extension `.default` appended.
2013-10-10 16:46:47 +01:00
Jack Nagel
50c7c6bbd6 Check types in Formula#==
Comparing two objects should not raise an exception, even if they have
different types.

The semantics of #== are now the same as #eql?, so make one an alias.
2013-10-04 21:19:15 -05:00
Mike McQuaid
e4b6fc5ae0 Bottle: set version from stable spec. 2013-09-27 09:22:15 +01:00
Jack Nagel
1fb9f85c5f Simplify setup for local bottle installation
Closes Homebrew/homebrew#22833.
2013-09-26 10:04:45 -05:00
Jack Nagel
28c8395f3d Group DSL methods that delegate to the stable spec 2013-09-22 16:04:25 -05:00
Jack Nagel
7531dfc219 Allow explicitly requiring universal deps
Previously, instructing Homebrew that all dependencies should be built
universal could be accomplished by redefining BuildOptions#universal? in
the class body:

  def build.universal?
    true
  end

However, the build object is no longer shared by all specs, so this is
insufficient. Instead, a new DSL method, "require_universal_deps", can
be used.

This feature is almost exclusively for wine, which requires universal
deps but does not itself have a universal option, since it is always
built 32-bit.
2013-09-21 19:27:24 -05:00
Jack Nagel
5511a8b3f5 Move dependencies to SoftwareSpec 2013-09-21 19:27:24 -05:00
Jack Nagel
a8d3aca169 Move options to SoftwareSpec 2013-09-21 19:27:24 -05:00
Jack Nagel
2eefba005f Give this condition a more revealing name 2013-09-21 19:27:24 -05:00
Jack Nagel
9c7a18bdcb Make spec-scoped resources override top-level resources 2013-09-17 21:29:53 -05:00
Jack Nagel
b40b46e3f6 Make top-level resources apply to all specs 2013-09-17 21:29:53 -05:00
Jack Nagel
360a099faa Track initialized specs 2013-09-17 21:29:52 -05:00
Jack Nagel
6116450328 Move formula resources to SoftwareSpec 2013-09-17 21:29:52 -05:00
Jack Nagel
df537528c7 Reimplement SoftwareSpec on top of Resource 2013-09-17 21:29:52 -05:00
Jack Nagel
eb3071332c Decouple Resource from SoftwareSpec 2013-09-17 21:29:50 -05:00
Samuel Cochran
23c869afee Cater to download strategies not yielding a file
Closes Homebrew/homebrew#22580.

Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2013-09-16 14:32:40 -05:00
Jack Nagel
a31fcb554c Move SoftwareSpec to a separate file 2013-09-14 10:16:52 -05:00
Jack Nagel
adceeb52f6 Stop exposing the download strategy from Formula 2013-09-13 22:33:46 -05:00
Jack Nagel
320356236d head DSL can accept a block 2013-09-13 11:13:12 -05:00
Jack Nagel
448ce26980 Use SoftwareSpec directly when using a stable block 2013-09-12 19:43:22 -05:00
Adam Vandenberg
d4cf3ef212 Implement Resources
Closes Homebrew/homebrew#20212.
2013-09-11 22:05:26 -07:00
Jack Nagel
771a28427c Use block-form of File.open and let Ruby do the cleanup 2013-09-07 10:22:58 -05:00
Jack Nagel
8b2a8d0595 ARGV.verbose? is always false here 2013-09-07 10:22:11 -05:00
Mike McQuaid
ab20ed0bc2 Optionally use git to keep brew etc versioned.
Still in alpha state.
Handles defaults and merging changes with new versions.
Enable by setting the HOMEBREW_GIT_ETC environment variable.

Closes Homebrew/homebrew#15751.
Closes Homebrew/homebrew#17713.
2013-09-07 13:39:43 +01:00
Jack Nagel
a1f165c02d Fix file descriptor leak in Formula#system 2013-09-06 23:17:50 -05:00
Xiyue Deng
45d5471a43 Enable verbose compile command in create template.
* Add "--disable-silent-rules" option to autotools-based configure
  options.
  - Also add comments to notify user removing unrecognized configure
    options.
* Add "-DCMAKE_VERBOSE_MAKEFILE=ON" to cmake-based configure options.
2013-09-06 17:59:58 -07:00
Samuel John
59a0c1e1b5 Improve python tests for brew bots
Allow `build.with?` and similar methods to be used during the test
phase. The BuildOptions (`build`) are initialized with the
`Tab.used_options` unless explicitly overwritten on the command line.

So basically `build.with?` works in `def install` and in `test do` as
one would naively expect. (For the test, gramatically it should be
`built.with?` but who cares)

If a formula was installed `--with-python`, now the tests are also
run `--with-python`. This enables us to use the `python do ... end` in
a meaningful manner.

Using `python do ... end` blocks for the tests, because the bot.brew.sh has
system python per default and we need to set the PYTHONPATH for the test.
Potentially to different values for Python 2.x and 3.x.
2013-09-05 15:26:57 +02:00
Misty De Meo
922a4f1b77 Formula: record full path to non-core formula
If a formula is passed with a relative path, the build process might
try to expand it in the wrong directory, where it doesn't exist.

Fixes Homebrew/homebrew#22266.
2013-09-02 10:01:36 -07:00
Misty De Meo
ef1d9c0cd0 Implement fails_with for non-Apple compilers
This adds support for non-Apple GCC compilers in the fails_with code.
A fails_with block for a non-Apple compiler looks like:

fails_with :gcc => '4.8.1' do
  cause 'Foo'
end

Non-Apple compilers don't have build numbers, so compiler failures are
based on version strings instead.

Internally non-Apple compilers can be distinguished because they are
passed around as strings instead of symbols.

In addition, this alters the priority list for compilers, with the
following changes:

* Apple GCC 4.2 and LLVM-GCC swap positions, with GCC now taking
  priority. (Maybe LLVM-GCC should just go away.)
* Non-Apple GCC compilers are ranked below GCC 4.2 but above LLVM-GCC
  and Apple GCC 4.0.
2013-09-01 13:19:13 -07:00
Jack Nagel
0c75f2d280 Push dependency option generation into BuildOptions 2013-08-31 16:16:54 -05:00
Dan Hughes
51d1a8e3c5 Use system path for more tools, for Linux compat.
Closes Homebrew/homebrew#22196.

Signed-off-by: Adam Vandenberg <flangy@gmail.com>
2013-08-30 13:02:19 -07:00
Jack Nagel
b3f0b9f7b9 Allow conflicts_with to accept multiple formula names
Closes Homebrew/homebrew#22202.
2013-08-29 19:08:15 -05:00
Samuel John
e38dd0b764 Don't consider files in the Cellar as Racks
Otherwiese a `Cellar/.DS_Store` may lead to an error about
`.ds_store.rb` not found during `brew upgrade`.
2013-08-28 09:35:11 +02:00
Jack Nagel
db1075fdc7 Use ENV.update to restore removed variables 2013-08-20 18:51:11 -05:00