278 Commits

Author SHA1 Message Date
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
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
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
498e81c9fc stdenv: port to generic OS. (#456) 2016-07-12 11:39:39 +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
375efe0945 Remove LLVM-GCC support. (#252)
At this point it's never a good compiler to use so let's just remove it.
2016-05-22 09:40:08 +01:00
Mike McQuaid
e316cc9296 Make development tools code cross-platform. 2016-05-08 16:51:22 +01:00
Misty De Meo
da643d942e Explicitly list -arch in LDFLAGS on Leopard 2016-04-22 22:37:21 -07:00
Misty De Meo
967fa41e41 Set -faltivec in CFLAGS on Tiger
Setting -mcpu and -mtune on Tiger with gcc-4.2 exposes a bug in one of the
system headers, causing certain builds to fail. This can be fixed by
adding -faltivec to CFLAGS.

See: http://trac.macports.org/ticket/34213
2016-04-22 22:37:21 -07:00
Misty De Meo
35385e8c59 stdenv: stop setting ACLOCAL_PATH 2016-04-21 09:36:30 -07: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
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
Misty De Meo
5ecf3113a8 superenv: set SDKROOT, MACOSX_DEPLOYMENT_TARGET 2015-12-07 13:17:43 -08:00
Xu Cheng
3a68b915eb Stdenv: add note on possible future deprecation
Closes Homebrew/homebrew#46043.

Signed-off-by: Xu Cheng <xucheng@me.com>
2015-11-17 18:52:00 +08:00
Xu Cheng
baf3ca09b2 Stdenv should be tagged as private rather deprecated 2015-11-17 18:52:00 +08:00
Xu Cheng
06806f860d remove unnecessary require statements 2015-10-18 22:57:42 +08: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
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
ae0e270727 favor flat_map over map...flatten 2015-08-06 22:33:46 +08: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
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
7edf3c88f6 Pass formula objects, not strings, into the build environment 2015-06-18 23:13:48 -04:00