Revert "Replace libxdg-basedir with Poco::Path."

This reverts commit d74b3cabfa.

Poco::Path::dataHome() is only available in >= 1.9.
This commit is contained in:
tastytea 2019-08-05 19:11:37 +02:00
parent 1d7153008a
commit 6d16b2598e
Signed by: tastytea
GPG Key ID: CFC39497F1B26E07
5 changed files with 15 additions and 7 deletions

View File

@ -57,7 +57,9 @@ only.
* C++ compiler (tested: https://gcc.gnu.org/[gcc] 5/6/8/9,
https://llvm.org/[clang] 3/7)
* https://cmake.org/[cmake] (at least: 3.2)
* https://pkgconfig.freedesktop.org/wiki/[pkgconfig] (tested: 0.29)
* https://github.com/badaix/popl[popl] (tested: 1.2)
* 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)
@ -72,7 +74,8 @@ only.
[source,zsh]
----
apt-get update
apt-get install g++-6 cmake libpoco-dev libvsqlitepp-dev libicu-dev asciidoc
apt-get install g++-6 cmake pkg-config libpoco-dev libxdg-basedir-dev \
libvsqlitepp-dev libboost-system-dev libboost-filesystem-dev libicu-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

@ -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, vsqlite++ >= 0.3, libicu >= 50.1")
"poco-netssl >= 1.6.1, libxdg-basedir, vsqlite++ >= 0.3.13, libicu-devel")
set(CPACK_PACKAGE_FILE_NAME
"${CPACK_PACKAGE_NAME}-${CPACK_PACKAGE_VERSION}-0.${CPACK_PACKAGE_ARCHITECTURE}")
set(CPACK_SOURCE_PACKAGE_FILE_NAME

View File

@ -9,5 +9,5 @@ Description: @PROJECT_DESCRIPTION@
Version: @PROJECT_VERSION@
Cflags: -I${includedir}
Libs: -L${libdir} -l${name} -lvsqlitepp -lstdc++fs
Requires.private: icu-uc, icu-i18n
Libs.private: -lPocoFoundation -lPocoNet -lPocoNetSSL
Requires.private: libxdg-basedir, icu-uc, icu-i18n
Libs.private: -lPocoNet -lPocoNetSSL -lPocoUtil

View File

@ -1,5 +1,7 @@
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)
@ -21,7 +23,7 @@ target_include_directories(${PROJECT_NAME}
"$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>")
target_link_libraries(${PROJECT_NAME}
PRIVATE ICU::uc ICU::i18n
PRIVATE PkgConfig::libxdg-basedir ICU::uc ICU::i18n
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 <exception>
#include <iostream>
#include <algorithm>
#include <Poco/Path.h>
#include <basedir.h>
#include <sqlite/execute.hpp>
#include <sqlite/query.hpp>
#include "time.hpp"
@ -33,7 +33,10 @@ namespace remwharead
{
try
{
_dbpath = Poco::Path::dataHome() / fs::path("remwharead");
xdgHandle xdg;
xdgInitHandle(&xdg);
_dbpath = xdgDataHome(&xdg) / fs::path("remwharead");
xdgWipeHandle(&xdg);
if (!fs::exists(_dbpath))
{