From 2c3fb24467d2c47c901fd984a68e69a116e45a49 Mon Sep 17 00:00:00 2001 From: Larry Shaffer Date: Sat, 29 Nov 2014 11:02:45 -0700 Subject: [PATCH] qca: add options for head, qt5, api docs and building all plugins Closes Homebrew/homebrew#34530. Signed-off-by: Mike McQuaid --- Formula/qca.rb | 43 ++++++++++++++++++++++++++++++++++++++----- 1 file changed, 38 insertions(+), 5 deletions(-) diff --git a/Formula/qca.rb b/Formula/qca.rb index d02e55a615..58b1c4d5d7 100644 --- a/Formula/qca.rb +++ b/Formula/qca.rb @@ -5,21 +5,54 @@ class Qca < Formula url "http://delta.affinix.com/download/qca/2.0/qca-2.1.0.tar.gz" sha1 "2b582b3ccc7e6098cd14d6f52a829ae1539e9cc8" + head "git://anongit.kde.org/qca.git", :branch => "master" + bottle do sha1 "3ff5e09bb690122d807b48470cf1bbafcca89b41" => :yosemite sha1 "f01d8cbd41c97068185af2f4c6efdec8ff0c6ce7" => :mavericks sha1 "4638b43c0ce83a2cccc64d678c7eefffd1844ba3" => :mountain_lion end + option "with-api-docs", "Build API documentation" + depends_on "cmake" => :build depends_on "pkg-config" => :build - depends_on "qt" - depends_on "openssl" + depends_on "qt" => :recommended + 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 - mkdir "build" do - system "cmake", "..", *std_cmake_args - system "make", "install" + odie "Qt dependency must be defined" if build.without?("qt") && build.without?("qt5") + + 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" + + if build.with? "api-docs" + system "make", "doc" + doc.install "apidocs/html" end end