92 lines
2.9 KiB
Ruby
92 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.96/ki18n-5.96.0.tar.xz"
|
|
sha256 "fe815cb7994f757ff92cae0ae5b739909a94d01c7272752cc56cf627db423ecb"
|
|
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: "14011f6e9edc0378183ff6be8421eac40487a3c703ef75bb956f119ea65f9c6a"
|
|
sha256 arm64_big_sur: "dc090991a9ed24983e2eb572dc9f93b0f8640bc05aa5b3a0b5383757c64e54ef"
|
|
sha256 monterey: "9aa0de408bbb45a63c44f3247c50768b4dc97117b4e18e8c0943e305ef91e0d2"
|
|
sha256 big_sur: "dc25bce2baad3c0f30a631a522ae64af237ab0c5a02a23ad6c01fcfa76c75352"
|
|
sha256 catalina: "5657a8bbf63cbb975faef191a27405d5cfaca1daa27cc57125ed72090520bc16"
|
|
sha256 x86_64_linux: "18d26250bf2d47a79c8a1e0b38eca72013098cfe877fa6a7156918b8ff272fa4"
|
|
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 "iso-codes"
|
|
depends_on "qt@5"
|
|
|
|
on_linux do
|
|
depends_on "gcc"
|
|
end
|
|
|
|
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
|