qca: add options for head, qt5, api docs and building all plugins

Closes Homebrew/homebrew#34530.

Signed-off-by: Mike McQuaid <mike@mikemcquaid.com>
This commit is contained in:
Larry Shaffer 2014-11-29 11:02:45 -07:00 committed by Mike McQuaid
parent 3417ad7031
commit 2c3fb24467

View file

@ -5,21 +5,54 @@ class Qca < Formula
url "http://delta.affinix.com/download/qca/2.0/qca-2.1.0.tar.gz" url "http://delta.affinix.com/download/qca/2.0/qca-2.1.0.tar.gz"
sha1 "2b582b3ccc7e6098cd14d6f52a829ae1539e9cc8" sha1 "2b582b3ccc7e6098cd14d6f52a829ae1539e9cc8"
head "git://anongit.kde.org/qca.git", :branch => "master"
bottle do bottle do
sha1 "3ff5e09bb690122d807b48470cf1bbafcca89b41" => :yosemite sha1 "3ff5e09bb690122d807b48470cf1bbafcca89b41" => :yosemite
sha1 "f01d8cbd41c97068185af2f4c6efdec8ff0c6ce7" => :mavericks sha1 "f01d8cbd41c97068185af2f4c6efdec8ff0c6ce7" => :mavericks
sha1 "4638b43c0ce83a2cccc64d678c7eefffd1844ba3" => :mountain_lion sha1 "4638b43c0ce83a2cccc64d678c7eefffd1844ba3" => :mountain_lion
end end
option "with-api-docs", "Build API documentation"
depends_on "cmake" => :build depends_on "cmake" => :build
depends_on "pkg-config" => :build depends_on "pkg-config" => :build
depends_on "qt" depends_on "qt" => :recommended
depends_on "openssl" depends_on "qt5" => :optional
# Plugins (QCA needs at least one plugin to do anything useful)
depends_on "openssl" # qca-ossl
depends_on "botan" => :optional # qca-botan
depends_on "libgcrypt" => :optional # qca-gcrypt
depends_on "gnupg" => :optional # qca-gnupg
depends_on "nss" => :optional # qca-nss
depends_on "pkcs11-helper" => :optional # qca-pkcs11
if build.with? "api-docs"
depends_on "graphviz" => :build
depends_on "doxygen" => [:build, "with-dot"]
end
def install def install
mkdir "build" do odie "Qt dependency must be defined" if build.without?("qt") && build.without?("qt5")
system "cmake", "..", *std_cmake_args
args = std_cmake_args
args << "-DQT4_BUILD=#{build.with?("qt5") ? "OFF" : "ON"}"
args << "-DBUILD_TESTS=OFF"
# Plugins (qca-ossl, qca-cyrus-sasl, qca-logger, qca-softstore always built)
args << "-DWITH_botan_PLUGIN=#{build.with?("botan") ? "YES" : "NO"}"
args << "-DWITH_gcrypt_PLUGIN=#{build.with?("libgcrypt") ? "YES" : "NO"}"
args << "-DWITH_gnupg_PLUGIN=#{build.with?("gnupg") ? "YES" : "NO"}"
args << "-DWITH_nss_PLUGIN=#{build.with?("nss") ? "YES" : "NO"}"
args << "-DWITH_pkcs11_PLUGIN=#{build.with?("pkcs11-helper") ? "YES" : "NO"}"
system "cmake", ".", *args
system "make", "install" system "make", "install"
if build.with? "api-docs"
system "make", "doc"
doc.install "apidocs/html"
end end
end end