Formula::std_cmake_parameters

Because cmake syntax is batshit-insane, this stops people having to memorize
which parameters to supply, and thus prevents error.

I didn't do the same for Autotools deliberately as I have found that
which parameters are supported is somewhat inconsistent. Plenty don't even
support --disable-debug, thus I want the parameters getting used in the
contributors face so they can easily diagnose what is going on.
This commit is contained in:
Max Howell 2009-08-03 15:15:58 +01:00
parent e9dbdadcac
commit 182ce1eff6

View File

@ -93,6 +93,15 @@ public
raise BuildError.new(cmd) unless $? == 0 raise BuildError.new(cmd) unless $? == 0
end end
# we don't have a std_autotools variant because autotools is a lot less
# consistent and the standard parameters are more memorable
# really Homebrew should determine what works inside brew() then
# we could add --disable-dependency-tracking when it will work
def std_cmake_parameters
# The None part makes cmake use the environment's CFLAGS etc. settings
"-DCMAKE_INSTALL_PREFIX='#{prefix}' -DCMAKE_BUILD_TYPE=None"
end
# yields self with current working directory set to the uncompressed tarball # yields self with current working directory set to the uncompressed tarball
def brew def brew
ohai "Downloading #{@url}" ohai "Downloading #{@url}"
@ -105,7 +114,9 @@ public
if @md5 and not @md5.empty? if @md5 and not @md5.empty?
raise "MD5 mismatch: #{md5}" unless md5 == @md5.downcase raise "MD5 mismatch: #{md5}" unless md5 == @md5.downcase
else else
opoo "Formula does not provide an MD5 hash." opoo "Cannot verify package integrity"
puts "The formula did not provide a download checksum"
puts "For your reference the MD5 is: #{md5}"
end end
# we make an additional subdirectory so know exactly what we are # we make an additional subdirectory so know exactly what we are