diff --git a/.gitignore b/.gitignore index 35ed041..a357ee5 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ /utf8_v2_3_4.zip -/ftest-*.tar.gz -/utfcpp-*.tar.gz +/utfcpp-2.3.6.tar.gz +/utfcpp-3.1.tar.gz +/utfcpp-3.1.2.tar.gz diff --git a/sources b/sources index 4f337f0..93084ea 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (utfcpp-4.1.1.tar.gz) = 72061902812b3f5b27afb32c513fc337db4149b8a6e51cbfe497109f88145751484093990bb1b20b4eec2b9f621406690030401b2a51c9368eb481f00225cd24 +SHA512 (utfcpp-3.1.2.tar.gz) = d43df19d9e8652291f1301a326ec0d592bad43d6ecf9086947037f0ae0c1e70c2d96082c48066639e2b7c57c0ea0e4782d6b215d017cf96a4c73ff3a15feec75 diff --git a/utf8cpp-cmake.patch b/utf8cpp-cmake.patch deleted file mode 100644 index 5f6324a..0000000 --- a/utf8cpp-cmake.patch +++ /dev/null @@ -1,24 +0,0 @@ -diff -up utfcpp-4.0.4/CMakeLists.txt.orig utfcpp-4.0.4/CMakeLists.txt ---- utfcpp-4.0.4/CMakeLists.txt.orig 2023-12-10 16:42:20.000000000 +0100 -+++ utfcpp-4.0.4/CMakeLists.txt 2023-12-14 12:37:01.511860031 +0100 -@@ -35,17 +35,17 @@ install(TARGETS ${PROJECT_NAME} - configure_package_config_file( - "${PROJECT_SOURCE_DIR}/${PROJECT_NAME}Config.cmake.in" - "${PROJECT_BINARY_DIR}/${PROJECT_NAME}Config.cmake" -- INSTALL_DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/${PROJECT_NAME}/cmake -+ INSTALL_DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/cmake/${PROJECT_NAME} - ) - - install(EXPORT ${PROJECT_NAME}Targets - FILE ${PROJECT_NAME}Targets.cmake - NAMESPACE ${PROJECT_NAME}:: -- DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/${PROJECT_NAME}/cmake) -+ DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/cmake/${PROJECT_NAME}) - - install(FILES "${PROJECT_BINARY_DIR}/${PROJECT_NAME}Config.cmake" - "${PROJECT_BINARY_DIR}/${PROJECT_NAME}ConfigVersion.cmake" -- DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/${PROJECT_NAME}/cmake) -+ DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/cmake/${PROJECT_NAME}) - - install(FILES ${PROJECT_SOURCE_DIR}/source/utf8.h DESTINATION include/utf8cpp) - install(DIRECTORY ${PROJECT_SOURCE_DIR}/source/utf8 DESTINATION diff --git a/utf8cpp-noarch.patch b/utf8cpp-noarch.patch new file mode 100644 index 0000000..ff63bce --- /dev/null +++ b/utf8cpp-noarch.patch @@ -0,0 +1,12 @@ +diff -up utfcpp-3.1/CMakeLists.txt.noarch utfcpp-3.1/CMakeLists.txt +--- utfcpp-3.1/CMakeLists.txt.noarch 2019-10-22 09:52:44.918701226 +0200 ++++ utfcpp-3.1/CMakeLists.txt 2019-10-22 09:51:52.374148428 +0200 +@@ -17,7 +17,7 @@ if(UTF8_INSTALL) + set(DEF_INSTALL_CMAKE_DIR CMake) + else() + include(GNUInstallDirs) # define CMAKE_INSTALL_* +- set(DEF_INSTALL_CMAKE_DIR ${CMAKE_INSTALL_LIBDIR}/cmake/utf8cpp) ++ set(DEF_INSTALL_CMAKE_DIR ${CMAKE_INSTALL_DATADIR}/cmake/utf8cpp) + endif() + + install(DIRECTORY source/ DESTINATION include/utf8cpp) diff --git a/utf8cpp-use-system-gtest.patch b/utf8cpp-use-system-gtest.patch new file mode 100644 index 0000000..205a3ed --- /dev/null +++ b/utf8cpp-use-system-gtest.patch @@ -0,0 +1,32 @@ +diff -up utfcpp-3.1/CMakeLists.txt.gtest utfcpp-3.1/CMakeLists.txt +--- utfcpp-3.1/CMakeLists.txt.gtest 2019-04-26 23:49:17.000000000 +0200 ++++ utfcpp-3.1/CMakeLists.txt 2019-10-22 09:44:02.721256016 +0200 +@@ -32,6 +32,5 @@ endif() + + if(UTF8_TESTS) + enable_testing() +- add_subdirectory(extern/gtest) + add_subdirectory(tests) + endif() +diff -up utfcpp-3.1/tests/CMakeLists.txt.gtest utfcpp-3.1/tests/CMakeLists.txt +--- utfcpp-3.1/tests/CMakeLists.txt.gtest 2019-04-26 23:49:17.000000000 +0200 ++++ utfcpp-3.1/tests/CMakeLists.txt 2019-10-22 09:46:24.165698530 +0200 +@@ -16,15 +16,18 @@ target_link_libraries(negative PRIVATE u + target_link_libraries(cpp11 PRIVATE + utf8::cpp + gtest_main ++ gtest + ) + target_link_libraries(apitests PRIVATE + utf8::cpp + gtest_main ++ gtest + ) + + target_link_libraries(noexceptionstests PRIVATE + utf8::cpp + gtest_main ++ gtest + ) + target_compile_options(noexceptionstests PUBLIC -fno-exceptions) + diff --git a/utf8cpp.spec b/utf8cpp.spec index f07f502..40802a4 100644 --- a/utf8cpp.spec +++ b/utf8cpp.spec @@ -1,20 +1,20 @@ %undefine __cmake_in_source_build # This package only contains header files. %global debug_package %{nil} -%global ftest_commit c4ad4af0946b73ce1a40cbc72205d15d196c7e06 -%global ftest_shortcommit %(c=%{ftest_commit}; echo ${c:0:7}) Name: utf8cpp -Version: 4.1.1 -Release: 2%{?dist} +Version: 3.1.2 +Release: 1%{?dist} Summary: A simple, portable and lightweight library for handling UTF-8 encoded strings -License: BSL-1.0 +License: Boost URL: https://github.com/nemtrif/utfcpp Source0: https://github.com/nemtrif/utfcpp/archive/v%{version}/utfcpp-%{version}.tar.gz -# put cmake import file in correct directory -Patch0: %{name}-cmake.patch -BuildRequires: cmake +Patch0: %{name}-use-system-gtest.patch +# put cmake import file in arch-agnostic directory +Patch1: %{name}-noarch.patch +BuildRequires: cmake3 BuildRequires: gcc-c++ +BuildRequires: gtest-devel %description %{summary}. @@ -45,125 +45,43 @@ This project currently only contains header files, which can be found in the %{name}-devel package. %prep -%autosetup -n utfcpp-%{version} -p1 +%setup -q -n utfcpp-%{version} +%patch0 -p1 -b .gtest +%patch1 -p1 -b .noarch +#%%patch10 -p1 %build -%cmake \ +%cmake3 \ + -DUTF8_TESTS=ON \ + -DUTF8_SAMPLES=ON \ %{nil} -%cmake_build -pushd tests -%cmake -%cmake_build -popd +%cmake3_build %install -%cmake_install +%cmake3_install pushd %{buildroot}%{_includedir} ln -s utf8cpp/utf8.h ./ mkdir utf8 -for f in {{un,}checked,core,cpp{11,17,20}}.h ; do +for f in {{un,}checked,core,cpp11}.h ; do ln -s ../utf8cpp/utf8/${f} utf8/ done popd %check -pushd tests %ctest -popd %files devel -%doc API_REFERENCE.md README.md -%license LICENSE +%doc README.md samples/docsample.cpp %{_includedir}/utf8.h %dir %{_includedir}/utf8 %{_includedir}/utf8/checked.h %{_includedir}/utf8/core.h %{_includedir}/utf8/cpp11.h -%{_includedir}/utf8/cpp17.h -%{_includedir}/utf8/cpp20.h %{_includedir}/utf8/unchecked.h %{_includedir}/utf8cpp %{_datadir}/cmake/utf8cpp %changelog -* Fri Jul 17 2026 Fedora Release Engineering - 4.1.1-2 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_45_Mass_Rebuild - -* Fri May 22 2026 Dominik Mierzejewski - 4.1.1-1 -- update to 4.1.1 (resolves rhbz#2480337) - -* Mon May 18 2026 Dominik Mierzejewski - 4.1.0-1 -- update to 4.1.0 (resolves rhbz#2478190) - -* Sat Jan 17 2026 Fedora Release Engineering - 4.0.9-2 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_44_Mass_Rebuild - -* Fri Jan 02 2026 Dominik Mierzejewski - 4.0.9-1 -- update to 4.0.9 (resolves rhbz#2425940) - -* Sat Sep 20 2025 Dominik Mierzejewski - 4.0.8-1 -- update to 4.0.8 (resolves rhbz#2395010) - -* Fri Jul 25 2025 Fedora Release Engineering - 4.0.6-3 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_43_Mass_Rebuild - -* Sun Jan 19 2025 Fedora Release Engineering - 4.0.6-2 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_42_Mass_Rebuild - -* Sun Nov 17 2024 Dominik Mierzejewski - 4.0.6-1 -- update to 4.0.6 (resolves rhbz#2323791) - -* Sat Jul 20 2024 Fedora Release Engineering - 4.0.5-3 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_41_Mass_Rebuild - -* Sat Jan 27 2024 Fedora Release Engineering - 4.0.5-2 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild - -* Wed Jan 03 2024 Dominik Mierzejewski - 4.0.5-1 -- update to 4.0.5 (resolves rhbz#2245744) -- include license text - -* Sun Oct 08 2023 Dominik Mierzejewski - 3.2.5-1 -- update to 3.2.5 (resolves rhbz#2240785) - -* Thu Aug 31 2023 Dominik Mierzejewski - 3.2.4-1 -- update to 3.2.4 (resolves rhbz#2231660) -- switch to SPDX expression in License tag -- use modern autosetup and plain cmake dependency and macros - -* Sat Jul 22 2023 Fedora Release Engineering - 3.2.3-3 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_39_Mass_Rebuild - -* Sat Jan 21 2023 Fedora Release Engineering - 3.2.3-2 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_38_Mass_Rebuild - -* Tue Jan 03 2023 Dominik 'Rathann' Mierzejewski - 3.2.3-1 -- update to 3.2.3 (#2157206) - -* Wed Dec 07 2022 Dominik 'Rathann' Mierzejewski - 3.2.2-1 -- update to 3.2.2 (#2140879) - -* Sat Jul 23 2022 Fedora Release Engineering - 3.2.1-4 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_37_Mass_Rebuild - -* Sat Jan 22 2022 Fedora Release Engineering - 3.2.1-3 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild - -* Fri Jul 23 2021 Fedora Release Engineering - 3.2.1-2 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild - -* Mon Jun 07 2021 Dominik 'Rathann' Mierzejewski - 3.2.1-1 -- update to 3.2.1 (#1968224) - -* Wed May 19 2021 Dominik 'Rathann' Mierzejewski - 3.2-2 -- add missed compatibility link for cpp17.h - -* Tue May 04 2021 Dominik 'Rathann' Mierzejewski - 3.2-1 -- update to 3.2 (#1956027) - -* Wed Jan 27 2021 Fedora Release Engineering - 3.1.2-2 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild - * Mon Oct 05 2020 Dominik 'Rathann' Mierzejewski - 3.1.2-1 - update to 3.1.2 (#1883049)