140 Commits

Author SHA1 Message Date
Markus Reiter
175ca909ee Clean up code style and remove .rubocop_todo.yml. 2017-10-08 16:10:37 +02:00
Andrew Yates
980db9d3fb Remove errant pkg-config libdir
We found an issue in Linuxbrew/homebrew-core#3366 where the addition of "/usr/lib/pkg-config" causes compilation issues if system pkg-config files are in that directory on Linux. Removing the line from here and adding it into the mac superenv.
2017-08-03 10:44:56 +01:00
Mike McQuaid
7a0aff1080 Autocorrect Rubocop Style/PerlBackrefs. 2017-06-10 20:23:20 +03:00
Markus Reiter
4d5d6a65e3 Rename PATH#validate to PATH#existing. 2017-04-30 21:11:28 +02:00
Markus Reiter
f8ad9d7efd Use PATH where possible. 2017-04-30 21:11:27 +02:00
Markus Reiter
314483f75c Remove Array#to_path_s. 2017-04-30 21:11:27 +02:00
Markus Reiter
3e4fe279b0 Use to_path_s for determine_pkg_config_libdir. 2017-04-30 21:11:27 +02:00
Mike McQuaid
64e2e6e862 super: re-add set_cpu_flags.
It's used by ENV.fortran.

Fixes https://github.com/Homebrew/brew/issues/2530
Fixes https://github.com/Homebrew/homebrew-science/issues/5485
2017-04-22 21:56:32 +01:00
Mike McQuaid
ba3c46d24f More deprecations.
Deprecate more methods. Internal APIs have been verified to be unused
elsewhere and removed. External APIs have had deprecation methods added.
Existing deprecations have been either upgraded to produce warnings or
no longer deprecated and the reasoning documented.
2017-04-22 16:28:07 +01:00
Shaun Jackman
31e5ed28d1 determine_path: Fix tests FormulaUnavailableError
Fix the brew tests error:
InstallTests#test_a_basic_install:
FormulaUnavailableError: No available formula with the name "gcc"
Library/Homebrew/formulary.rb:231:in `get_formula'
Library/Homebrew/formulary.rb:259:in `factory'
Library/Homebrew/extend/ENV/shared.rb:287:in `gcc_version_formula'
Library/Homebrew/extend/ENV/super.rb:124:in `determine_path'
Library/Homebrew/extend/ENV/super.rb:44:in `setup_build_environment'
Library/Homebrew/build.rb:87:in `install'
Library/Homebrew/build.rb:201:in `<main>'
2017-03-07 09:03:33 -08:00
Alyssa Ross
9e97eadccb rubocop: trailing comma in multiline method calls
Discussed in
https://github.com/Homebrew/brew/pull/1987/files#r100693581.

This was originally ommitted because it wasn't compatible with Ruby 1.8.
(See https://github.com/Homebrew/legacy-homebrew/pull/48144#r49928971).
2017-02-12 15:11:38 +00:00
Mike McQuaid
f0fbcf5022 ENV/super: fix set_cpu_flags stub.
It should accept arguments.

Fixes https://github.com/Homebrew/homebrew-core/issues/8362
2016-12-31 22:44:05 +00:00
Mike McQuaid
e50102d91e ENV: deprecate old methods.
These should have been deprecated long ago but we didn’t really have
the necessary framework to do so.
2016-12-30 20:20:13 +00:00
Mike McQuaid
1f963267b6 Update Rubocop style.
Another look at the current Rubocop rules and how they fit with our
existing and desired future style. Almost all of these changes were
automatic. Split some rules between formulae/brew where brew doesn't
have millions of cases that need fixed.
2016-10-22 13:32:46 +01:00
Markus Reiter
58e36c7319 Fix Style/GuardClause. 2016-09-24 12:24:35 +02:00
Markus Reiter
e851c9bf6c Style/Alias: Prefer alias. 2016-09-23 18:19:53 +02:00
Markus Reiter
fe2d51e0b9 Fix Style/IfUnlessModifier. 2016-09-23 15:30:07 +02:00
Mike McQuaid
fb3bec8d70 extend/ENV/super: fix Rubocop warnings. 2016-09-13 07:57:06 +01:00
Tim D. Smith
764390aadd Document 'w' CCCFG flag 2016-08-17 23:02:38 -07:00
Xu Cheng
c8d814f907
ENV/super: use Hardware::CPU.is_32_bit?
`Hardware.is_32_bit?` is deprecated.
2016-08-17 22:13:30 +08:00
Mike McQuaid
2e747aa910 super: remove effective_sysroot.
No longer needed in `super.rb` after it was moved to `os/mac`.
2016-07-15 08:10:25 +01:00
Dominyk Tiller
91af4aa0fe
super: migrate xml2 cmake to mac/super
Looks like it was accidentally left behind (?)
2016-07-15 05:23:28 +01:00
Dominyk Tiller
bd4e24ae8f
superenv: restore HOMEBREW_PREFIX/lib 2016-07-13 01:18:42 +01:00
Mike McQuaid
0d189fae57 superenv: port to generic OS. (#457) 2016-07-12 12:01:20 +01:00
Mike McQuaid
3a127e405e development_tools: add installed? method. (#455) 2016-07-06 11:07:24 +01: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
Andrew Janke
36b2af2e0f superenv: fix formula prefix path to consider revisions
Old logic doesn't include revision. This fixes that, and passes the
whole formula prefix path to avoid duplicating the path-construction
logic.

Closes #80.

Signed-off-by: Andrew Janke <andrew@apjanke.net>
2016-04-13 10:41:01 -04:00
Andrew Janke
a8ed06ba74 superenv: allow paths under self's keg
Fixes build error in Homebrew/homebrew-core#100.

Closes #63.

Signed-off-by: Andrew Janke <andrew@apjanke.net>
2016-04-13 02:20:17 -04:00
Misty De Meo
4fd5c5c159 superenv: filter -I/-L paths on dependencies
Previously, superenv did not try to filter -I or -L flags
based on the list of requested dependencies; as a result, buildsystems
which opportunistically discover Homebrew-installed libraries were able
to link against them even under superenv.

This adds a list of all requested dependencies to the superenv environment,
and compares all -I and -L flags against those; any Cellar and opt paths
found which resolve to unrequested dependencies are filtered out.
2016-04-04 15:30:22 -07:00
ilovezfs
45e138ffc6 Xcode 7 MACOSX_DEPLOYMENT_TARGET and SDK fixes
SDK 10.10 isn't something that exists for Xcode 7, so stop looking for
it and rely on MACOSX_DEPLOYMENT_TARGET instead.

See PR Homebrew/homebrew#50137 Yosemite build failure

Closes Homebrew/homebrew#50355.

Signed-off-by: ilovezfs <ilovezfs@icloud.com>
2016-03-31 13:16:50 +08:00
Xu Cheng
ce7b32cec8 add HOMEBREW_ENV_PATH internal variable
`Library/ENV` like `Library/Homebrew` is part of Homebrew basecode. It
should be able to be accessed during the `brew tests`.

By adding HOMEBREW_ENV_PATH variable, we allow test suit to locate these
codes.
2016-03-21 19:07:38 +08:00
Tim D. Smith
fe37cc5271 Revert "Avoid constructing paths by string interpolation"
This reverts commit 8c7f3d859e8f715b6c63e4fe75e7a636aee4167f.
2016-03-19 19:14:50 +08:00
Tim D. Smith
87781f2a37 Avoid constructing paths by string interpolation
Closes Homebrew/homebrew#50154.
2016-03-19 19:14:50 +08:00
ilovezfs
1e1184fc2d superenv: fix make_jobs regular expression
HOMEBREW_MAKE_JOBS can be a multidigit number. The regex should match
the entire number not just the last digit.

Closes Homebrew/homebrew#50016.

Signed-off-by: Tim D. Smith <git@tim-smith.us>
2016-03-13 14:32:05 +08: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
Misty De Meo
5ecf3113a8 superenv: set SDKROOT, MACOSX_DEPLOYMENT_TARGET 2015-12-07 13:17:43 -08:00
Xu Cheng
06806f860d remove unnecessary require statements 2015-10-18 22:57:42 +08: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
Misty De Meo
727239e12f Merge bottle install without Xcode branch
Merge branch 'bottle_hooks'
2015-08-21 11:04:22 -07:00
William Woodruff
1face808f5 Add guards to calls that would trigger Xcode install requests
add guard in Formula#file_modified? to prevent git popup

add guard in Superenv.bin before calling MacOS::Xcode.version

add guard against missing Xcode/CLT in Xcode.uncached_version

return nil instread of 0 in uncached_version when Xcode/CLT are not present, to distinguish from linuxbrew behavior

checks against pour_bottle? and needs_relocation?, add guard around keg.relocate_install_names to check pour_bottle?/needs_relocation? as well

needs_relocation? becomes skip_relocation?, use cellar attr to indicate relocation instead of does_not_need_relocation

MacOS.can_build? becomes MacOS.has_apple_developer_tools?
2015-08-21 11:02:33 -07:00
Tim D. Smith
6606c7b53b Revert "work around missing __debug header in Xcode CLT 6.3"
Ding, dong, the witch is dead...

This reverts commit fd5ca9ba16f5afc181364369210cb94e997a5a5e.

Ref Homebrew/homebrew#38514, Homebrew/homebrew#38735.

Closes Homebrew/homebrew#41843.
2015-08-15 20:24:20 -07:00
Xu Cheng
b121e5fd7b more core file style updated by rubocop 2015-08-06 17:23:56 +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
1bba5fd88a Pass full match to warn_about_non_apple_gcc 2015-06-21 21:18:23 -04:00
Jack Nagel
7edf3c88f6 Pass formula objects, not strings, into the build environment 2015-06-18 23:13:48 -04:00
Jack Nagel
aad4ed7faa Undocument return value of ENV.deparallelize
It's not clear whether it returns MAKEFLAGS with or without -j<n>, and
neither is particularly useful behavior, given you can easily get the
exact value by calling ENV["MAKEFLAGS"]. So let's not commit to this
API.
2015-06-12 20:14:07 -04:00
Ryan Hendrickson
798711cade Use canonical representation of the superenv bin directory
The xcrun script should be skipping the ENV directory when it scans
$PATH looking for tools to run. Unfortunately, the script compares the
paths found to the real path of the ENV directory (following symlinks),
but superenv was adding the nominal path to $PATH, not following
symlinks. As a consequence, platforms with Xcode < 4.3 would get into
infinite loops when trying to call non-system versions of gcc, as xcrun
calls the ENV version of gcc-X.X which calls xcrun and so on forever.

This commit changes superenv to follow symlinks when determining the bin
path to use.

Fixes Homebrew/homebrew#33731.
Closes Homebrew/homebrew#40062.

Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2015-05-25 22:01:12 -04:00
なつき
3649b31765 ENV: Add gcc-5 to compilers support C++11
Closes Homebrew/homebrew#39758.

Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2015-05-16 11:16:55 -04:00
Misty De Meo
f5d6d80d5b ENV.deparallelize: add block form for temporary change
Closes Homebrew/homebrew#39026.
2015-04-25 12:45:31 -07:00