homebrew-core/Formula/ki18n.rb

89 lines
2.9 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.99/ki18n-5.99.0.tar.xz"
sha256 "1544dd5a002a2376f1018fee619ae2de861cd900cec312fade09e6a6943ef8ad"
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 arm64_monterey: "59d1c5c6e99ce629585d1d9603780d8263bba3e822d262ecc51a61ab99780a87"
sha256 arm64_big_sur: "7e58f9ad420ce247f8f55afc76b71d470f0d40b76833c52e9c5bec0b308ee325"
sha256 monterey: "c1126ede0f480026962d38770d2113bd936016bd5d706b97309aa9d52b813827"
sha256 big_sur: "232bb6a01f6e8e96f94f724fd1cb86595af27a197a1163ae7ec43c3df8fb6c64"
sha256 catalina: "fbe37b1952dd8730e7b3271712287a9e74e4695e38ef52f845091c3e78941b78"
sha256 x86_64_linux: "297476c7e91953ecb108d426e444fd1a0f3a0dd15d795f20a79e64865e9231b3"
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.10" => :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