1
mirror of https://invent.kde.org/network/falkon.git synced 2024-12-20 02:36:34 +01:00

Fix building GnomeKeyring and KWallet password backend plugins

Also remove KDE/GNOME integration options and instead always build the plugins
when necessary dependencies are found.
This commit is contained in:
David Rosca 2017-09-26 15:19:55 +02:00
parent 02f7c68ec2
commit 2732aadda6
9 changed files with 32 additions and 56 deletions

View File

@ -33,11 +33,9 @@ Linux / Unix
To build KWallet plugin, you need:
- KF5 KWallet
- set KDE_INTEGRATION build flag
To build Gnome-Keyring plugin, you need
- libgnome-keyring-dev installed
- set GNOME_INTEGRATION build flag
For debug build, gdb is required by qmake.
@ -107,20 +105,6 @@ Available Defines
example:
$ export NO_X11="true"
KDE_INTEGRATION Enable KDE integration.
Currently it enables building of KWallet Password plugin,
which provides support for storing passwords in KWallet.
example:
$ export KDE_INTEGRATION="true"
GNOME_INTEGRATION Enable Gnome integration.
Currently it enables building of Gnome-Keyring Password plugin,
which provides support for storing passwords in Gnome-Keyring.
example:
$ export GNOME_INTEGRATION="true"
USE_LIBPATH By default, /usr/lib/ is used for libFalkon and /usr/lib/falkon
for plugins.
You can change it by setting this define.

View File

@ -36,20 +36,6 @@ option(NO_SYSTEM_DATAPATH "TODO" OFF)
if (NO_SYSTEM_DATAPATH)
add_definitions(-DNO_SYSTEM_DATAPATH)
endif()
option(KDE_INTEGRATION "TODO" OFF)
if (KDE_INTEGRATION)
set(KF5_MIN_VERSION "5.27.0")
find_package(KF5 ${KF5_MIN_VERSION} COMPONENTS Wallet)
add_definitions(-DKDE_INTEGRATION)
endif()
option(GNOME_INTEGRATION "TODO" OFF)
if (GNOME_INTEGRATION)
find_package(PkgConfig)
if (PKG_CONFIG_FOUND)
pkg_check_modules(GNOME_KEYRING gnome-keyring-1)
endif()
add_definitions(-DGNOME_INTEGRATION)
endif()
option(NO_X11 "TODO" OFF)
if (NO_X11)
add_definitions(-DNO_X11)
@ -98,6 +84,16 @@ if (WIN32)
# TODO set var for LIBS += User32.lib Ole32.lib Shell32.lib ShlWapi.lib Gdi32.lib ComCtl32.lib ?
endif()
# Optional: GnomeKeyring
find_package(PkgConfig)
if (PKG_CONFIG_FOUND)
pkg_check_modules(GNOME_KEYRING gnome-keyring-1)
endif()
# Optional: KWallet
set(KF5_MIN_VERSION "5.27.0")
find_package(KF5 ${KF5_MIN_VERSION} COMPONENTS Wallet)
# Git revision
if (EXISTS "${CMAKE_SOURCE_DIR}/.git")
find_package(Git QUIET)

View File

@ -6,28 +6,21 @@ set(CMAKE_RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/bin/plugins")
add_subdirectory(AutoScroll)
add_subdirectory(FlashCookieManager)
# GnomeKeyringPasswords only with GNOME_INTEGRATION and gnome-keyring pkg-config
if (GNOME_INTEGRATION AND GNOME_KEYRING_FOUND)
add_subdirectory(GnomeKeyringPasswords)
endif()
add_subdirectory(GreaseMonkey)
add_subdirectory(ImageFinder)
# KWalletPasswords only with KDE_INTEGRATION and KWallet framework
if (KDE_INTEGRATION AND KF5Wallet_FOUND)
add_subdirectory(KWalletPasswords)
endif()
add_subdirectory(MouseGestures)
add_subdirectory(PIM)
add_subdirectory(StatusBarIcons)
add_subdirectory(TabManager)
# TestPlugin only in debug build
if (GNOME_KEYRING_FOUND)
add_subdirectory(GnomeKeyringPasswords)
endif()
if (KF5Wallet_FOUND)
add_subdirectory(KWalletPasswords)
endif()
if (CMAKE_BUILD_TYPE STREQUAL "Debug")
add_subdirectory(TestPlugin)
endif()
# Not ported to cmake, for lack of a testcase: addSubdir($$(FALKON_PLUGINS_SRCDIR))

View File

@ -1,4 +1,4 @@
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${GNOME_KEYRING_CFLAGS}")
add_definitions(${GNOME_KEYRING_CFLAGS} ${GNOME_KEYRING_CFLAGS_OTHER})
set( GnomeKeyringPasswords_SRCS
gnomekeyringplugin.cpp

View File

@ -23,7 +23,7 @@
#include "passwordbackends/passwordbackend.h"
#include "passwordmanager.h"
class GnomeKeyringPasswordBackend : public PasswordBackend
class FALKON_EXPORT GnomeKeyringPasswordBackend : public PasswordBackend
{
public:
explicit GnomeKeyringPasswordBackend();

View File

@ -10,5 +10,5 @@ qt5_add_resources(RSCS ${KWalletPasswords_RSCS})
add_library(KWalletPasswords MODULE ${KWalletPasswords_SRCS} ${RSCS})
install(TARGETS KWalletPasswords DESTINATION ${KDE_INSTALL_PLUGINDIR})
target_link_libraries(KWalletPasswords KF5::KWallet)
target_link_libraries(KWalletPasswords FalkonPrivate KF5::Wallet)

View File

@ -27,7 +27,7 @@ namespace KWallet {
class Wallet;
}
class KWalletPasswordBackend : public PasswordBackend
class FALKON_EXPORT KWalletPasswordBackend : public PasswordBackend
{
public:
explicit KWalletPasswordBackend();

View File

@ -1,13 +1,17 @@
set(autotests_EXTRA_LIBS )
if (KDE_INTEGRATION AND KF5Wallet_FOUND)
if (KF5Wallet_FOUND)
add_definitions(-DHAVE_KDE_PASSWORDS_PLUGIN)
set(autotests_EXTRA_LIBS ${autotests_EXTRA_LIBS} ${CMAKE_BINARY_DIR}/bin/plugins/libKWalletPasswords.so)
add_library(KWalletPasswordsPluginLib UNKNOWN IMPORTED)
set_property(TARGET KWalletPasswordsPluginLib PROPERTY IMPORTED_LOCATION ${CMAKE_BINARY_DIR}/bin/plugins/KWalletPasswords.so)
set(autotests_EXTRA_LIBS ${autotests_EXTRA_LIBS} KWalletPasswordsPluginLib)
endif()
if (GNOME_INTEGRATION AND GNOME_KEYRING_FOUND)
if (GNOME_KEYRING_FOUND)
add_definitions(-DHAVE_GNOME_PASSWORDS_PLUGIN)
set(autotests_EXTRA_LIBS ${autotests_EXTRA_LIBS} ${CMAKE_BINARY_DIR}/bin/plugins/libGnomeKeyringPasswords.so)
add_library(GnomeKeyringPasswordsPluginLib UNKNOWN IMPORTED)
set_property(TARGET GnomeKeyringPasswordsPluginLib PROPERTY IMPORTED_LOCATION ${CMAKE_BINARY_DIR}/bin/plugins/GnomeKeyringPasswords.so)
set(autotests_EXTRA_LIBS ${autotests_EXTRA_LIBS} GnomeKeyringPasswordsPluginLib)
endif()
set( autotests_SRCS
@ -20,5 +24,4 @@ set( autotests_SRCS
)
add_executable(autotests ${autotests_SRCS})
target_link_libraries(autotests FalkonPrivate Qt5::Test)
target_link_libraries(autotests FalkonPrivate Qt5::Test ${autotests_EXTRA_LIBS})

View File

@ -274,7 +274,7 @@ void DatabaseEncryptedPasswordBackendTest::cleanup()
#ifdef HAVE_KDE_PASSWORDS_PLUGIN
// KWalletPassswordBackendTest
void KWalletPassswordBackendTest::init()
void KWalletPasswordBackendTest::init()
{
QDBusMessage msg = QDBusMessage::createMethodCall(QStringLiteral("org.freedesktop.DBus"),
QStringLiteral("/org/freedesktop/DBus"),