homebrew-core/Formula/ki18n.rb

90 lines
3.2 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.102/ki18n-5.102.0.tar.xz"
sha256 "9ce380a9c3e40861fabe78e677c6cd826be4ced707cf87c6507251acb81c9f47"
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_ventura: "68bbe789d35be335169b4bb78fb568787b85a57f9699ac3d87694d6893157a11"
sha256 cellar: :any, arm64_monterey: "5f08081f3efa3ce0693276d721628d3d034b4c53498b30d9843e77051168b716"
sha256 cellar: :any, arm64_big_sur: "16185995746956e7bae35f35509474c6fc6e0e1eac885a14a95cf9bb90315d7b"
sha256 cellar: :any, ventura: "2bf1a7f762e8ce3c98aee6bce7550bee70f57a91d02c6ffaf7dcd35c13456b12"
sha256 cellar: :any, monterey: "94268426fc98311823d31e1019f134d7c0750d522a4afaa755caef6e9367abfc"
sha256 cellar: :any, big_sur: "843323b94581bdfc9ee4a223169ca79c06b9ccdb47a35752be3a8ddde6bed42b"
sha256 cellar: :any_skip_relocation, x86_64_linux: "38cd1a05184c8b71f94b67887bd18c780a6df27c09fa9b0e579d9ffb033743bb"
end
depends_on "cmake" => [:build, :test]
depends_on "doxygen" => :build
depends_on "extra-cmake-modules" => [:build, :test]
depends_on "graphviz" => :build
depends_on "python@3.11" => :build
depends_on "gettext"
depends_on "iso-codes"
depends_on "qt@5"
fails_with gcc: "5"
def install
args = std_cmake_args + %w[
-S .
-B build
-DBUILD_QCH=ON
-DBUILD_WITH_QML=ON
]
system "cmake", *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 #{version} NO_MODULE)
set_package_properties(ECM PROPERTIES TYPE REQUIRED)
set(CMAKE_MODULE_PATH ${ECM_MODULE_PATH} "#{pkgshare}/cmake")
set(CMAKE_CXX_STANDARD 17)
set(QT_MAJOR_VERSION 5)
set(BUILD_WITH_QML ON)
set(REQUIRED_QT_VERSION #{Formula["qt@5"].version})
find_package(Qt${QT_MAJOR_VERSION} ${REQUIRED_QT_VERSION} REQUIRED Core Qml)
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 + %W[
-S .
-B build
-DQt5_DIR=#{Formula["qt@5"].opt_lib}/cmake/Qt5
-DLibIntl_INCLUDE_DIRS=#{Formula["gettext"].include}
-DLibIntl_LIBRARIES=#{Formula["gettext"].lib}/libintl.dylib
]
system "cmake", *args
system "cmake", "--build", "build"
end
end