664 Commits

Author SHA1 Message Date
Jack Nagel
96195295a3 Deprecate Pathname#cp and Pathname#chmod_R
As far as I can tell these methods have only ever been used in the test
suite.

Since Formula includes FileUtils, it is generally simpler (and in the
case of cp, more readable) to use the FileUtils methods directly.

Closes Homebrew/homebrew#30081.
2014-06-12 09:00:58 -05:00
Jack Nagel
faaa622820 Deprecate Pathname#/ with non-string/non-pathname arguments
Ruby 2.2 will define Pathname#/ as a simple alias of Pathname#+.
In practice, this means that it will raise a TypeError unless the
argument responds to to_path or to_str.

Currently we blindly convert the argument to a string using to_s, so
deprecate this in the interest of matching the upstream behavior. In the
future we can replace this with

  alias_method :/, :+ unless method_defined?(:/)

Closes Homebrew/homebrew#30079.
2014-06-12 09:00:51 -05:00
Jack Nagel
93d8e71641 Use Digest#file if it's available 2014-06-11 12:05:19 -05:00
Jack Nagel
191e588212 Stop caching Superenv.bin
It is not a hotspot and causes an ordering dependency in the tests.
2014-06-10 17:50:33 -05:00
Jack Nagel
7f10aa3b6e Fix visibility of FileUtils extension methods 2014-06-09 21:37:52 -05:00
Jack Nagel
9e57da83a2 Stop exposing mktemp as a public method on formula objects 2014-06-09 21:36:36 -05:00
Jack Nagel
e3f082c294 Stop joining symbols to pathnames
Ruby 2.2's native Pathname#/ accepts only string-like objects.
2014-06-09 14:57:21 -05:00
Jack Nagel
fb3f95923b Just access the ivar directly 2014-06-08 20:04:16 -05:00
Jack Nagel
d27dc1d02f Work around encoding issue in Pathname#inspect on Ruby 2.0
Pathname#inspect on Ruby 2.0 throws away the encoding of the object's
underlying string and returns a string tagged as ASCII-8BIT.

If you simply write

  puts Pathname.new("some string with non-ascii bytes").inspect

no error will be raised, because the implementation of Pathname#inspect
does not call into Object#inspect.

However, if you wrap that pathname object in an array first, then

  puts [Pathname.new("some string with non-ascii bytes")].inspect

will raise Encoding::CompatibilityError: "inspected result must be ASCII
only or use the same encoding with default external".

Raising an error in this codepath is new in Ruby 2.0, and this specific
bug is fixed in Ruby 2.1. I've opened a bug upstream:
  https://bugs.ruby-lang.org/issues/9915

Fixes Homebrew/homebrew#29947.
2014-06-08 20:00:52 -05:00
Jack Nagel
6d0f0cb195 metafiles: simplify #copy? further 2014-06-07 23:40:28 -05:00
Jack Nagel
07257f2f48 Simplify Pathname#install_metafiles 2014-06-07 21:15:56 -05:00
Jack Nagel
fcacb25cd5 Eliminate FORMULA_META_FILES constant 2014-06-07 21:15:56 -05:00
Jack Nagel
6e616b29c5 Use a || b 2014-06-03 09:43:27 -05:00
Shaun Jackman
bd682d5519 Treat HOMEBREW_CC the same as --cc
Closes Homebrew/homebrew#29762.

Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2014-06-03 09:43:27 -05:00
Shaun Jackman
6e56009217 HOMEBREW_CC: Remove COMPILER_ALIASES
Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2014-06-03 09:43:21 -05:00
Jack Nagel
a023f10310 Use Pathname.glob when we want pathname objects 2014-05-31 23:53:51 -05:00
Jack Nagel
c90247aa44 Place X11 ahead of OpenGL when X11 is active
Fixes Homebrew/homebrew#29651.
2014-05-28 09:23:36 -05:00
Adam Vandenberg
2c61e3c02a --help and --version only apply as first argument
This fixes external commands that provide their own
help and version subcommands.

Closes Homebrew/homebrew#26755.
2014-05-27 21:03:05 -07:00
Jack Nagel
6eb220d78f Share code for sanitizing ENV between both build environments 2014-05-26 14:10:24 -05:00
Jack Nagel
d69be7f619 Add ENV.m64 to superenv 2014-05-22 09:18:34 -05:00
Jack Nagel
d61615890f Fix ENV.m32 under superenv 2014-05-22 09:18:34 -05:00
Jack Nagel
b894d6e246 Set sysroot for non-clang compilers on 10.9
Although the correct sysroot is built into Apple's tools on 10.9, we
need to continue setting it for custom compilers.
2014-05-19 14:41:03 -05:00
Jack Nagel
613292e3ce Reorganize superenv include and library path setup
I found the dual use of CMAKE_*_PATH variables to make it difficult to
reason about this code. Now a separate set of variables are used to
communicate with the cc wrapper, and less work is performed in the
wrapper itself.

We no longer pass the SDK include path as a -isystem directory on
Xcode-only setups. Doing so is redundant with `--sysroot` and has other
side effects, namely changing the include path search order, which can
break compilation of some software (e.g. qemu).

On Xcode-only 10.9, we can additionally omit `--sysroot`, as the correct
paths are built into the tools.

A new variable, HOMEBREW_SYSROOT, is used to this information to the
wrapper. It will be unset on Xcode-only 10.9. HOMEBREW_SDKROOT will
continue to be set, as it is used for other things besides setting the
include search path.
2014-05-19 14:41:02 -05:00
Jack Nagel
f6fda5651b Remove deprecated --use-{gcc,llvm,clang}
Closes Homebrew/homebrew#29380.
2014-05-19 10:37:45 -05:00
Jack Nagel
16c073a153 Remove hardcoded reference to ENV 2014-05-18 14:41:49 -05:00
Jack Nagel
930cf4c768 Add accessor for HOMEBREW_CC 2014-05-18 14:34:31 -05:00
Jack Nagel
ff9bbe941b ENV.cc= and ENV.cxx= are private 2014-05-18 14:34:31 -05:00
Jack Nagel
9e8d419070 Use a case statement 2014-05-18 14:23:45 -05:00
Jack Nagel
858da0063d Allow disabling arch flag filtering
Closes Homebrew/homebrew#17352.
2014-05-14 00:00:59 -05:00
Jack Nagel
230161c1de Use a case statement 2014-05-13 16:23:12 -05:00
Jack Nagel
cb873d0833 Check value of compiler rather than HOMEBREW_CC 2014-05-13 16:22:57 -05:00
Jack Nagel
2716ed6d26 Make cc=/cxx= set HOMEBREW_CC in superenv 2014-05-13 16:20:30 -05:00
Jack Nagel
c03483b6a8 Remove legacy ENV accessor hack 2014-05-13 12:50:30 -05:00
Jack Nagel
278d9dfdb4 self, not ENV 2014-05-13 12:48:27 -05:00
Jack Nagel
deb65a959d Use a case statement 2014-05-13 12:14:51 -05:00
Jack Nagel
002cb64774 Make sure the path arrays only contain strings 2014-05-13 12:14:51 -05:00
Jack Nagel
9fc5a543d5 No need to augment path on Xcode-only 10.9 2014-05-13 11:28:44 -05:00
Jack Nagel
43d9640cb6 Move method to prepare for future changes 2014-05-13 11:28:44 -05:00
Jack Nagel
ff25f7ecf7 Future-proof this conditional 2014-05-13 11:26:21 -05:00
Jack Nagel
ff9191eca2 clean up X11 conditionals 2014-05-12 11:45:50 -05:00
Jack Nagel
5f94742afb Ensure HOMEBREW_ARCHFLAGS is always a string 2014-05-10 16:54:30 -05:00
Jack Nagel
089af6627a Always use stub tools in /usr/bin on 10.9 2014-05-08 17:24:48 -05:00
Mike McQuaid
8c426e8207 ENV/shared: fix gcc versions edge case. 2014-05-06 22:17:59 +01:00
Mike McQuaid
2fb6d2fdbe ENV/std: use full paths to gcc versions.
This is consistent with how e.g. `gcc-4.2` is handled.

This means e.g. `ghc` can find `gcc-4.8` at runtime.

Fixes Homebrew/homebrew#28934.
2014-05-06 16:45:50 +01:00
Mike McQuaid
c92a16e2ce shared: refactor gcc_version_formula.
Avoid throwing unnecessary exceptions by checking for paths existing and
creating formulae as late as possible. Additionally use instance
variables for some caching.
2014-05-06 16:45:50 +01:00
Mike McQuaid
1b0647d747 shared: don't use Formula.factory unnecessarily.
Instead check if the path exists by using opt.
2014-05-06 16:45:50 +01:00
Jack Nagel
68da1e7765 Add a method_defined? guard for Pathname#/
This was added to the stdlib in 391fc2eeec.
2014-05-05 15:30:28 -05:00
Alexey Muranov
911206eae6 Use #+ instead of #join to define Pathname#/
See also https://bugs.ruby-lang.org/projects/ruby-trunk/repository/revisions/45826/diff/ext/pathname/lib/pathname.rb

Closes Homebrew/homebrew#28972.

Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2014-05-05 15:27:34 -05:00
Jack Nagel
61dd796f25 Suppress a warning on Ruby 2.1+ 2014-05-03 15:03:22 -05:00
Baptiste Fontaine
74e4fdfce2 Fix for String#undent
Without it, String#undent would fail on unindented strings, e.g.:

    "foo".undent

NoMethodError: undefined method `length' for nil:NilClass`

Closes Homebrew/homebrew#28873.

Signed-off-by: Adam Vandenberg <flangy@gmail.com>
2014-05-02 19:50:27 -07:00