From 9bf6031b924e6635204f6c02b26a8b8546234d05 Mon Sep 17 00:00:00 2001 From: tastytea Date: Tue, 6 Aug 2019 11:39:51 +0200 Subject: [PATCH] Replaced ICU with POCO. --- .drone.yml | 12 ++++++------ README.adoc | 3 +-- cmake/remwhareadConfig.cmake.in | 1 - include/search.hpp | 2 +- packages.CMakeLists.txt | 2 +- src/lib/CMakeLists.txt | 3 +-- src/lib/search.cpp | 7 ++----- 7 files changed, 12 insertions(+), 18 deletions(-) diff --git a/.drone.yml b/.drone.yml index cd3c1eb..2cefdbb 100644 --- a/.drone.yml +++ b/.drone.yml @@ -31,7 +31,7 @@ steps: - alias apt-get='rm -f /var/cache/apt/archives/lock && apt-get' - apt-get update -q - apt-get install -qy g++-6 cmake pkg-config - - apt-get install -qy libpoco-dev libxdg-basedir-dev libvsqlitepp-dev libboost-system-dev libboost-filesystem-dev libicu-dev asciidoc catch + - apt-get install -qy libpoco-dev libxdg-basedir-dev libvsqlitepp-dev libboost-system-dev libboost-filesystem-dev asciidoc catch - locale-gen en_US.UTF-8 && update-locale LANG=en_US.UTF-8 - rm -rf build && mkdir -p build && cd build - cmake -DCMAKE_INSTALL_PREFIX=/usr -DWITH_TESTS=YES -DWITH_MOZILLA=YES .. @@ -61,7 +61,7 @@ steps: - apt-get update -q - apt-get install -qy -t xenial g++-5 - apt-get install -qy cmake pkg-config - - apt-get install -qy libpoco-dev libxdg-basedir-dev libvsqlitepp-dev libboost-system-dev libboost-filesystem-dev libicu-dev asciidoc catch + - apt-get install -qy libpoco-dev libxdg-basedir-dev libvsqlitepp-dev libboost-system-dev libboost-filesystem-dev asciidoc catch - rm -rf build && mkdir -p build && cd build - cmake -DCMAKE_INSTALL_PREFIX=/usr -DWITH_MOZILLA=YES .. - make VERBOSE=1 @@ -88,7 +88,7 @@ steps: - apt-get update -q - apt-get install -qy -t xenial g++-9 - apt-get install -qy cmake pkg-config - - apt-get install -qy libpoco-dev libxdg-basedir-dev libvsqlitepp-dev libboost-system-dev libboost-filesystem-dev libicu-dev asciidoc catch + - apt-get install -qy libpoco-dev libxdg-basedir-dev libvsqlitepp-dev libboost-system-dev libboost-filesystem-dev asciidoc catch - rm -rf build && mkdir -p build && cd build - cmake -DCMAKE_INSTALL_PREFIX=/usr -DWITH_MOZILLA=YES .. - make VERBOSE=1 @@ -108,7 +108,7 @@ steps: - alias apt-get='rm -f /var/cache/apt/archives/lock && apt-get' - apt-get update -q - apt-get install -qy clang cmake pkg-config - - apt-get install -qy libpoco-dev libxdg-basedir-dev libvsqlitepp-dev libboost-system-dev libboost-filesystem-dev libicu-dev asciidoc catch + - apt-get install -qy libpoco-dev libxdg-basedir-dev libvsqlitepp-dev libboost-system-dev libboost-filesystem-dev asciidoc catch - rm -rf build && mkdir -p build && cd build - cmake -DCMAKE_INSTALL_PREFIX=/usr -DWITH_MOZILLA=YES .. - make VERBOSE=1 @@ -128,7 +128,7 @@ steps: - alias apt-get='rm -f /var/cache/apt/archives/lock && apt-get' - apt-get update -q - apt-get install -qy clang cmake pkg-config - - apt-get install -qy libpoco-dev libxdg-basedir-dev libvsqlitepp-dev libboost-system-dev libboost-filesystem-dev libicu-dev asciidoc catch + - apt-get install -qy libpoco-dev libxdg-basedir-dev libvsqlitepp-dev libboost-system-dev libboost-filesystem-dev asciidoc catch - rm -rf build && mkdir -p build && cd build - cmake -DCMAKE_INSTALL_PREFIX=/usr -DWITH_MOZILLA=YES .. - make VERBOSE=1 @@ -185,7 +185,7 @@ steps: - alias apt-get='rm -f /var/cache/apt/archives/lock && apt-get' - apt-get update -q - apt-get install -qy g++-6 cmake pkg-config - - apt-get install -qy libpoco-dev libxdg-basedir-dev libvsqlitepp-dev libboost-system-dev libboost-filesystem-dev libicu-dev asciidoc catch + - apt-get install -qy libpoco-dev libxdg-basedir-dev libvsqlitepp-dev libboost-system-dev libboost-filesystem-dev asciidoc catch - apt-get install -qy build-essential file - rm -rf build && mkdir -p build && cd build - cmake -DCMAKE_INSTALL_PREFIX=/usr -DWITH_MOZILLA=YES -DMOZILLA_NMH_DIR="lib/mozilla/native-messaging-hosts" -DWITH_DEB=YES .. diff --git a/README.adoc b/README.adoc index 7c3e60a..bad1326 100644 --- a/README.adoc +++ b/README.adoc @@ -62,7 +62,6 @@ only. * http://repo.or.cz/w/libxdg-basedir.git[libxdg-basedir] (tested: 1.2) * https://pocoproject.org/[POCO] (tested: 1.9 / 1.7) * http://vsqlite.virtuosic-bytes.com/[vsqlite++] (tested: 0.3) -* http://www.icu-project.org/[ICU] (tested: 64.2 / 57.1) * Optional: ** Manpage: http://asciidoc.org/[asciidoc] (tested: 8.6) ** Tests: https://github.com/catchorg/Catch2[catch] (tested: 2.5 / 1.2) @@ -75,7 +74,7 @@ only. ---- apt-get update apt-get install g++-6 cmake pkg-config libpoco-dev libxdg-basedir-dev \ - libvsqlitepp-dev libboost-system-dev libboost-filesystem-dev libicu-dev asciidoc + libvsqlitepp-dev libboost-system-dev libboost-filesystem-dev asciidoc # Inside the source directory: wget -O src/cli/popl.hpp https://raw.githubusercontent.com/badaix/popl/v1.2.0/include/popl.hpp export CXX="g++-6" diff --git a/cmake/remwhareadConfig.cmake.in b/cmake/remwhareadConfig.cmake.in index bd51182..b634fc3 100644 --- a/cmake/remwhareadConfig.cmake.in +++ b/cmake/remwhareadConfig.cmake.in @@ -1,7 +1,6 @@ include(CMakeFindDependencyMacro) include(GNUInstallDirs) -find_dependency(ICU COMPONENTS uc i18n REQUIRED) find_depencency(Poco COMPONENTS Foundation Net NetSSL CONFIG REQUIRED) find_dependency(PkgConfig REQUIRED) pkg_check_modules(libxdg-basedir REQUIRED IMPORTED_TARGET libxdg-basedir) diff --git a/include/search.hpp b/include/search.hpp index 9edbadf..c89eeeb 100644 --- a/include/search.hpp +++ b/include/search.hpp @@ -95,7 +95,7 @@ namespace remwharead * * @since 0.7.0 */ - const string to_lowercase(const string &str) const; + inline const string to_lowercase(const string &str) const; }; } diff --git a/packages.CMakeLists.txt b/packages.CMakeLists.txt index 218cd21..2440e47 100644 --- a/packages.CMakeLists.txt +++ b/packages.CMakeLists.txt @@ -45,7 +45,7 @@ if (WITH_RPM) set(CPACK_RPM_PACKAGE_LICENSE "GPL-3") set(CPACK_RPM_PACKAGE_URL "https://schlomp.space/tastytea/${PROJECT_NAME}") set(CPACK_RPM_PACKAGE_REQUIRES - "poco-netssl >= 1.6, libxdg-basedir, vsqlite++ >= 0.3, libicu >= 50.0") + "poco-netssl >= 1.6, libxdg-basedir, vsqlite++ >= 0.3") set(CPACK_PACKAGE_FILE_NAME "${CPACK_PACKAGE_NAME}-${CPACK_PACKAGE_VERSION}-0.${CPACK_PACKAGE_ARCHITECTURE}") set(CPACK_SOURCE_PACKAGE_FILE_NAME diff --git a/src/lib/CMakeLists.txt b/src/lib/CMakeLists.txt index e27f2e7..2421889 100644 --- a/src/lib/CMakeLists.txt +++ b/src/lib/CMakeLists.txt @@ -2,7 +2,6 @@ include(GNUInstallDirs) find_package(PkgConfig REQUIRED) pkg_check_modules(libxdg-basedir REQUIRED IMPORTED_TARGET libxdg-basedir) -find_package(ICU COMPONENTS uc i18n REQUIRED) # Some distributions do not contain Poco*Config.cmake recipes. find_package(Poco COMPONENTS Foundation Net NetSSL CONFIG) @@ -23,7 +22,7 @@ target_include_directories(${PROJECT_NAME} "$") target_link_libraries(${PROJECT_NAME} - PRIVATE PkgConfig::libxdg-basedir ICU::uc ICU::i18n + PRIVATE PkgConfig::libxdg-basedir PUBLIC vsqlitepp stdc++fs) # If no Poco*Config.cmake recipes are found, look for headers in standard dirs. diff --git a/src/lib/search.cpp b/src/lib/search.cpp index 6b9cd4b..31f6a3a 100644 --- a/src/lib/search.cpp +++ b/src/lib/search.cpp @@ -17,7 +17,7 @@ #include #include #include -#include +#include #include "search.hpp" namespace remwharead @@ -69,10 +69,7 @@ namespace remwharead const string Search::to_lowercase(const string &str) const { - icu::UnicodeString uni(str.c_str()); - string out; - uni.toLower().toUTF8String(out); - return out; + return Poco::UTF8::toLower(str); } const vector Search::search_tags(string expression,