24630 Commits

Author SHA1 Message Date
Misty De Meo
7e1af4b7d5 Unify compiler selection logic
This unifies the logic for selecting a compiler between superenv and
stdenv. A variation of superenv's `determine_cc`, which now returns a
symbol, has been moved into the shared ENV extension. Stdenv uses the
result of this directly (as it's always used symbols), while superenv
translates that back into a compiler string.

This also has the effect of disabling HOMEBREW_USE_(gcc|llvm|clang) in
stdenv, which have already been marked as deprecated for some time, and
enables the HOMEBREW_CC= environment variable syntax from superenv in
stdenv.
2013-08-30 07:52:13 -07:00
Misty De Meo
221bb2419f Add --cc= syntax for selecting compilers 2013-08-30 07:52:12 -07:00
Shaun Jackman
774cd8b68b universal_archs returns ArchitectureListExtension
Closes Homebrew/homebrew#22210.

Signed-off-by: Misty De Meo <mistydemeo@gmail.com>
2013-08-29 20:47:18 -07:00
Jack Nagel
fb50be432a Remove default values from ENV.{cc,cxx}
Closes Homebrew/homebrew#22138.
2013-08-29 19:22:36 -05:00
Jack Nagel
d61d054eac superenv: fix no-op system path filtering 2013-08-29 19:08:22 -05:00
Jack Nagel
b3f0b9f7b9 Allow conflicts_with to accept multiple formula names
Closes Homebrew/homebrew#22202.
2013-08-29 19:08:15 -05:00
Misty De Meo
1900b70bd6 Check for valid --bottle-arch= when building 2013-08-28 20:21:06 -07:00
Misty De Meo
c58d707158 Allow building bottles with custom architectures
This allows overriding the "oldest CPU" behaviour - for instance, to
build Intel bottles for a newer CPU than Core 2, to build a PPC bottle
with or without Altivec on the same computer, etc.
2013-08-28 20:21:06 -07:00
Misty De Meo
8a99ea2094 superenv: also filter out -mcpu=
On PPC, -mcpu is the preferred equivalent to -march.
2013-08-28 20:01:58 -07:00
Jack Nagel
e5cd33c7a9 cleaner: don't change permissions on paths marked skip_clean 2013-08-28 12:00:06 -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
Misty De Meo
a39ba39688 Revert "superenv: fix cpp shim"
This reverts commit dca89db55189a34f1c02d3f12a84eda8d81fd6d1.
2013-08-27 18:31:57 -07:00
Misty De Meo
55654933f5 superenv: fix cpp shim
This sets cpp to use the compiler as cpp, and works with scripts which
pass values to cpp on stdin as well as with file arguments.

Closes Homebrew/homebrew#22155.
2013-08-27 18:24:08 -07:00
Samuel John
ed461359a7 PythonInstalled: set PYTHONPATH, not prepend
An issue could arise when brewing a formula that
has Python 2.x and 3.x support and 2.x is the system Python
but 3.x is a brewed one. The idea about prepending was that
user configured PYTHONPATH could be used in formulae.
Now, instead and if needed, inside the `python do` block
one can still append to PYTHONPATH.
2013-08-27 16:34:31 +02:00
Samuel John
2e2e46b5b4 PythonInstalled, name includes modules
If `depends_on :python => ['modulename', :optional]` then the generated
option is now `--with-python-modulename`, so that it is possible to
actually make depending on python modules optional.
Further, `brew options` becomes more meaningful.
2013-08-27 09:48:12 +02:00
Jack Nagel
77056dc5cd Simplify condition 2013-08-26 22:11:29 -05:00
Jack Nagel
23c2ec56f8 Prefer interpolation to concatenation 2013-08-26 21:58:18 -05:00
Jack Nagel
9e8638ea35 Only perform coercion to string once in ENV.{append,prepend} 2013-08-26 15:03:37 -05:00
Jack Nagel
870e47e68c Add some tests for ENV.{append,prepend} behavior 2013-08-26 15:02:51 -05:00
Misty De Meo
f0bf64e1e9 superenv: support PPC bottles
Allows for building bottles on PPC both with and without Altivec.
This is currently not active but will be enabled once superenv is
stable on Leopard.
2013-08-25 14:51:48 -07:00
Adam Vandenberg
3703d60e57 Fix const reference in mach
Fixes Homebrew/homebrew#22090.
2013-08-24 16:42:29 -07:00
Samuel John
c4d8917f3f PythonInstalled: Unset PYTHONPATH for satisfied?
When a formula `depends_on :python` *and* `depends_on :python3`
the `modify_build_environment` method sets the PYTHONPATH
and the Python 3.x requirement then fails because it finds
the sitecustomize.py from Python 2.x in the PYTHONPATH.
2013-08-23 20:26:47 +02:00
Jack Nagel
84369dd949 Always pass -headerpad_max_install_names to the linker
We use install_name_tool pretty liberally, so we need to take steps to
ensure libraries and executables are always linked with this flag.

Closes Homebrew/homebrew#20233.
Fixes Homebrew/homebrew#17984.
Fixes Homebrew/homebrew#22078.
2013-08-23 11:36:03 -05:00
Greg Sieranski
ebae9ca7bb zsh completion for brew reinstall
Closes Homebrew/homebrew#22061.

Signed-off-by: Samuel John <github@SamuelJohn.de>
2013-08-23 16:40:30 +02:00
Misty De Meo
3cf3fa7d8f superenv: fix CC value for ENV.gcc
'gcc' could refer to anything of llvm-gcc, clang, or gcc-4.0 on
various Xcode versions.
2013-08-22 22:42:54 -07:00
Jack Nagel
95af184a0c Add an accessor to make the intent more clear here 2013-08-22 17:45:08 -05:00
Jack Nagel
9b2e04593f Options: ensure copies do not share the underlying collection 2013-08-22 11:49:24 -05:00
Jack Nagel
7654077752 Demonstrate the Set-like nature of Options collections
Options collections are backed by Sets, and thus trying to push a new
option with a name that duplicates an existing option cannot succeed.

Later, we can exploit this behavior and remove some conditionals.
2013-08-22 11:35:00 -05:00
Greg Sieranski
1abb8cdf81 adding reinstall to bash completion
Closes Homebrew/homebrew#22051.

Signed-off-by: Samuel John <github@SamuelJohn.de>
2013-08-21 20:25:15 +02:00
Samuel John
43fc7423d7 brew reinstall: Is able to work for all formulae
... and not just installed ones. Of course, strictly speaking,
reinstalling not-yet-installed formulae makes semantically little
sense, but the big win is that we can tell people (after we have
resolved an issue) to `brew reinstall <formula>` and even if a user
has removed that formula in the meantime, reinstall will do the right
thing. Basically adding --force to uninstall. I think this makes
reinstall more robust.
2013-08-21 20:18:55 +02:00
Samuel John
5a0bad6b42 Revert "brew reinstall: Is able to work for all formulae"
This reverts commit 865f763ae59fdf32f496ca416fd98117f3370f86.
2013-08-21 20:17:38 +02:00
Samuel John
4bb49a6439 brew reinstall: Is able to work for all formulae
... and not just installed ones. Of course, strictly speaking,
reinstalling not-yet-installed formulae makes semantically little
sense, but the big win is that we can tell people (after we have
resolved an issue) to `brew reinstall <formula>` and even if a user
has removed that formula in the meantime, reinstall will do the right
thing. Basically adding --force to uninstall. I think this makes
reinstall more robust.
2013-08-21 19:20:41 +02:00
Jack Nagel
db1075fdc7 Use ENV.update to restore removed variables 2013-08-20 18:51:11 -05:00
Jack Nagel
71586d09aa Avoid the need to compact the expanded deps array 2013-08-20 14:16:17 -05:00
Samuel John
c4d7e21df5 brew create: Mention the example-formula 2013-08-20 15:44:12 +02:00
Samuel John
11b49ca28f man brew: Mention the example-formula.rb 2013-08-20 15:37:31 +02:00
Samuel John
78d436c68e Adding an example-formula.rb to show all features
A huge cheat sheet. Kind of.
2013-08-20 15:20:45 +02:00
Jack Nagel
865b68de10 Add tests for ENV.{append,prepend}_path 2013-08-19 17:21:14 -05:00
Jack Nagel
4a3dac82ef Use ENV.prepend_path 2013-08-19 17:21:13 -05:00
Jack Nagel
ea8f51256b Use ENV.append_path 2013-08-19 17:21:13 -05:00
Jack Nagel
b672b44cf9 Add ENV.append_path 2013-08-19 17:21:13 -05:00
Mike McQuaid
5e41d0f51f SUPPORTERS: add final list. 2013-08-19 22:26:48 +01:00
Jack Nagel
b8bac2ba53 Fix typo 2013-08-19 14:07:14 -05:00
Jack Nagel
1ffd40821a which in requirements always uses ORIGINAL_PATHS now
Fixes Homebrew/homebrew#22002.
2013-08-19 13:54:09 -05:00
Amos Wenger
52ace99f14 Use File::PATH_SEPARATOR globally instead of ':'
On Unix, the path separator is ':', whereas on Windows,
it is ';'. This is the first of a series of patch to bring
macbrew's and winbrew's codebases closer together.

The main places the magic constant ':' was being used were:
  - the $PATH environment variable
  - CMAKE-related environment variables
  - pkg-config related environment variables

Closes Homebrew/homebrew#21921.

Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2013-08-19 13:35:44 -05:00
Jack Nagel
809a52a6a3 audit: activate ENV extensions 2013-08-19 13:03:41 -05:00
Jack Nagel
cec8d74239 Remove ENV.expand_xcrun
This method is currently unused and after inspecting the git history, it
appears it may never have been used at all.
2013-08-19 12:34:14 -05:00
Jack Nagel
a6771cd327 Initial tests for superenv sanity 2013-08-19 12:33:00 -05:00
Jack Nagel
a03120868f No longer call ENV.userpaths! in requirements
Instead we use which with a custom PATH.
2013-08-19 12:33:00 -05:00
Jack Nagel
e0574b854e More robust implementation of ENV.with_build_environment 2013-08-19 12:32:59 -05:00