Commit Graph
323 Commits
Author SHA1 Message Date
Jack Nagel 18ff8a67fb Fix Regexp encoding under 1.9/2.0 2013-02-10 15:26:07 -06:00
Jack Nagel 37f198542d Move ruby methods to FileUtils extension 2013-02-02 11:24:55 -06:00
Mike McQuaid 1da2d5dd92 Remove MD5 support.
Closes #17317.
2013-01-30 22:36:12 -08:00
Mike McQuaid 3318b08a2e Don't use underscores in (new) bottle filenames.
Closes #14270
2013-01-29 17:14:09 -08:00
Mike McQuaid e9eac42daa Cleanup old bottle syntax. 2013-01-29 17:14:00 -08:00
Jack Nagel 8d0c65e47b Move option comparison into BuildOptions 2013-01-26 11:37:00 -06:00
Jack Nagel 8bb496febf Object#instance_exec for Ruby 1.8.6
Not thread safe! But I don't think we care.

We want to evaluate the env DSL block in the context of ENV for asthetic
reasons, but we also want access to methods on the requirement instance.
We can use #instance_exec to pass the requirement itself into the block:

  class Foo < Requirement
    env do |req|
      append 'PATH', req.some_path
    end

    def some_path
      which 'something'
    end
  end

Also add a simplified version of Object#instance_exec for Ruby 1.8.6.
2013-01-21 17:24:11 -06:00
Jack Nagel 3270fd2cd9 ENV.with_build_environment 2013-01-21 17:24:10 -06:00
Jack Nagel b2d94692f6 Restore ARGV even if an exception is raised 2013-01-10 15:57:21 -06:00
Jack Nagel 67e8b5e215 Define Symbol#to_proc for Ruby 1.8.6
Ruby 1.8.6 doesn't have Symbol#to_proc, which allows things like
map(&:to_s) rather than map { |o| o.to_s }. 1.8.7 does, though, and
since it is used in a bunch of the superenv code we should attempt to
keep it compatible with 1.8.6.

Closes #16046.
2013-01-09 17:36:17 -06:00
Adam Vandenberg 34f5995e24 Only add -F if the frameworks folder exists
Closes #16901.
2013-01-04 21:30:10 -08:00
Mike McQuaid 2491b33a06 Add --homebrew-developer flag 2013-01-01 16:39:06 +00:00
Jack Nagel bb03a39ad8 Allow requirements to specify env options 2012-12-26 14:37:03 -06:00
Shaun Jackman 47bde804c5 pathname.rb: Pass -s to du instead of -d0
The option `du -s` is equivalent to `du -d0`. The former is a POSIX standard
(IEEE Std 1003.1-2008), whereas the latter is a BSD extension.

From the BSD man page:
`-s Display an entry for each specified file. (Equivalent to -d 0)`

From SUSv4:
`-s Instead of the default output, report only the total sum for each of the specified files.`
http://pubs.opengroup.org/onlinepubs/9699919799/utilities/du.html

Closes #16516.

Signed-off-by: Charlie Sharpsteen <source@sharpsteen.net>
2012-12-11 09:32:16 -08:00
Mike McQuaid b30390f1e4 Improve bottle error messages.
On installation or creation of a bottle error out of the current
machine does not support bottles.

References #16291.
2012-12-04 12:06:02 +00:00
Jack Nagel a5a530573a Rewrite plists when installing from a bottle 2012-11-25 15:11:57 -06:00
Mike McQuaid a1cdf9f64d Overwrite plists. 2012-11-25 20:53:04 +00:00
Camillo Lugaresi e0d0ae92d5 separate ENV/pkgconfig dirs by OS version
Closes #16063.

Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2012-11-19 22:04:04 -06:00
Camillo Lugaresi bfc71f6450 add necessary .pc files for Leopard
add missing libcrypto.pc
override broken system libcurl.pc

Closes #16063.

Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2012-11-19 22:03:00 -06:00
Adam Vandenberg 1184584bc2 Try to remove a single .DS_Store when uninstalling
Closes #12976.
Closes #15975.
2012-11-14 15:10:08 -08:00
Charlie Sharpsteen 0794c8e8fd ENV.rb: Configure Objective-C++ compiler
Ensures the `OBJCXX` environment variable is correctly set. Also adds `OBJC`
and `OBJCXX` to `ENV.remove_cc_etc`.
2012-11-13 20:54:33 -08:00
Adam Vandenberg 3cfe157b06 Don't error out if metafiles are linked
Closes #16008.
2012-11-12 20:56:05 -08:00
Adam Vandenberg e7f2e449e7 Teach Pathname how to scan for metafiles 2012-11-11 10:45:58 -08:00
Adam Vandenberg 95411a80aa Move vendored .pc files to ENV
Closes #15961.
2012-11-11 09:55:12 -08:00
Jack Nagel fdab0f48fd Inject framework paths into stdenv compiler flags 2012-11-06 12:32:10 -06:00
Sijawusz Pur Rahnama 38f121bd68 Add support for 7zip archives
Closes #15723.

Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2012-10-29 14:57:23 -05:00
Adam Vandenberg b40e5323ca Pathname: add exec and jar helpers
Closes #13318.
2012-10-27 19:28:42 -07:00
Jack Nagel 6ec361aa12 ComparableSet#merge returns self
Set#merge is supposed to return self, and Formula#recursive_requirements
depended on this being true.

Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2012-10-25 15:54:55 -05:00
Jack Nagel b95bcd65cd Return the block value in ARGV.filter_for_dependencies
Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2012-10-24 17:54:16 -05:00
Misty De Meo f52ebe5fc7 brew ln --force is now brew ln --overwrite
* Renames --force to --overwrite, freeing up brew ln --force for #13349
* Changes --dry-run to preview linking by default, rather than
  overwriting. An overwrite dry-run can be simulated via both
  --dry-run --overwrite
* Adds some basic Keg tests
2012-10-20 21:00:46 -05:00
Misty De Meo 71ef411c22 Manage Requirements using ComparableSet
ComparableSet only allows a single object of a given class,
choosing the object with the greatest value. This was mainly created
for Requirements, so that, e.g., two X11Dependencies of differing
strictness don't both end up in the same requirement set.

Fixes #15240.
2012-10-15 09:46:29 -05:00
Misty De Meo f899878220 Don't count mkpath in ObserverPathnameExtension
mkpathed directories aren't really "linked" or "unlinked" per se,
and link/unlink handle directories differently. It's easier just to
ignore them, which finally synchronizes link/unlink counts.
2012-10-04 21:37:37 -05:00
Mike McQuaid a32ecf4cb3 Don't use bottles for HEAD, devel or universal. 2012-09-30 22:26:33 +01:00
Max Howell c29311a23c Fix ENV.fortran info texts
They were being truncated.
2012-09-28 17:14:56 -04:00
Jack Nagel 71dbaaae1b Improve text_executable heuristic
Previously we detected this by reading the first line of the file.
However, "first line" is meaningless when dealing with binary files, but
IO#readline will happily keep reading until it finds a newline
character, which can result in some unnecessarily large buffers.

Aside from the performance issue, this causes an additional problem
under Ruby 1.9: trying to match the binary string against a pattern will
raise ArgumentError (unless the binary string just happens to also be
valid UTF-8, heh).

Fix both issues: only read the first 1024 bytes, as no sane shebang will
ever be that long, and use a plain read(), which returns an ASCII
encoded string even on 1.9.

Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2012-09-27 17:26:26 -05:00
Misty De Meo f94f56239a FileUtils: backport #copy_metadata fix
Entry_#copy_metadata has a nasty bug that makes copying symlinks
across filesystems fail. This lasted all the way through 1.9.3p194
before *finally* being fixed. This backports the official fix.

Fixes #14710.
2012-09-27 09:52:06 -05:00
Misty De Meo 7d15eda4a4 stdenv: stop setting LD
superenv stopped setting LD in
8e4c0a1411, seems sensible to follow
suit in stdenv too.

See #14943.

Fixes #15090.
2012-09-26 13:22:30 -05:00
Max Howell 4a554dd5b2 ENV.fortran adds back superenv removed PATHs
Fixes #15103.
2012-09-25 12:04:42 -04:00
Max Howell 1fc68c62d8 Clean up and improve build-error output and logs
All logs are now stored from each command executed in Formula.install.

Error output is truncated to five lines in an attempt to not overwhelm the user and to encourage users to read the error output and report the bug properly. Maybe we can get that figure up from 70% to 90%.
2012-09-25 11:31:56 -04:00
Mike McQuaid e87e8a1d9a Fix building bottles from source. 2012-09-18 20:05:03 +01:00
Misty De Meo b29d1fdd5f ARGV: add .json
Used by brew info; may be used by other commands in the future.
2012-09-17 19:06:40 -05:00
Jack Nagel 9783ce476c ENV: put X11 aclocal dir in ACLOCAL_PATH when appropriate
Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2012-09-05 19:49:50 -05:00
Jack Nagel 93a4c48e36 Sort out remaining XQuartz/stdenv issues
We use PKG_CONFIG_LIBDIR to reset the default search path, overriding
whatever is baked into the pkg-config executable. This way, we can later
append XQuartz paths here while still allowing any brewed libs to take
precedence, keg-only or not.

Hopefully this will resolve any remaining issues, and let us get rid of
some per-formula hacks.

c.f. #14474.

Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2012-09-03 22:39:38 -05:00
Jack Nagel fb93fb2b2e ENV: update comment
Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2012-09-03 22:38:05 -05:00
Jack Nagel c985c6c057 Stop warning in ENV.x11
It has been long enough since `depends_on :x11` was introduced that we
can make it the caller's responsibility to ensure X11 is present before
invoking ENV.x11, so stop outputting a warning.

Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2012-09-03 21:04:49 -05:00
Max Howell 28d795032a Don't catch build errors 2012-08-29 22:25:29 -04:00
Max Howell 744031b4af Block form of chdir can only be used once
If you nest them, the library complains. So let's not do that.

/cc @jacknagel
2012-08-29 19:49:11 -04:00
Max Howell 6c21f8dc16 Use fortran from std-env in superenv
Fixes #14524.
2012-08-29 14:45:04 -04:00
Max Howell 1392cd40f8 Ensure mktemp cleans up after itself
Ignore interrupts.
2012-08-29 12:41:36 -04:00
Max Howell 59736fb537 superenv: build-environments that just work
1. A minimal build environment, we don't set CFLAGS, CPPFLAGS, LDFLAGS, etc. the rationale being, the less that is set, the less variables we are introducing that can break builds.
2. A set of scripts that replace cc, ld, etc. and inject the -I, -L, etc. flags we need into the args passed to the build-tools.

Because we now have complete control over compiler instantiations we do a variety of clean-up tasks, like removing bad flags, enforcing universal builds and ensuring makefiles don't try to change the order of library and include paths from ones that work to ones that don't.

The previous ENV-system is still available when --env=std is specified.

superenv applies to Xcode >= 4.3 only currently.
2012-08-29 12:41:34 -04:00