4367 Commits

Author SHA1 Message Date
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
Jack Nagel
dd9c269c69 Rename HomebrewEnvExtension to Stdenv 2013-08-19 12:32:59 -05:00
Jack Nagel
9a5b15bb61 Move common ENV methods to a shared module 2013-08-19 12:32:59 -05:00
Jack Nagel
cc18f5e0c4 Move superenv.rb to extend/ENV/super.rb 2013-08-19 12:32:59 -05:00
Jack Nagel
061f8cb35f Fix superenv ENV[] hack
We override ENV[] to always return strings under superenv, because
legacy formulae assume that CFLAGS, etc. are non-nil.

However, the current implementation has a bug. If I simply concatenate
ENV['CFLAGS'] with another string, it mutates ENV['CFLAGS']:

  irb> ENV['CFLAGS']
  => ""
  irb> ENV['CFLAGS'] + 'a'
  => "a"
  irb> ENV['CFLAGS']
  => "a"

Instead, let's simply return an empty string if the key doesn't exist.
This is sufficient because the following are equivalent:

  1. ENV['CFLAGS'] += "string"
  2. ENV['CFLAGS'] = ENV['CFLAGS'] + "string"
2013-08-19 12:32:58 -05:00
Jack Nagel
9699c0764e Re-enable superenv ENV[] hack 2013-08-19 12:32:58 -05:00
Jack Nagel
ce31c16a14 Reference self, not ENV, in ENV.fortran 2013-08-19 12:32:58 -05:00
Jack Nagel
06b1668340 Reference self rather than ENV in Superenv module
We want to be able to extend this module onto an arbitrary hash and use
it without mutating ENV, for testing purposes.
2013-08-19 12:32:57 -05:00
Jack Nagel
d09e23c8b1 Move extra stdenv setup to extended callback 2013-08-19 12:32:57 -05:00
Jack Nagel
eebc04ec9b Move common stuff to extend/ENV.rb 2013-08-19 12:32:57 -05:00
Jack Nagel
bf0e329010 Make Superenv activation explicit 2013-08-19 12:32:56 -05:00
Jack Nagel
a04f1ac3d3 Move superbin into Superenv module 2013-08-19 12:32:56 -05:00
Jack Nagel
ab5c6218b1 Move setup into an extended callback 2013-08-19 12:32:56 -05:00
Jack Nagel
21d3402f8e Extend Superenv onto ENV instead of defining it on the singleton class 2013-08-19 12:32:55 -05:00