Replaced ICU with POCO.

This commit is contained in:
tastytea 2019-08-06 11:39:51 +02:00
parent d28d5357c9
commit 9bf6031b92
Signed by: tastytea
GPG Key ID: CFC39497F1B26E07
7 changed files with 12 additions and 18 deletions

View File

@ -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 ..

View File

@ -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"

View File

@ -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)

View File

@ -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;
};
}

View File

@ -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

View File

@ -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}
"$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>")
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.

View File

@ -17,7 +17,7 @@
#include <regex>
#include <algorithm>
#include <locale>
#include <unicode/unistr.h>
#include <Poco/UTF8String.h>
#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<DB::entry> Search::search_tags(string expression,