From feb45459f9862fd9eeda8d4156a25e40d5603a20 Mon Sep 17 00:00:00 2001 From: topazus Date: Wed, 29 Nov 2023 23:15:54 +0800 Subject: [PATCH] update to 0.4.0; add packit config file --- .gitignore | 2 +- fix-ucd.patch | 21 ----------------- libunicode-fix-catch-in-cmake.patch | 19 +++++++++++++++ libunicode.spec | 36 ++++++++++++----------------- packit.yml | 25 ++++++++++++++++++++ sources | 2 +- 6 files changed, 61 insertions(+), 44 deletions(-) delete mode 100644 fix-ucd.patch create mode 100644 libunicode-fix-catch-in-cmake.patch create mode 100644 packit.yml diff --git a/.gitignore b/.gitignore index 86e56fb..0718171 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1 @@ -/libunicode-0.3.0.tar.gz +/libunicode-*.tar.gz diff --git a/fix-ucd.patch b/fix-ucd.patch deleted file mode 100644 index a191dff..0000000 --- a/fix-ucd.patch +++ /dev/null @@ -1,21 +0,0 @@ -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 "------------------------------------------------------------------------------") diff --git a/libunicode-fix-catch-in-cmake.patch b/libunicode-fix-catch-in-cmake.patch new file mode 100644 index 0000000..4bf665c --- /dev/null +++ b/libunicode-fix-catch-in-cmake.patch @@ -0,0 +1,19 @@ +diff --git a/src/libunicode/CMakeLists.txt b/src/libunicode/CMakeLists.txt +index 6c5ac20..9fa13a3 100644 +--- a/src/libunicode/CMakeLists.txt ++++ b/src/libunicode/CMakeLists.txt +@@ -223,10 +223,10 @@ if(LIBUNICODE_TESTING) + # supress conversion warnings for Catch2 + # https://github.com/catchorg/Catch2/issues/2583 + # https://github.com/SFML/SFML/blob/e45628e2ebc5843baa3739781276fa85a54d4653/test/CMakeLists.txt#L18-L22 +- set_target_properties(Catch2 PROPERTIES COMPILE_OPTIONS "" EXPORT_COMPILE_COMMANDS OFF) +- set_target_properties(Catch2WithMain PROPERTIES EXPORT_COMPILE_COMMANDS OFF) +- get_target_property(CATCH2_INCLUDE_DIRS Catch2 INTERFACE_INCLUDE_DIRECTORIES) +- target_include_directories(Catch2 SYSTEM INTERFACE ${CATCH2_INCLUDE_DIRS}) ++ # set_target_properties(Catch2 PROPERTIES COMPILE_OPTIONS "" EXPORT_COMPILE_COMMANDS OFF) ++ # set_target_properties(Catch2WithMain PROPERTIES EXPORT_COMPILE_COMMANDS OFF) ++ # get_target_property(CATCH2_INCLUDE_DIRS Catch2 INTERFACE_INCLUDE_DIRECTORIES) ++ # target_include_directories(Catch2 SYSTEM INTERFACE ${CATCH2_INCLUDE_DIRS}) + + target_link_libraries(unicode_test unicode Catch2::Catch2WithMain fmt::fmt-header-only) + add_test(unicode_test unicode_test) diff --git a/libunicode.spec b/libunicode.spec index 8a66bbb..96f3350 100644 --- a/libunicode.spec +++ b/libunicode.spec @@ -1,28 +1,21 @@ -%global sover 0.2 - Name: libunicode -Version: 0.3.0 +Version: 0.4.0 Release: %autorelease -Summary: Modern C++17 Unicode library +Summary: Modern C++20 Unicode Library License: Apache-2.0 URL: https://github.com/contour-terminal/libunicode Source0: %{url}/archive/v%{version}/%{name}-%{version}.tar.gz -# fix to enable the customized defined ucd path -Patch0: fix-ucd.patch +Patch0: libunicode-fix-catch-in-cmake.patch ExclusiveArch: x86_64 aarch64 BuildRequires: gcc-c++ BuildRequires: cmake +BuildRequires: ninja-build 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++ @@ -34,8 +27,7 @@ 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}. +The %{name}-devel package contains development files for %{name}. %package tools Summary: Tools for %{name} @@ -45,10 +37,14 @@ Requires: %{name}%{?_isa} = %{version}-%{release} The %{name}-tools package contains tools about %{name}. %prep -%autosetup +%autosetup -p1 %build -%cmake -DLIBUNICODE_UCD_DIR=%{_datadir}/unicode/ucd +%cmake \ + -GNinja \ + -DCMAKE_BUILD_TYPE=Release \ + -DLIBUNICODE_UCD_DIR=%{_datadir}/unicode/ucd \ + %cmake_build %install @@ -60,14 +56,12 @@ The %{name}-tools package contains tools about %{name}. %files %license LICENSE %doc README.md Changelog.md -%{_libdir}/%{name}*.so.%{sover}* +%{_libdir}/libunicode*.so.0.4* %files devel -%dir %{_includedir}/%{name} -%{_includedir}/%{name}/*.h -%dir %{_libdir}/cmake/%{name} -%{_libdir}/cmake/%{name}/*.cmake -%{_libdir}/%{name}*.so +%{_includedir}/libunicode/ +%{_libdir}/cmake/libunicode/ +%{_libdir}/libunicode*.so %files tools %{_bindir}/unicode-query diff --git a/packit.yml b/packit.yml new file mode 100644 index 0000000..d91e3fb --- /dev/null +++ b/packit.yml @@ -0,0 +1,25 @@ +upstream_package_name: libunicode +upstream_project_url: https://github.com/contour-terminal/libunicode + +downstream_package_name: libunicode + +specfile_path: libunicode.spec + +jobs: + - job: pull_from_upstream + trigger: release + dist_git_branches: + - rawhide + - epel-9 + + - job: koji_build + trigger: commit + dist_git_branches: + - rawhide + - epel-9 + + - job: bodhi_update + trigger: commit + dist_git_branches: + - rawhide + - epel-9 diff --git a/sources b/sources index ca936e2..378cf70 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (libunicode-0.3.0.tar.gz) = d153b4dd8bd85e69bbf6f6093bac925b326144523f343b4630979cec533daf48026eba2f430c0dcd34eddccf50e2a2b98816fc37c2b3bd9db7ac272ad566aa8f +SHA512 (libunicode-0.4.0.tar.gz) = 48be9f3397f97432ae6a4d6e116fd8e77abf7d085b5dbb74c45828671fd45b6f5ee0e54751cf4aeeec61ab025b6831232cdb9ed1c34e1e7a4ebf84bbe1b4f84b