100 Commits

Author SHA1 Message Date
Markus Reiter
9bee9ca575 Use “squiggly” heredocs. 2017-10-18 14:39:09 +02:00
Dominyk Tiller
0cb6307f2d
ENV: move java_cache to compat for future hard deprecation 2017-08-31 21:04:42 +01:00
Markus Reiter
24f48ae7d9 Use PATH#select. 2017-04-30 21:11:28 +02:00
Markus Reiter
f8ad9d7efd Use PATH where possible. 2017-04-30 21:11:27 +02:00
ilovezfs
76db07e1b5 env: make prepend_path ignore system paths
`ENV.prepend_path "PATH", which("emacs").dirname` in the emacs
requirement was causing us to end up invoking /usr/bin/clang instead
of /usr/local/Homebrew/Library/Homebrew/shims/super/clang.
2017-03-11 01:59:50 -08:00
Shaun Jackman
fd343a11fb gcc_version_formula: Use gcc@4.x rather than gcc4x 2017-02-11 22:37:01 -08:00
Mike McQuaid
6040456ea9 Unset GREP_OPTIONS.
Users may have this set, breaking grep's output.

Fixes #1430.
2017-01-16 20:35:56 +00:00
Markus Reiter
59e2d67721 No if/unless-modifier on multiline blocks. 2016-11-13 23:37:40 +01:00
Markus Reiter
58e36c7319 Fix Style/GuardClause. 2016-09-24 12:24:35 +02:00
Mike McQuaid
fe661a809c extend/ENV/shared: fix Rubocop warnings. 2016-09-13 07:57:02 +01:00
Mike McQuaid
602fb0e575 Make -no_weak_imports opt-in.
The experiment to add `-no_weak_imports` unconditionally has been a bit
of a failure. It's broken more than it's fixed and I don't think we can
have this as a default for Xcode 8.

Add `ENV.no_weak_imports` to be used by formulae authors and make
`ENV.no_weak_imports a no-op (for now).

We may reconsider this behaviour in future.
2016-08-22 10:39:38 +01:00
Tim D. Smith
9c7f24b84a Add permit_weak_imports directive
Issue Homebrew/homebrew-core#3727 suggested we set -no_weak_imports for
new versions of Xcode to ensure that e.g. building on 10.11 against the
10.12 SDK doesn't result in a situation where autotools thinks symbols
exist that don't actually exist on the current platform.

Further discussion in golang/go#16770 revealed that some packages
require weak imports to build normally.
2016-08-17 23:02:44 -07:00
Mike McQuaid
74d4479246 Add OS X-specific SharedEnvExtension. 2016-08-16 15:26:28 +01:00
Mike McQuaid
164e46a729 Add missing development_tools requires. 2016-07-29 21:21:02 -06:00
Vlad Shablinsky
3fb5d70a72
Unify Version.create usage
Substitue each Version.new and HeadVersion.new with Version.create
to unify Version and HeadVersion instantiation among core code.

Note that this does not relate to Mac::OS::Version class.
2016-07-16 20:39:13 +08:00
msbit
01e8e180a8 ENV: mark gcc-6 as supporting C++11 (#349)
Add SharedEnvExtension#gcc_with_cxx11_support? to centralise the
logic for checking whether a compiler is known to support C++11.

Update logic to accept GCC 4.8 and above (including 6). Thereby also
address oversight in #163 where support for GCC 6 was added without
updating the C++11 compiler whitelist.

Add tests for Superenv#cxx11.

Closes #346.
2016-06-16 14:15:28 +02:00
Mike McQuaid
e316cc9296 Make development tools code cross-platform. 2016-05-08 16:51:22 +01:00
Dominyk Tiller
bfbdfe8d9d env/shared: ignore perl opts
In theory, letting these be set once wasn't an awful idea because it allows
users choice on where Perl modules end up.

In reality, as we've moved closer to sandboxing and at the same time accepted more
perl binding options into formulae it has been exposed as something of a hellraiser.

It's not that uncommon for Perl users to set a custom `INSTALL_BASE` in the ENV which
means we end up with quite a few formula that fail hard with this sort of error:

```
Only one of PREFIX or INSTALL_BASE can be given. Not both.
```

The other common error, which we discovered via sandboxing, is that the Perl modules
end up outside Homebrew's control which means we don't automatically remove them
when the package is removed. Sandboxing blocks this, which means when we eventually
move to enable that by default for users as well as CI it'll quickly become a
prominent issue.
2016-02-20 19:30:31 +00:00
Martin Afanasjew
8e4fad8969 ENV: avoid misleading Fortran setup warnings
Fixes Homebrew/homebrew#31156.
Closes Homebrew/homebrew#47246.

Signed-off-by: Martin Afanasjew <martin@afanasjew.de>
2015-12-23 06:54:04 +01:00
Dominyk Tiller
b331e03c39 env: add java_cache env 2015-12-18 23:32:56 +00:00
Ryan Hendrickson
8ce81af67a ENV: warn_if_universal_binaries_not_supported
Raise an error when attempting to create universal binaries with a GCC
that can't do so.

Closes Homebrew/homebrew#46630.

Signed-off-by: Baptiste Fontaine <batifon@yahoo.fr>
2015-12-10 11:23:11 +01:00
Xu Cheng
767d961824 ENV#userpaths!: ensure Superenv.bin and opt path come at first
This ensures that binaries in /usr/local/bin would not overwrite
superenv.

Closes Homebrew/homebrew#44376.

Signed-off-by: Xu Cheng <xucheng@me.com>
2015-09-28 21:47:04 +08:00
Misty De Meo
3bc2ff8e20 Accept "gcc" for --cc=gcc-5 even if not installed 2015-09-12 11:47:14 -07:00
Mike McQuaid
2c959a7d58 More API documentation.
And remove the documented stuff from the `example-formula.rb`.

Closes Homebrew/homebrew#43241.

Signed-off-by: Mike McQuaid <mike@mikemcquaid.com>
2015-08-29 15:43:16 +01:00
Xu Cheng
ae0e270727 favor flat_map over map...flatten 2015-08-06 22:33:46 +08:00
BrewTestBot
13d544e11e Core files style updates.
Closes Homebrew/homebrew#42354.

Signed-off-by: Mike McQuaid <mike@mikemcquaid.com>
2015-08-03 13:22:35 +01:00
Jack Nagel
5e7edbbd3c Ask the exception for the formula name 2015-06-22 21:08:27 -04:00
Jack Nagel
87e7735012 Ask the formula object for the opt path 2015-06-22 21:00:40 -04:00
Jack Nagel
f1bf81dd55 Simplify gcc_version_formula 2015-06-21 21:18:24 -04:00
Jack Nagel
1ce04786d6 Inline variable 2015-06-21 21:18:24 -04:00
Jack Nagel
3f11f1a0de Eliminate special case for core gcc 2015-06-21 21:18:24 -04:00
Jack Nagel
2db59be452 Less code in begin/rescue block 2015-06-21 21:18:23 -04:00
Jack Nagel
1bba5fd88a Pass full match to warn_about_non_apple_gcc 2015-06-21 21:18:23 -04:00
Jack Nagel
09f8c54f83 Move some constants from env to compiler constants 2015-06-19 21:38:39 -04:00
Jack Nagel
bf4dc7449b Clear GOPATH and GOROOT in build environment
Fixes Homebrew/homebrew#37936.
2015-05-14 20:04:45 -04:00
なつき
6181a786c0 compilers: support gcc 5
Closes Homebrew/homebrew#39470.

Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2015-05-08 22:23:30 -04:00
Viktor Szakats
fc2818b7a5 Use more https in urls and updated some lost links
Closes Homebrew/homebrew#35531.

Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2015-01-04 02:13:16 -05:00
Jack Nagel
6096ec9568 Unset LIBRARY_PATH before builds
See https://gcc.gnu.org/onlinedocs/gcc/Environment-Variables.html

Closes Homebrew/homebrew-versions#592.
2014-12-17 14:40:05 -05:00
Jack Nagel
662f887e9a Call reset in the superclass implementation of setup_build_environment 2014-09-18 16:44:20 -05:00
Jack Nagel
c5f2f6b539 Make --cc override the compiler selector 2014-09-18 15:50:54 -05:00
Jack Nagel
04dae13ae7 Replace CompilerQueue with predetermined priority lists 2014-09-18 15:50:54 -05:00
Jack Nagel
ae88549797 Remove fails_with? from the formula instance 2014-09-18 15:50:54 -05:00
Jack Nagel
b544f3e5f1 Clear GOBIN in environment setup
Closes Homebrew/homebrew#32014.
2014-09-07 18:39:00 -05:00
Jack Nagel
5a2ae61e66 Add another TODO 2014-08-03 15:28:51 -05:00
Jack Nagel
fded4d0385 Remove an is_a check 2014-08-03 10:47:47 -05:00
Jack Nagel
a5895ad1fe Check nil? || empty? instead of to_s.empty? 2014-07-18 11:43:37 -05:00
Jack Nagel
3439703c65 Drop pointless to_s call 2014-07-18 11:43:37 -05:00
Jack Nagel
fe0c018a1a No need to cache lookup that is only done once 2014-07-13 10:50:56 -05:00
Jack Nagel
32d84377d5 Move constants so we don't have to load all of ENV to get them 2014-07-02 21:58:43 -05:00
Jack Nagel
20d544085a Use a more descriptive variable name 2014-06-22 18:43:14 -05:00