homebrew-core/Formula/kde-ki18n.rb

61 lines
2.0 KiB
Ruby

class KdeKi18n < 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.73/ki18n-5.73.0.tar.xz"
sha256 "97eef22d6cdd65c57edfe54fa9760a69005e15b7d8f4270f6185916c33e14689"
head "https://invent.kde.org/frameworks/ki18n.git"
bottle do
sha256 "f9d52d1a2d3f15381ccdc9db1a100a3213ffd7776204cb6d7a3cf57d1e309ba5" => :catalina
sha256 "420f3d6c03500801899b6ae9bf74f4d84320d24be1b5e8e54ac804fa7275babd" => :mojave
sha256 "0d6367dc3131883930262c99d7d4ff35da8639c795a424a212d1f3894bd251f7" => :high_sierra
end
depends_on "cmake" => [:build, :test]
depends_on "doxygen" => :build
depends_on "graphviz" => :build
depends_on "kde-extra-cmake-modules" => [:build, :test]
depends_on "gettext"
depends_on "qt"
def install
args = std_cmake_args
args << "-DBUILD_TESTING=OFF"
args << "-DBUILD_QCH=ON"
mkdir "build" do
system "cmake", "..", *args
system "make", "install"
end
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"].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