+ Add a validate function that refuses to build numdiff if arch is darwin-x86_64.

This commit is contained in:
Kelly (KT) Thompson 2016-03-22 12:31:27 -06:00
parent 6e0e6d2654
commit 1eb7b8cf46

View file

@ -34,7 +34,22 @@ class Numdiff(Package):
version('5.8.1', 'a295eb391f6cb1578209fc6b4f9d994e') version('5.8.1', 'a295eb391f6cb1578209fc6b4f9d994e')
def validate(self, spec):
"""
Checks if we are attempting to build on an incompatible
architecture.
Ref. https://github.com/davydden/homebrew-dealiisuite/blob/master/numdiff.rb#L13-L15.
:param spec: spec of the package
:raises RuntimeError: in case of inconsistencies.
"""
if spec.satisfies("=darwin-x86_64"):
raise RuntimeError(msg)
def install(self, spec, prefix): def install(self, spec, prefix):
self.validate(spec)
options = ['--prefix=%s' % prefix] options = ['--prefix=%s' % prefix]
configure(*options) configure(*options)
make() make()