2249 Commits

Author SHA1 Message Date
Max Howell
4feb8e1cb4 Deprecate skip_clean :all
This was mostly used to prevent stripping. Now we don't strip. Force formula to remove this setting or be more specific about folders they don't want pruned.
2012-08-29 14:45:04 -04:00
Adam Vandenberg
1eb808c109 Homebrew 0.9.3 for superenv 2012-08-29 10:08:46 -07:00
Max Howell
bdd6193587 brew sh: a shell with superenv loaded
If you need to build software on OS X by hand, a brew shell is the way to do it.

Closes Homebrew/homebrew#14381.
2012-08-29 12:41:38 -04:00
Max Howell
a360a41472 superenv only adds X11 paths if required
Since we are moving towards only depending on X11 for X-headers, superenv now doesn't automatically add X11 compilation. I was reluctant to do this, but it is the right thing to do now that X11 is not automatically installed by OS X or Xcode.

I didn't implement ENV.x11 because the order that the X headers are inserted is important. It must be done at initial setup to ensure that brewed versions of e.g. freetype and Cairo are used and not the ones installed by XQuartz.
2012-08-29 12:41:37 -04:00
Max Howell
b834027b17 Doctor suggest git clean -f if unstaged files
This is safe, I tested various scenarios, including Homebrew installed in ~. The only files that are removed are unexpected files in Homebrew's already managed directories.
2012-08-29 12:41:37 -04:00
Max Howell
7d8954d74c Warn user if they set CFLAGS, etc. with superenv
Since we remove some CFLAGS under their noses, this would otherwise be quite confusing.

Notably, this will now trigger in numerous formula. Sucks.
2012-08-29 12:41:37 -04:00
Max Howell
24bcc694e5 Speed up brew instantiation
Adding MacOS.dev_tools_path to our PATH was slow. We no longer need to do this because of the previous commit making a script wrapper for git and svn. It was slow because the function calls out to lots of slow utilities to determine this path.
2012-08-29 12:41:36 -04:00
Max Howell
672388d4f7 Always find git and svn without trying hard
Two wrapper scripts that find git and svn using the ENV variables we support and then searching through the PATH and looking inside Xcode.app if necessary.

Now just calling git or svn in Homebrew code will find and exec the right tool and we can stop fussing.

Apologies to @adamv who is probably unimpressed that the cmds directory has non-commands in it now. If it's consolation these are temporary pending some more work on superenv whereby some more directories are created under the superenv root.
2012-08-29 12:41:36 -04:00
Max Howell
0efd1b9efe Attempt to fix opt link if absent
This is mainly to prevent errors when users for the transitionary period where most installed kegs do not have an opt link.
2012-08-29 12:41:36 -04:00
Max Howell
d89b3272f4 Ensure mktemp cleans up after itself
Ignore interrupts.
2012-08-29 12:41:36 -04:00
Max Howell
336c4d1b05 If installed but not linked, say so
Rationale: if ack is unlinked but installed, typing ack does nothing, but then user tries to install and it says it is already installed. What gives? The user thinks.

Formula ending up unlinked can happen due to failures during the link phase and we recommend unlinking formula for conflicts. So common enough to justify this amendment.
2012-08-29 12:41:35 -04:00
Max Howell
20ce16a3ff Much better CTRL-C handling
Let's not show weird error messages when user interrupts during various stages of brew initialization.

Tested by doing `for x in $(brew search); do brew install $x; done` and pressing CTRL-C at random short intervals.
2012-08-29 12:41:35 -04:00
Max Howell
fb8c7e0aaf Allow eg. brew --env libxml2
Example useful usage:

    eval $(brew --env gettext) && clang -Wl,-t -lssl 2>/dev/null
2012-08-29 12:41:35 -04:00
Max Howell
4f06d131df Superenv wrapper for sed
Fixes Mountain Lion specific sed issue.

Provided scripts don't use the full-path to see we are fine. They never do though, that would assume too much.
2012-08-29 12:41:35 -04:00
Max Howell
1ec368759e Support HOMEBREW_MAKE_JOBS 2012-08-29 12:41:34 -04:00
Max Howell
36de29f65e Force --env=std for stuff using scons, etc.
Python et al, require stdenv because otherwise pip, gem, etc. don't work. Can be fixed, just I'm not doing it now.

We want a DSL to do this but I couldn't be bothered to make that work etc. I want to commit. Apologies.
2012-08-29 12:41:34 -04:00
Max Howell
65d195dcaa 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
Max Howell
57df15afd0 Use opt paths in keg-only messages 2012-08-29 12:41:34 -04:00
Max Howell
05b91e3d29 Figure out if we can cleanup keg-only kegs 2012-08-29 12:41:33 -04:00
Max Howell
f02d81ecbf Create active symlinks for installed formula
Similar to the LinkedKegs record, we write a symlink for installed kegs to PREFIX/opt.

Unlike the linked-keg record, unlinking doesn't remove the link, only uninstalling, and keg-only formula have a record too.

The reason for this addition is so that formula that depend on keg-only formula can build against the opt directory and not the cellar keg. Thus surviving upgrades.

To enforce this fix_install_names and built were adapted to use the opt path.

Standard kegs also create an opt symlink so that caveats can now refer to the opt directory and thus provide steps that survive upgrades too.

Thus the choice of /opt. It is short, neat and the right choice: POSIX dictates that opt is for stand-alone prefixes of software.
2012-08-29 12:41:33 -04:00
Max Howell
50767c6077 Record HEAD SHA and date of installs in receipt 2012-08-29 12:41:33 -04:00
Max Howell
05991dd846 Produce good error messages for bad tarballs 2012-08-29 12:41:33 -04:00
Jack Nagel
d423519766 Don't download bottles when building from source
The recent fix that prevents "-v" from triggering source downloads
exposed a different bug that allowed the build script to download the
bottled package instead of the source package; fix the logic.

Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2012-08-28 18:00:27 -05:00
Adam Vandenberg
c1220975b9 Refactor brew list 2012-08-28 10:59:46 -07:00
Adam Vandenberg
516041dba8 brew list: check for Cellar
If the Cellar doesn't exist yet, don't print an error message or exit
with an error status.

Fixes Homebrew/homebrew#14503.
2012-08-28 10:52:51 -07:00
Max Howell
396ca3fc59 Add Version.slice to compat suite
Refs Homebrew/homebrew#14299.
2012-08-28 12:11:46 -04:00
Jack Nagel
df45f8fd09 audit: Formula#deps returns Dependency objects
Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2012-08-27 22:59:29 -05:00
Max Howell
dc68752d3d Prevent CLT.version being ""
Also cache the response if N/A as it is slow to keep repeating that. And only do one pkgutil call if possible.
2012-08-27 12:57:56 -04:00
Max Howell
0509406069 Use full paths to mdfind and pkgutil 2012-08-27 12:57:56 -04:00
Jack Nagel
b8a62d98e1 audit: fix redundant version check
The == comparison was comparing the versions rather than directly
comparing the strings, which lead to false positives.

Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2012-08-27 09:44:54 -05:00
Adam Vandenberg
dfd35db4d1 Formula factory: add comment 2012-08-26 17:08:09 -07:00
Adam Vandenberg
f1d0f7adbb Formula factory: re-raise certain NameErrors.
Some name errors, such as NoMethodError, represent programming errors.
Re-raise them to get a usable error message.

Closes Homebrew/homebrew#14467.
2012-08-26 17:06:38 -07:00
Jack Nagel
757b73e9a9 Ask the user for help if MacOS.compilers_standard? fails
Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2012-08-26 13:57:23 -05:00
Adam Vandenberg
4d7069ed6f create: allow --set-name and --set-version
Closes Homebrew/homebrew#10873.
Closes Homebrew/homebrew#14401.

Signed-off-by: Adam Vandenberg <flangy@gmail.com>
2012-08-26 08:39:36 -07:00
samueljohn
537de9c046 formula_installer: make "linking" more clear
When building software "linking step did not complete" sounds
like ld failed. Let's be clear about this.

Closes Homebrew/homebrew#14407.

Signed-off-by: Adam Vandenberg <flangy@gmail.com>
2012-08-25 15:36:13 -07:00
Jack Nagel
c350fad07e tests: adjust test_bottle_spec_selection for new bottle code
Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2012-08-25 16:03:35 -05:00
Mike McQuaid
bed2fa088b Don't fail to cleanup redacted formula. 2012-08-25 13:40:05 -07:00
Mike McQuaid
67f78074f9 Miscellaneous bottle code cleanup. 2012-08-25 13:08:46 -07:00
Mike McQuaid
82d1310800 Check formula options properly to rule out bottle.
Fixes Homebrew/homebrew#14148.
2012-08-25 11:52:37 -07:00
Mike McQuaid
d5b954ebd4 Fix ARGV and bottles circular dependency. 2012-08-25 11:52:37 -07:00
Mike McQuaid
3af3bc7dd5 Rename tab 'built_bottle' to 'build_as_bottle'. 2012-08-25 11:52:37 -07:00
Mike McQuaid
ebbc3438a1 Move used_options and unused_options to ARGV. 2012-08-25 11:52:37 -07:00
Mike McQuaid
90010f4602 Fix tests and NoMethodError with no X11 installed. 2012-08-25 10:21:48 -07:00
Mike McQuaid
d9a18d4c1e erlang: fix version detection and bottles. 2012-08-25 10:21:48 -07:00
Adam Vandenberg
9e8bf8413d audit checks for passing dashes to build.include? 2012-08-25 09:37:41 -07:00
Charlie Sharpsteen
e873411694 XCodeDependency: Clarify that Xcode.app is needed
Clarify the error message arising from XCodeDependency so that users know
XCode.app is needed and that just installing the CLT does not count as
"installing XCode".
2012-08-24 19:38:03 -07:00
Jack Nagel
a4fbae274f Compact whitespace when removing flags
This prevents multiple calls to flag-modifying ENV methods from
resulting in large amounts of consecutive spaces.

Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2012-08-23 22:29:56 -05:00
Jack Nagel
f069ebd0df Version: make MacOSVersion comparison more robust
Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2012-08-23 18:16:08 -05:00
Jack Nagel
fd151f8999 factory: always check const_defined? before requiring
Specifying dependencies with a URL works, even if by accident, but
factory is called repeatedly on this URL and this results in multiple
downloads of the same file.

Fix this by checking const_defined? here too, and DRY up the code a bit.

Fixes Homebrew/homebrew#14285.

Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2012-08-23 18:13:54 -05:00
samueljohn
ad0dd3d3de Xcode-only: Clean up compiler flags. Use CPATH.
- When using CPATH, we only need -isysroot and not the other -I spam.
- LDFLAGS use -isysroot instead of -L
  Turns out that the linker also understands the
  -isysroot flag which behaves more natural (in the
  sense: "like the internal defaults `/usr/lib` etc.)
  than adding `-L$(SDKROOT).
  Especially for duplicates, the linker first searches
  through all `-L` dirs and then looks at the sysroot
  or internal defaults. This is what we want.
- Pkg-config needs CC with CFLAGS passed to configure.

Closes Homebrew/homebrew#14351.

Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2012-08-23 16:26:28 -05:00