Initial import (rhbz#2174383)

This commit is contained in:
topazus 2023-03-06 09:03:23 +08:00
parent 80caacbb32
commit f9dea2630d
4 changed files with 98 additions and 0 deletions

1
.gitignore vendored Normal file
View File

@ -0,0 +1 @@
/libunicode-0.3.0.tar.gz

21
fix-ucd.patch Normal file
View File

@ -0,0 +1,21 @@
diff --git a/CMakeLists.txt b/CMakeLists.txt
index e40103d..254b75f 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -55,7 +55,7 @@ set(LIBUNICODE_UCD_BASE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/_ucd" CACHE PATH "Path
set(LIBUNICODE_UCD_ZIP_DOWNLOAD_URL "https://www.unicode.org/Public/${LIBUNICODE_UCD_VERSION}/ucd/UCD.zip")
set(LIBUNICODE_UCD_ZIP_FILE "${LIBUNICODE_UCD_BASE_DIR}/ucd-${LIBUNICODE_UCD_VERSION}.zip")
-set(LIBUNICODE_UCD_DIR "${LIBUNICODE_UCD_BASE_DIR}/ucd-${LIBUNICODE_UCD_VERSION}")
+set(LIBUNICODE_UCD_DIR "${LIBUNICODE_UCD_BASE_DIR}/ucd-${LIBUNICODE_UCD_VERSION}" CACHE PATH "Path to UCD directory.")
# ----------------------------------------------------------------------------
# code coverage
@@ -96,7 +96,6 @@ message(STATUS "Build mode: ${LIBUNICODE_BUILD_MODE}")
message(STATUS "Build unit tests: ${LIBUNICODE_TESTING}")
message(STATUS "Build tools: ${LIBUNICODE_TOOLS}")
message(STATUS "Using ccache: ${USING_CCACHE_STRING}")
-message(STATUS "Using UCD version: ${LIBUNICODE_UCD_VERSION}")
message(STATUS "Using UCD directory: ${LIBUNICODE_UCD_DIR}")
message(STATUS "Enable clang-tidy: ${ENABLE_TIDY} (${CMAKE_CXX_CLANG_TIDY})")
message(STATUS "------------------------------------------------------------------------------")

75
libunicode.spec Normal file
View File

@ -0,0 +1,75 @@
%global sover 0.2
Name: libunicode
Version: 0.3.0
Release: %autorelease
Summary: Modern C++17 Unicode library
License: Apache-2.0
URL: https://github.com/contour-terminal/libunicode
Source0: %{url}/archive/v%{version}/%{name}-%{version}.tar.gz
Patch0: fix-ucd.patch
ExclusiveArch: x86_64 aarch64
BuildRequires: gcc-c++
BuildRequires: cmake
BuildRequires: fmt-devel
BuildRequires: range-v3-devel
BuildRequires: unicode-ucd
%if %{?fedora} <= 38
BuildRequires: catch-devel
%else
BuildRequires: catch2-devel
%endif
%description
The goal of libunicode library is to bring painless unicode support to C++
with simple and easy to understand APIs. The API naming conventions are chosen
to look familiar to those using the C++ standard libary.
%package devel
Summary: Development files for %{name}
Requires: %{name}%{?_isa} = %{version}-%{release}
%description devel
The %{name}-devel package contains libraries and header files for
developing applications that use %{name}.
%package tools
Summary: Tools for %{name}
Requires: %{name}%{?_isa} = %{version}-%{release}
%description tools
The %{name}-tools package contains tools about %{name}.
%prep
%autosetup
%build
%cmake -DLIBUNICODE_UCD_DIR=%{_datadir}/unicode/ucd
%cmake_build
%install
%cmake_install
%check
%ctest
%files
%license LICENSE
%doc README.md Changelog.md
%{_libdir}/%{name}*.so.%{sover}*
%files devel
%dir %{_includedir}/%{name}
%{_includedir}/%{name}/*.h
%dir %{_libdir}/cmake/%{name}
%{_libdir}/cmake/%{name}/*.cmake
%{_libdir}/%{name}*.so
%files tools
%{_bindir}/unicode-query
%changelog
%autochangelog

1
sources Normal file
View File

@ -0,0 +1 @@
SHA512 (libunicode-0.3.0.tar.gz) = d153b4dd8bd85e69bbf6f6093bac925b326144523f343b4630979cec533daf48026eba2f430c0dcd34eddccf50e2a2b98816fc37c2b3bd9db7ac272ad566aa8f