When the first error pipe object is finalized, the underlying file
descriptor is closed, breaking the pipe between the build script and the
main Homebrew process. Keep a reference to this object so it isn't
closed.
Signed-off-by: Jack Nagel <jacknagel@gmail.com>
In 1.8, Pathname.find would work (and do nothing) if the
source path didn't exist. In 1.9 this throws an exception
instead, so check whether the file exists before trying.
Pathname is one of the basic building block classes in Homebrew, and as
such it is preferrable that `require`ing it does not drag in other
Homebrew code; thus avoiding circular dependency situations. Its
dependency on bottles.rb gave it an implicit dependency on formula.rb,
among other things.
Signed-off-by: Jack Nagel <jacknagel@gmail.com>
Tools like `brew create` need to create and manipulate SoftwareSpec
objects. It is useful to be able to do this directly, rather than by
proxy through the special methods that serve the main formula DSL.
Signed-off-by: Jack Nagel <jacknagel@gmail.com>
Now that a URL, version, and the (for lack of a better term) "specs"
associated with said URL (e.g. the VCS revision, or a download strategy
hint) are neatly bundled up in a SoftwareSpec object, it doesn't make
sense to pass them individually to download strategy constructors. These
constructors now take only the formula name and a SoftwareSpec as
parameters.
This allows us to move mirror handling out out of Formula#fetch and into
the download strategies themselves. While doing so, we adjust the mirror
implementation a bit; mirrors now assume the same "specs" as their
owner's URL. They are still only useable by the CurlDownloadStrategy,
but this provides a basis for extending mirror support to other
strategies.
Signed-off-by: Jack Nagel <jacknagel@gmail.com>
IO#popen is called for each call to Hardware.is_64_bit?; this becomes
costly when it is repeatedly invoked. Luckily it is an invariant, so we
can store it in a class variable.
False is a valid value for this method, so the usual ||= idiom is not
applicable.
Signed-off-by: Jack Nagel <jacknagel@gmail.com>
- pkg-config no longer defaults to checking /usr/X11/lib/pkgconfig;
instead this path is added via ENV.x11 or depends_on :x11. Formulae
that expect X11 libs should be explicitly marked as depends_on :x11.
- Remove warning about /usr/X11 as a symlink.
Signed-off-by: Jack Nagel <jacknagel@gmail.com>
Shortened the part about the CLT-only systems, because this message is
never shown to them.
ClosesHomebrew/homebrew#13061.
Signed-off-by: Jack Nagel <jacknagel@gmail.com>
- Make ORIGINAL_PATHS an array of Pathnames instead of strings
- Append the dev tools path once in global.rb instead of build.rb
ClosesHomebrew/homebrew#13075.
Signed-off-by: Jack Nagel <jacknagel@gmail.com>