1
0
mirror of https://github.com/QRouland/UTPass.git synced 2025-01-24 07:36:39 +00:00

Setup git libs for Pass plugin

This commit is contained in:
Quentin Rouland 2025-01-07 20:55:30 +01:00
parent 7418894456
commit d33932be6d
7 changed files with 27 additions and 22 deletions

View File

@ -28,7 +28,7 @@ set(PROJECT_NAME "UTPass")
set(FULL_PROJECT_NAME "utpass.qrouland")
set(CMAKE_INSTALL_PREFIX /)
set(DATA_DIR /)
# set(BIN_DIR ${DATA_DIR}lib/bin)
set(DESKTOP_FILE_NAME ${PROJECT_NAME}.desktop)
add_executable(${PROJECT_NAME} main.cpp)
@ -41,7 +41,6 @@ configure_file(${CMAKE_CURRENT_BINARY_DIR}/manifest.json ${CMAKE_CURRENT_BINARY_
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/manifest.json DESTINATION ${CMAKE_INSTALL_PREFIX})
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/manifest_.json DESTINATION ${DATA_DIR})
#install(DIRECTORY desktop DESTINATION ${DATA_DIR})
install(FILES ${PROJECT_NAME}.apparmor DESTINATION ${DATA_DIR})
install(FILES ${PROJECT_NAME}.contenthub DESTINATION ${DATA_DIR})
@ -49,14 +48,6 @@ install(FILES LICENSE DESTINATION ${DATA_DIR})
install(DIRECTORY qml DESTINATION ${DATA_DIR})
install(DIRECTORY assets DESTINATION ${DATA_DIR})
# file(GLOB_RECURSE BIN_FILES
# "/usr/bin/gpg*"
# )
# install(
# FILES ${BIN_FILES}
# PERMISSIONS OWNER_EXECUTE OWNER_READ GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE
# DESTINATION ${BIN_DIR}
# )
# Translations
file(GLOB_RECURSE I18N_SRC_FILES RELATIVE ${CMAKE_CURRENT_SOURCE_DIR}/po qml/*.qml qml/*.js)

View File

@ -17,12 +17,17 @@ dependencies_target:
install_lib:
- "libgpg-error.so.0.28.0"
- "libassuan.so"
- "libgpgme.so"
- "libgpgmepp.so"
- "libqgpgme.so.7"
- "libgit2.so"
- "libquazip5.so"
- "libassuan.so*"
- "libgpgme.so*"
- "libgpgmepp.so*"
- "libqgpgme.so*"
- "libgit2.so*"
- "libquazip5.so*"
- "libmbedtls.so*"
- "libmbedx509.so*"
- "libmbedcrypto.so*"
- "libhttp_parser.so*"
- "libssh2.so*"
install_bin:
- "gpg"

View File

@ -20,7 +20,13 @@ Git::~Git() {
git_libgit2_shutdown();
}
bool Git::clone(QString url)
{
return false;
bool Git::clone(QString url, QString path) {
git_repository *repo = NULL;
git_clone_options opts = GIT_CLONE_OPTIONS_INIT;
int ret = git_clone(&repo, url.toLocal8Bit().data(), path.toLocal8Bit().data(), &opts);
if (repo) {
git_repository_free(repo);
}
return ret == 0; // TODO better error handling to return specifics errors for the ui
}

View File

@ -21,7 +21,7 @@ public:
Git(Git const &) = delete;
void operator=(Git const &) = delete;
bool clone(QString url);
bool clone(QString url, QString path);
};
#endif

View File

@ -70,5 +70,5 @@ QString Pass::getPasswordStore()
bool Pass::gitClone(QString url)
{
qInfo() << "Cloning . password_store from " << url;
return Git::instance()->clone(url);
return Git::instance()->clone(url, m_password_store);
}

View File

@ -7,7 +7,6 @@
#include <QEventLoop>
#include <QSemaphore>
#include <gpgme++/interfaces/passphraseprovider.h>
#include "passphraseprovider.h"
#include "gpg.h"

View File

@ -23,6 +23,10 @@ add_library(${PLUGIN} MODULE ${SRC})
set_target_properties(${PLUGIN} PROPERTIES LIBRARY_OUTPUT_DIRECTORY ${PLUGIN})
qt5_use_modules(${PLUGIN} Qml Quick DBus)
add_library(libquazip5 SHARED IMPORTED)
set_property(TARGET libquazip5 PROPERTY IMPORTED_LOCATION "/usr/lib/${ARCH_TRIPLET}/libquazip5.so")
target_link_libraries(${PLUGIN} libquazip5)
set(QT_IMPORTS_DIR "/lib/${ARCH_TRIPLET}")