73 lines
2.5 KiB
Ruby
73 lines
2.5 KiB
Ruby
class Ki18n < Formula
|
|
desc "KDE Gettext-based UI text internationalization"
|
|
homepage "https://api.kde.org/frameworks/ki18n/html/index.html"
|
|
url "https://download.kde.org/stable/frameworks/5.87/ki18n-5.87.0.tar.xz"
|
|
sha256 "115e79ec5cc4825a1f9f6783f6e6da0d56d02feddc89f51ce9e7c205199c250d"
|
|
license all_of: [
|
|
"BSD-3-Clause",
|
|
"LGPL-2.0-or-later",
|
|
any_of: ["LGPL-2.1-only", "LGPL-3.0-only"],
|
|
]
|
|
head "https://invent.kde.org/frameworks/ki18n.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_big_sur: "e8e02e080983e0dc9ba9cfb9978269ab55a8a8e9cdb3207f5a3a16f32bbf677b"
|
|
sha256 cellar: :any, big_sur: "bbecfa16898a00a249b33200e6acad4c2b93ef0f45cfe24e57a14cf805bced9a"
|
|
sha256 cellar: :any, catalina: "2b8fefac2d37ffeae39edb0a1c6356d291cf196f6796157eeae82d63af583082"
|
|
sha256 cellar: :any, mojave: "9ce6019773f1e9f185b9ba7567a5c5894ed9545d64c2be325953f5520ec56efb"
|
|
end
|
|
|
|
depends_on "cmake" => [:build, :test]
|
|
depends_on "doxygen" => :build
|
|
depends_on "extra-cmake-modules" => [:build, :test]
|
|
depends_on "graphviz" => :build
|
|
depends_on "gettext"
|
|
depends_on "qt@5"
|
|
|
|
def install
|
|
args = std_cmake_args
|
|
args << "-DBUILD_TESTING=OFF"
|
|
args << "-DBUILD_QCH=ON"
|
|
|
|
system "cmake", "-S", ".", "-B", "build", *args
|
|
system "cmake", "--build", "build"
|
|
system "cmake", "--install", "build"
|
|
|
|
pkgshare.install "autotests"
|
|
(pkgshare/"cmake").install "cmake/FindLibIntl.cmake"
|
|
end
|
|
|
|
test do
|
|
(testpath/"CMakeLists.txt").write <<~EOS
|
|
cmake_minimum_required(VERSION 3.5)
|
|
include(FeatureSummary)
|
|
find_package(ECM 5.71.0 NO_MODULE)
|
|
set_package_properties(ECM PROPERTIES TYPE REQUIRED)
|
|
set(CMAKE_MODULE_PATH ${ECM_MODULE_PATH} "#{pkgshare}/cmake")
|
|
find_package(Qt5 5.12.0 REQUIRED Core)
|
|
find_package(KF5I18n REQUIRED)
|
|
INCLUDE(CheckCXXSourceCompiles)
|
|
find_package(LibIntl)
|
|
set_package_properties(LibIntl PROPERTIES TYPE REQUIRED)
|
|
add_subdirectory(autotests)
|
|
EOS
|
|
|
|
cp_r (pkgshare/"autotests"), testpath
|
|
|
|
args = std_cmake_args
|
|
args << "-DQt5_DIR=#{Formula["qt@5"].opt_prefix/"lib/cmake/Qt5"}"
|
|
args << "-DLibIntl_INCLUDE_DIRS=#{Formula["gettext"].include}"
|
|
args << "-DLibIntl_LIBRARIES=#{Formula["gettext"].lib/"libintl.dylib"}"
|
|
|
|
system "cmake", testpath.to_s, *args
|
|
system "make"
|
|
end
|
|
end
|