`needs` allows formulae to specify dependencies on cross-compiler
dependencies, allowing multiple failures to be specified in a single
statement. For instance, `needs :cxx11` adds seven compiler failures.
ClosesHomebrew/homebrew#22912.
Symlinks in opt and LinkedKegs point directly at a keg in the cellar, so
only resolving one symlink should suffice, and make it clear what path
we are actually interested in.
This commit introduces a new patch implementation that supports
checksums and caching.
Patches are declared in blocks:
patch do
url ...
sha1 ...
end
A strip level of -p1 is assumed. It can be overridden using a symbol
argument:
patch :p0 do
url ...
sha1 ...
end
Patches can be declared in stable, devel, and head blocks. This form is
preferred over using conditionals.
stable do
# ...
patch do
url ...
sha1 ...
end
end
Embedded (__END__) patches are declared like so:
patch :DATA
patch :p0, :DATA
Patches can also be embedded by passing a string. This makes it possible
to provide multiple embedded patches while making only some of them
conditional.
patch :p0, "..."
In order to allow kegs built with the same version but differing formula
revisions to coexist, we must encode the revision as part of the keg's
name. This is necessary to actually perform an upgrade, as we cannot
upgrade a keg in-place, and temporarily moving it pending the result of
the upgrade is error-prone and potentially slow.
To accomplish this, we introduce a new Formula#pkg_version method that
concatenates the active_spec version with the formula revision. An
exception is made for a formula that has no revision: the tag is
omitted. This preserves compatibility with existing installations.
It is useful to be able to prompt upgrades in response to events other
than a version update; for example, when a dependency is updated and its
library version changes, dependents need to be rebuilt to link against
the new library.
Currently we cannot do this automatically, which means a flood of
tickets whenever the library version of a popular library changes.
To address this, we need to track an additional piece of metadata, the
"revision" of the formula, which can be incremented when appropriate to
prompt an upgrade. It can then be reset to zero when the next version
change occurs.
The new xcodebuild method calls system "xcodebuild" underneath, so this
notice would always be printed. Instead we will just rely on the audit
check.
FixesHomebrew/homebrew#27092.
When patching read-only files, patch can try to check-out from
a VCS system when other conditions are met, such as environmental
variables being set.
Homebrew never wants to trigger this behavior, so pass --get=0.
ClosesHomebrew/homebrew#26277.