119 lines
3.9 KiB
Ruby
119 lines
3.9 KiB
Ruby
class Kdoctools < Formula
|
|
desc "Create documentation from DocBook"
|
|
homepage "https://api.kde.org/frameworks/kdoctools/html/index.html"
|
|
url "https://download.kde.org/stable/frameworks/5.99/kdoctools-5.99.0.tar.xz"
|
|
sha256 "c695efa912f4526d1aaf68f422014a830a22ac10a1d1ebd66a2c10a3e3a4e3a6"
|
|
license all_of: [
|
|
"BSD-3-Clause",
|
|
"GPL-2.0-or-later",
|
|
"LGPL-2.1-or-later",
|
|
any_of: ["LGPL-2.1-only", "LGPL-3.0-only"],
|
|
]
|
|
head "https://invent.kde.org/frameworks/kdoctools.git", branch: "master"
|
|
|
|
# We check the tags from the `head` repository because the latest stable
|
|
# version doesn't seem to be easily available elsewhere.
|
|
livecheck do
|
|
url :head
|
|
regex(/^v?(\d+(?:\.\d+)+)$/i)
|
|
end
|
|
|
|
bottle do
|
|
sha256 cellar: :any, arm64_monterey: "2eaea96558c8f9371ef480bd495e8dde7d7e9a38fd41cea2e4baca735bd3d084"
|
|
sha256 cellar: :any, arm64_big_sur: "8d4ebf59072622b15f40b1c4b20706057d6ae23b613cd9e879bc97ce5a60c488"
|
|
sha256 cellar: :any, monterey: "e7fae83eef2fde58513536044fe5d7f82c84f49eabcabfc9ffbf80c15df338fb"
|
|
sha256 cellar: :any, big_sur: "7bfb1cb8004bd0a844495e77488d723d3887f1e874638b05fd7b3131953b104e"
|
|
sha256 cellar: :any, catalina: "0ffd6b55909ebf17e0deccb8b556f339318eb72fcedd874ce33791e05162d009"
|
|
sha256 cellar: :any_skip_relocation, x86_64_linux: "758701a0a8ee5f17dcb3eb0b39bc3df78b26becedb936cfde82416787886a33b"
|
|
end
|
|
|
|
depends_on "cmake" => [:build, :test]
|
|
depends_on "doxygen" => :build
|
|
depends_on "extra-cmake-modules" => [:build, :test]
|
|
depends_on "gettext" => :build
|
|
depends_on "ki18n" => :build
|
|
|
|
depends_on "docbook-xsl"
|
|
depends_on "karchive"
|
|
|
|
uses_from_macos "libxml2"
|
|
uses_from_macos "libxslt"
|
|
uses_from_macos "perl"
|
|
|
|
fails_with gcc: "5"
|
|
|
|
resource "URI::Escape" do
|
|
url "https://cpan.metacpan.org/authors/id/O/OA/OALDERS/URI-5.12.tar.gz"
|
|
sha256 "66abe0eaddd76b74801ecd28ec1411605887550fc0a45ef6aa744fdad768d9b3"
|
|
end
|
|
|
|
def install
|
|
ENV.prepend_create_path "PERL5LIB", libexec/"lib/perl5"
|
|
ENV.prepend_path "PERL5LIB", libexec/"lib"
|
|
|
|
resource("URI::Escape").stage do
|
|
system "perl", "Makefile.PL", "INSTALL_BASE=#{libexec}"
|
|
system "make", "install"
|
|
end
|
|
|
|
args = std_cmake_args + %w[
|
|
-S .
|
|
-B build
|
|
-DBUILD_QCH=ON
|
|
]
|
|
|
|
system "cmake", *args
|
|
system "cmake", "--build", "build"
|
|
system "cmake", "--install", "build"
|
|
|
|
pkgshare.install ["cmake", "autotests", "tests"]
|
|
end
|
|
|
|
test do
|
|
(testpath/"CMakeLists.txt").write <<~EOS
|
|
cmake_minimum_required(VERSION 3.5)
|
|
include(FeatureSummary)
|
|
find_package(ECM #{version} NO_MODULE)
|
|
set_package_properties(ECM PROPERTIES TYPE REQUIRED)
|
|
set(CMAKE_MODULE_PATH ${ECM_MODULE_PATH} "#{pkgshare}/cmake")
|
|
find_package(Qt5 #{Formula["qt@5"].version} REQUIRED Core)
|
|
find_package(KF5DocTools REQUIRED)
|
|
|
|
find_package(LibXslt)
|
|
set_package_properties(LibXslt PROPERTIES TYPE REQUIRED)
|
|
|
|
find_package(LibXml2)
|
|
set_package_properties(LibXml2 PROPERTIES TYPE REQUIRED)
|
|
|
|
if (NOT LIBXML2_XMLLINT_EXECUTABLE)
|
|
message(FATAL_ERROR "xmllint is required to process DocBook XML")
|
|
endif()
|
|
|
|
find_package(DocBookXML4 "4.5")
|
|
set_package_properties(DocBookXML4 PROPERTIES TYPE REQUIRED)
|
|
|
|
find_package(DocBookXSL)
|
|
set_package_properties(DocBookXSL PROPERTIES TYPE REQUIRED)
|
|
|
|
remove_definitions(-DQT_NO_CAST_FROM_ASCII)
|
|
add_definitions(-DQT_NO_FOREACH)
|
|
|
|
add_subdirectory(autotests)
|
|
add_subdirectory(tests/create-from-current-dir-test)
|
|
add_subdirectory(tests/kdoctools_install-test)
|
|
EOS
|
|
|
|
cp_r (pkgshare/"autotests"), testpath
|
|
cp_r (pkgshare/"tests"), testpath
|
|
|
|
args = std_cmake_args + %W[
|
|
-S .
|
|
-B build
|
|
-DQt5_DIR=#{Formula["qt@5"].opt_lib}/cmake/Qt5
|
|
]
|
|
|
|
system "cmake", *args
|
|
system "cmake", "--build", "build"
|
|
end
|
|
end
|