From 0307f8e9ef4055b1858f86a668c6ad4a222f9e43 Mon Sep 17 00:00:00 2001 From: Nicolas Werner Date: Sun, 12 Dec 2021 02:30:39 +0100 Subject: [PATCH] Add Qtkeychain wrap --- .gitignore | 4 +++- .gitlab-ci.yml | 5 +++++ meson.build | 26 +++++++++++++++++++++++++- subprojects/QtKeychain.wrap | 6 ++++++ subprojects/libsecret.wrap | 10 ++++++++++ 5 files changed, 49 insertions(+), 2 deletions(-) create mode 100644 subprojects/QtKeychain.wrap create mode 100644 subprojects/libsecret.wrap diff --git a/.gitignore b/.gitignore index 086ff9b9..42fca0ce 100644 --- a/.gitignore +++ b/.gitignore @@ -12,12 +12,14 @@ cscope* subprojects/Olm.wrap subprojects/Olm/ +subprojects/cmark-*/ subprojects/coeurl.wrap subprojects/coeurl/ subprojects/curl-*/ subprojects/curl.wrap subprojects/libevent-*/ subprojects/libevent.wrap +subprojects/libsecret-*/ subprojects/lmdb++/ subprojects/lmdb-LMDB_*/ subprojects/nlohmann_json-*/ @@ -25,8 +27,8 @@ subprojects/nlohmann_json.wrap subprojects/openssl-*/ subprojects/openssl.wrap subprojects/packagecache/ +subprojects/qtkeychain-*/ subprojects/spdlog-*/ -subprojects/cmark-*/ # GTAGS GTAGS diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index d6092dce..eec526f9 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -41,6 +41,7 @@ build-gcc9-meson: - meson compile -C builddir cache: key: "$CI_JOB_NAME" + when: 'always' paths: - .ccache - subprojects/packagecache/ @@ -74,6 +75,7 @@ build-gcc9: - mv ../.hunter .hunter cache: key: "$CI_JOB_NAME" + when: 'always' paths: - .hunter/ - .ccache @@ -111,6 +113,7 @@ build-macos: public: false cache: key: "${CI_JOB_NAME}" + when: 'always' paths: - .hunter/ - "${CCACHE_DIR}" @@ -161,6 +164,7 @@ build-flatpak-amd64: - bash ./.ci/upload-nightly-gitlab.sh build-flatpak/nheko-amd64.flatpak cache: key: "$CI_JOB_NAME" + when: 'always' paths: - build-flatpak/.flatpak-builder/ artifacts: @@ -192,6 +196,7 @@ build-flatpak-arm64: - bash ./.ci/upload-nightly-gitlab.sh build-flatpak/nheko-arm64.flatpak cache: key: "$CI_JOB_NAME" + when: 'always' paths: - build-flatpak/.flatpak-builder/ artifacts: diff --git a/meson.build b/meson.build index 4e227523..9e4c5e2a 100644 --- a/meson.build +++ b/meson.build @@ -20,7 +20,6 @@ deps = [ dependency('spdlog'), dependency('cmark'), dependency('lmdb'), - dependency('Qt5Keychain'), dependency('threads'), ] @@ -46,6 +45,31 @@ if not lmdbxx_dep.found() endif deps += lmdbxx_dep +qtkeychain_dep = dependency('Qt5Keychain', required: get_option('wrap_mode') == 'nofallback') +if (not qtkeychain_dep.found() + or get_option('wrap_mode') == 'forcefallback' + or 'QtKeychain' in get_option('force_fallback_for')) + cmake = import('cmake') + qtkeychain_options = cmake.subproject_options() + qtkeychain_options.add_cmake_defines({ + 'BUILD_SHARED_LIBS': false, + }) + if target_machine.system() != 'windows' + qtkeychain_options.add_cmake_defines({ + 'CMAKE_C_FLAGS': '-fPIC', + }) + endif + qtkeychain_options.set_override_option('werror', 'false') + qtkeychain_options.set_override_option('warning_level', '0') + qtkeychain_proj = cmake.subproject('QtKeychain', options: qtkeychain_options) + qtkeychain_dep = qtkeychain_proj.dependency('qt5keychain') + + if target_machine.system() == 'linux' or target_machine.system() == 'freebsd' or target_machine.system() == 'netbsd' or target_machine.system() == 'openbsd' or target_machine.system() == 'dragonfly' + deps += dependency('libsecret-1', default_options: ['manpage=false', 'vapi=false', 'gtk_doc=false', 'introspection=false',]) # 'bash_completion=disabled']) + endif +endif +deps += qtkeychain_dep + backtrace_check = '''#include #ifndef HAVE_BACKTRACE_SYMBOLS_FD #error "No backtrace support" diff --git a/subprojects/QtKeychain.wrap b/subprojects/QtKeychain.wrap new file mode 100644 index 00000000..b4679099 --- /dev/null +++ b/subprojects/QtKeychain.wrap @@ -0,0 +1,6 @@ +[wrap-file] +directory = qtkeychain-0.13.2 + +source_url = https://github.com/frankosterfeld/qtkeychain/archive/refs/tags/v0.13.2.tar.gz +source_filename = qtkeychain-0.13.2.tar.gz +source_hash = 20beeb32de7c4eb0af9039b21e18370faf847ac8697ab3045906076afbc4caa5 diff --git a/subprojects/libsecret.wrap b/subprojects/libsecret.wrap new file mode 100644 index 00000000..719cc923 --- /dev/null +++ b/subprojects/libsecret.wrap @@ -0,0 +1,10 @@ +[wrap-file] +directory = libsecret-0.20.4 + +source_url = https://gitlab.gnome.org/GNOME/libsecret/-/archive/0.20.4/libsecret-0.20.4.tar.gz +source_filename = libsecret-0.20.4.tar.gz +source_hash = ca34e69b210df221ae5da6692c2cb15ef169bb4daf42e204442f24fdb0520d4b + +[provide] +libsecret-1 = libsecret_dep +