diff options
author | Marek Szuba <marecki@gentoo.org> | 2023-08-22 19:10:00 +0100 |
---|---|---|
committer | Marek Szuba <marecki@gentoo.org> | 2023-08-22 19:12:37 +0100 |
commit | 81cd2d1eea86b73703fda5bd4b19dde5e7d250aa (patch) | |
tree | 24986da24d78578e4e4bbd2d85662856768a3752 /mail-mta | |
parent | dev-libs/simdjson: add 3.2.3, drop 3.2.2 (diff) | |
download | gentoo-81cd2d1eea86b73703fda5bd4b19dde5e7d250aa.tar.gz gentoo-81cd2d1eea86b73703fda5bd4b19dde5e7d250aa.tar.bz2 gentoo-81cd2d1eea86b73703fda5bd4b19dde5e7d250aa.zip |
mail-mta/proton-mail-bridge: implement GUI building
Fun fact, while the bridge proper is still written in Go the current
version of the bridge GUI has been rewritten to C++. I am sure there is
a lesson in here somewhere.
Signed-off-by: Marek Szuba <marecki@gentoo.org>
Diffstat (limited to 'mail-mta')
3 files changed, 119 insertions, 29 deletions
diff --git a/mail-mta/proton-mail-bridge/files/proton-mail-bridge-3.3.2-gui_gentoo.patch b/mail-mta/proton-mail-bridge/files/proton-mail-bridge-3.3.2-gui_gentoo.patch new file mode 100644 index 000000000000..6bf34627039f --- /dev/null +++ b/mail-mta/proton-mail-bridge/files/proton-mail-bridge-3.3.2-gui_gentoo.patch @@ -0,0 +1,68 @@ +--- a/internal/frontend/bridge-gui/bridge-gui/CMakeLists.txt ++++ b/internal/frontend/bridge-gui/bridge-gui/CMakeLists.txt +@@ -165,12 +165,9 @@ + WIN32_EXECUTABLE TRUE + MACOSX_BUNDLE TRUE) + +-install(TARGETS bridge-gui +- RUNTIME DESTINATION "${CMAKE_INSTALL_PREFIX}" +- BUNDLE DESTINATION "${CMAKE_INSTALL_PREFIX}" +- LIBRARY DESTINATION "${CMAKE_INSTALL_PREFIX}" +- ) ++install(TARGETS bridge-gui) + ++if(0) + qt_generate_deploy_app_script( + TARGET bridge-gui + FILENAME_VARIABLE deploy_script +@@ -185,3 +182,4 @@ + endif() + + include(Deploy${DEPLOY_OS}.cmake) ++endif() +--- a/internal/frontend/bridge-gui/bridge-gui/main.cpp ++++ b/internal/frontend/bridge-gui/bridge-gui/main.cpp +@@ -53,7 +53,7 @@ + + QString const bridgeLock = "bridge-v3.lock"; ///< The file name used for the bridge-gui lock file. + QString const bridgeGUILock = "bridge-v3-gui.lock"; ///< The file name used for the bridge-gui lock file. +-QString const exeName = "bridge" + exeSuffix; ///< The bridge executable file name.* ++QString const exeName = "proton-mail-bridge" + exeSuffix; ///< The bridge executable file name.* + qint64 const grpcServiceConfigWaitDelayMs = 180000; ///< The wait delay for the gRPC config file in milliseconds. + QString const waitFlag = "--wait"; ///< The wait command-line flag. + +--- a/internal/frontend/bridge-gui/bridgepp/CMakeLists.txt ++++ b/internal/frontend/bridge-gui/bridgepp/CMakeLists.txt +@@ -161,6 +161,9 @@ + + target_precompile_headers(bridgepp PRIVATE Pch.h) + ++install(TARGETS bridgepp) ++ ++if(0) + #***************************************************************************************************************************************************** + # GoogleTest + #***************************************************************************************************************************************************** +@@ -198,3 +201,4 @@ + + include(GoogleTest) + gtest_discover_tests(bridgepp-test) ++endif() +--- a/internal/frontend/bridge-gui/BridgeSetup.cmake ++++ b/internal/frontend/bridge-gui/BridgeSetup.cmake +@@ -45,6 +45,7 @@ + endif() + + ++if(0) + #**************************************************************************************************************************************************** + # vcpkg, toolchain, and architecture + #**************************************************************************************************************************************************** +@@ -87,4 +88,5 @@ + set(VCPKG_TARGET_TRIPLET x64-windows) + endif() + +-set(CMAKE_TOOLCHAIN_FILE "${VCPKG_ROOT}/scripts/buildsystems/vcpkg.cmake" CACHE STRING "toolchain") +\ No newline at end of file ++set(CMAKE_TOOLCHAIN_FILE "${VCPKG_ROOT}/scripts/buildsystems/vcpkg.cmake" CACHE STRING "toolchain") ++endif() diff --git a/mail-mta/proton-mail-bridge/files/proton-mail-bridge-3.3.2-telemetry_default.patch b/mail-mta/proton-mail-bridge/files/proton-mail-bridge-3.3.2-telemetry_default.patch deleted file mode 100644 index 3c8df6c2ef9d..000000000000 --- a/mail-mta/proton-mail-bridge/files/proton-mail-bridge-3.3.2-telemetry_default.patch +++ /dev/null @@ -1,14 +0,0 @@ -Such things really should be opt-in rather than opt-out, and doubly so given -Gentoo does not package the bridge GUI yet. - ---- a/internal/vault/types_settings.go -+++ b/internal/vault/types_settings.go -@@ -96,7 +96,7 @@ - ShowAllMail: true, - Autostart: true, - AutoUpdate: true, -- TelemetryDisabled: false, -+ TelemetryDisabled: true, - - LastVersion: "0.0.0", - FirstStart: true, diff --git a/mail-mta/proton-mail-bridge/proton-mail-bridge-3.3.2.ebuild b/mail-mta/proton-mail-bridge/proton-mail-bridge-3.3.2.ebuild index 7d85059d6295..013049b4d5c9 100644 --- a/mail-mta/proton-mail-bridge/proton-mail-bridge-3.3.2.ebuild +++ b/mail-mta/proton-mail-bridge/proton-mail-bridge-3.3.2.ebuild @@ -3,7 +3,7 @@ EAPI=8 -inherit go-module systemd xdg-utils +inherit cmake go-module systemd xdg-utils MY_PN="${PN/-mail/}" MY_P="${MY_PN}-${PV}" @@ -22,11 +22,21 @@ IUSE="gui" PROPERTIES="test_network" RESTRICT="test" -RDEPEND="app-crypt/libsecret" +RDEPEND="app-crypt/libsecret + gui? ( + >=dev-libs/protobuf-21.12:= + dev-libs/sentry-native + dev-qt/qtbase:6=[gui,icu,widgets] + dev-qt/qtdeclarative:6=[widgets] + dev-qt/qtsvg:6= + media-libs/mesa + net-libs/grpc:= + ) +" DEPEND="${RDEPEND}" PATCHES=( - "${FILESDIR}"/${PN}-3.3.2-telemetry_default.patch + "${FILESDIR}"/${PN}-3.3.2-gui_gentoo.patch ) S="${WORKDIR}"/${MY_P} @@ -34,14 +44,39 @@ S="${WORKDIR}"/${MY_P} src_prepare() { xdg_environment_reset default + if use gui; then + local PATCHES=() + BUILD_DIR="${WORKDIR}"/gui_build \ + CMAKE_USE_DIR="${S}"/internal/frontend/bridge-gui/bridge-gui \ + cmake_src_prepare + fi +} + +src_configure() { + if use gui; then + # TODO: + # - auto-sync version number between the two executables + # - can we leave BRIDGE_TAG unset? Seems it gets displayed in some info box + local mycmakeargs=( + -DBRIDGE_APP_FULL_NAME="Proton Mail Bridge" + -DBRIDGE_APP_VERSION="${PV}+git" + -DBRIDGE_REPO_ROOT="${S}" + -DBRIDGE_TAG="NOTAG" + -DBRIDGE_VENDOR="Gentoo Linux" + ) + BUILD_DIR="${WORKDIR}"/gui_build \ + CMAKE_USE_DIR="${S}"/internal/frontend/bridge-gui/bridge-gui \ + cmake_src_configure + fi } src_compile() { + emake build-nogui + if use gui; then - eerror "Since version 3.0.0, GUI support in ${PN} requires Qt6 and is therefore currently not available" - die "USE=gui requires Qt6" - else - emake build-nogui + BUILD_DIR="${WORKDIR}"/gui_build \ + CMAKE_USE_DIR="${S}"/internal/frontend/bridge-gui/bridge-gui \ + cmake_src_compile fi } @@ -53,31 +88,32 @@ src_install() { exeinto /usr/bin newexe bridge ${PN} + if use gui; then + BUILD_DIR="${WORKDIR}"/gui_build \ + CMAKE_USE_DIR="${S}"/internal/frontend/bridge-gui/bridge-gui \ + cmake_src_install + mv "${ED}"/usr/bin/bridge-gui "${ED}"/usr/bin/${PN}-gui || die + fi + systemd_newuserunit "${FILESDIR}"/${PN}.service-r1 ${PN}.service einstalldocs } pkg_postinst() { - use gui && xdg_icon_cache_update - if [[ -n "${REPLACING_VERSIONS}" ]]; then local oldver for oldver in ${REPLACING_VERSIONS}; do if ver_test "${oldver}" -lt 3.2.0; then - ewarn "Please note that since version 3.2.0, ${PN} can share usage statistics with upstream." + ewarn "Please note that since version 3.2.0, ${PN} by default shares usage statistics with upstream." ewarn "For details, please see" ewarn ewarn " https://proton.me/support/share-usage-statistics" ewarn - ewarn "Gentoo ebuilds change the default value of the 'send telemetry' setting to disabled." + ewarn "This behaviour can be disabled through ${PN}-gui, under Advanced Settings." ewarn break fi done fi } - -pkg_postrm() { - use gui && xdg_icon_cache_update -} |