diff --git a/gnu/local.mk b/gnu/local.mk index 27b31ea27f..f747653a6f 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -1341,7 +1341,8 @@ dist_patch_DATA = \ %D%/packages/patches/irrlicht-link-against-needed-libs.patch \ %D%/packages/patches/isl-0.11.1-aarch64-support.patch \ %D%/packages/patches/itk-snap-alt-glibc-compat.patch \ - %D%/packages/patches/jami-fix-crash-on-block-contact.patch \ + %D%/packages/patches/jami-disable-integration-tests.patch \ + %D%/packages/patches/jami-no-webengine.patch \ %D%/packages/patches/jamvm-1.5.1-aarch64-support.patch \ %D%/packages/patches/jamvm-1.5.1-armv7-support.patch \ %D%/packages/patches/jamvm-2.0.0-aarch64-support.patch \ diff --git a/gnu/packages/jami.scm b/gnu/packages/jami.scm index 54cf2b30fa..7849a36e27 100644 --- a/gnu/packages/jami.scm +++ b/gnu/packages/jami.scm @@ -69,7 +69,7 @@ #:use-module (guix packages) #:use-module (guix utils)) -(define %jami-version "20220825.0828.c10f01f") +(define %jami-version "20221031.1308.130cc26") (define %jami-sources ;; Return an origin object of the tarball release sources archive of the @@ -93,8 +93,9 @@ "plugins")))) (sha256 (base32 - "1iv06jb66g206qxm75v7rc3mqvrml1028avflsj11chj8jh63j14")) - (patches (search-patches "jami-fix-crash-on-block-contact.patch")))) + "0hbsjjs61n7268lyjnjb9lzfpkkd65fmz76l1bg4awlz1f3cyywm")) + (patches (search-patches "jami-disable-integration-tests.patch" + "jami-no-webengine.patch")))) ;; Jami maintains a set of patches for some key dependencies (currently ;; pjproject and ffmpeg) of Jami that haven't yet been integrated upstream. @@ -116,8 +117,8 @@ patches)))) (define-public pjproject-jami - (let ((commit "5e478bbf8692f43059de9c6ad654b377359baaa0") - (revision "0")) + (let ((commit "513a3f14c44b2c2652f9219ec20dea64b236b713") + (revision "1")) (package (inherit pjproject) (name "pjproject-jami") @@ -136,7 +137,7 @@ (file-name (git-file-name name version)) (sha256 (base32 - "0n9hyqr57hhbmq35iqq5ihavj22gxzsspv0f8i6ajxwd4029nmcl")))) + "1vzfpiwhd96a9ibk398z922a60j18xd7mblsmi6355r7ccj2aw7p")))) (arguments (substitute-keyword-arguments (package-arguments pjproject) ((#:phases phases '%standard-phases) @@ -416,7 +417,10 @@ (substitute* "tests/fate/lavf-container.mak" (("mov mov_rtphint ismv") "mov ismv") - (("fate-lavf-mov_rtphint:.*") "")))))))))) + (("fate-lavf-mov_rtphint:.*") "")))))))) + (inputs (modify-inputs (package-inputs ffmpeg-5) + (replace "libvpx" libvpx-next) + (replace "libx264" libx264-next))))) (define-public libjami (package @@ -427,28 +431,26 @@ (build-system gnu-build-system) (arguments (list - ;; The test suite fails to link when building libjami as a shared - ;; library: "sip_account/sip_empty_offer.cpp:228:1: error: no - ;; declaration matches ‘void - ;; jami::test::SipEmptyOfferTest::onCallStateChange(const string&, const - ;; string&, jami::test::CallData&)’". - #:tests? #f ;; The agent links the daemon binary with libguile, which enables the ;; execution of test plans described in Scheme. It may be useful in ;; user scripts too, until more general purpose Scheme bindings are made ;; available (see: test/agent/README.md). - #:configure-flags #~(list "--enable-agent" - "--enable-debug" - ;; Disable static libraries to avoid - ;; installing a 98 MiB archive. - "--disable-static") + #:configure-flags #~(list "--enable-agent" "--enable-debug") #:make-flags #~(list "V=1") ;build verbosely #:phases #~(modify-phases %standard-phases (add-after 'unpack 'change-directory/maybe (lambda _ ;; Allow building from the tarball or a git checkout. - (false-if-exception (chdir "daemon"))))))) + (false-if-exception (chdir "daemon")))) + (add-after 'install 'delete-static-libraries + ;; Remove 100+ MiB of static libraries. "--disable-static" cannot + ;; be used as the test suite requires access to private symbols + ;; not included in the shared library. + (lambda _ + (for-each delete-file + (find-files (string-append #$output "/lib") + "\\.a$"))))))) (inputs (list alsa-lib asio @@ -502,19 +504,17 @@ protocols, as well as decentralized calling using P2P-DHT.") (arguments (list #:qtbase qtbase - #:tests? #f ;see comment below + ;; The test suite fails to build (see: + ;; https://git.jami.net/savoirfairelinux/jami-client-qt/-/issues/882). + #:tests? #f #:configure-flags - ;; The test suite fails to build with: - ;; "../../../client-qt/src/app/utils.h:29:10: fatal error: QLabel: No - ;; such file or directory". #~(list "-DENABLE_TESTS=OFF" - "-DWITH_WEBENGINE=OFF" ;reduce transitive closure size by 450 MiB + ;; Disable the webengine since it grows the closure size by + ;; about 450 MiB and requires more resources. + "-DWITH_WEBENGINE=OFF" ;; Use libwrap to link directly to libjami instead of ;; communicating via D-Bus to jamid, the Jami daemon. "-DENABLE_LIBWRAP=ON" - (string-append "-DLIBJAMI_XML_INTERFACES_DIR=" - #$(this-package-input "libjami") - "/share/dbus-1/interfaces") (string-append "-DLIBJAMI_INCLUDE_DIR=" #$(this-package-input "libjami") "/include/jami")) #:phases @@ -531,15 +531,7 @@ protocols, as well as decentralized calling using P2P-DHT.") (("// clang-format on.*" anchor) (string-append "const char VERSION_STRING[] = \"" #$version "\";\n" - anchor))))) - (add-after 'change-directory/maybe 'patch-source - (lambda _ - (substitute* "src/libclient/CMakeLists.txt" - ;; Fix submitted upstream (see: - ;; https://review.jami.net/c/jami-client-qt/+/21830). - (("target_link_libraries\\(\\$\\{LIBCLIENT_NAME} qtwrapper.*" all) - (string-append - all " target_link_libraries(${LIBCLIENT_NAME} avutil)\n")))))))) + anchor)))))))) (native-inputs (list googletest pkg-config diff --git a/gnu/packages/patches/jami-disable-integration-tests.patch b/gnu/packages/patches/jami-disable-integration-tests.patch new file mode 100644 index 0000000000..1efb7d552e --- /dev/null +++ b/gnu/packages/patches/jami-disable-integration-tests.patch @@ -0,0 +1,111 @@ +From 3fd7acc6e5a8c316c366827956d7c06affdc9685 Mon Sep 17 00:00:00 2001 +From: Olivier Dion +Date: Fri, 7 Oct 2022 15:20:37 -0400 +Subject: [PATCH] test/unitTest: Seperate pure tests from integration tests + +So we can now do `make check` in a reproducible way. + +To enable integration tests `./configure --enable-integration-tests`. + +Change-Id: Iaa68c77abade9fe78bae881abc25e034bcb6a067 +--- +With file names adjusted for the source tarball. + + configure.ac | 5 ++++ + test/unitTest/Makefile.am | 52 +++++++++++++++++++++------------------ + 2 files changed, 33 insertions(+), 24 deletions(-) + +diff --git a/configure.ac b/configure.ac +index 27215d044..aaeef1c1b 100644 +--- a/daemon/configure.ac ++++ b/daemon/configure.ac +@@ -40,6 +40,11 @@ AS_IF([test "x$enable_debug" = "xyes"], + [DAEMONCFLAGS+=" -DNDEBUG=1 -O3" + DAEMONCXXFLAGS+=" -DNDEBUG=1 -O3 -Wno-deprecated"]) + ++AC_ARG_ENABLE([enable_integration_tests], ++ AS_HELP_STRING([--enable-integration-tests], ++ [Also run integration tests with check target])) ++AM_CONDITIONAL([ENABLE_INTEGRATION_TESTS], [test "x$enable_integration_tests" = "xyes"]) ++ + AC_ARG_ENABLE([fuzzing], + AS_HELP_STRING([--enable-fuzzing], + [Build fuzzing tools])) +diff --git a/test/unitTest/Makefile.am b/test/unitTest/Makefile.am +index f2b0fd994..ab232ddb7 100644 +--- a/daemon/test/unitTest/Makefile.am ++++ b/daemon/test/unitTest/Makefile.am +@@ -13,30 +13,6 @@ check_PROGRAMS = + + ####### Unit Test ######## + +-# +-# account_factory +-# +-check_PROGRAMS += ut_account_factory +-ut_account_factory_SOURCES = account_factory/testAccount_factory.cpp common.cpp +- +-# +-# account_archive +-# +-check_PROGRAMS += ut_account_archive +-ut_account_archive_SOURCES = account_archive/account_archive.cpp common.cpp +- +-# +-# migration +-# +-check_PROGRAMS += ut_migration +-ut_migration_SOURCES = account_archive/migration.cpp common.cpp +- +-# +-# certstore +-# +-check_PROGRAMS += ut_certstore +-ut_certstore_SOURCES = certstore.cpp common.cpp +- + # + # scheduler + # +@@ -127,6 +103,32 @@ ut_video_scaler_SOURCES = media/video/test_video_scaler.cpp common.cpp + check_PROGRAMS += ut_audio_frame_resizer + ut_audio_frame_resizer_SOURCES = media/audio/test_audio_frame_resizer.cpp common.cpp + ++if ENABLE_INTEGRATION_TESTS ++ ++# ++# account_factory ++# ++check_PROGRAMS += ut_account_factory ++ut_account_factory_SOURCES = account_factory/testAccount_factory.cpp common.cpp ++ ++# ++# account_archive ++# ++check_PROGRAMS += ut_account_archive ++ut_account_archive_SOURCES = account_archive/account_archive.cpp common.cpp ++ ++# ++# migration ++# ++check_PROGRAMS += ut_migration ++ut_migration_SOURCES = account_archive/migration.cpp common.cpp ++ ++# ++# certstore ++# ++check_PROGRAMS += ut_certstore ++ut_certstore_SOURCES = certstore.cpp common.cpp ++ + # + # call + # +@@ -237,4 +239,6 @@ ut_sip_srtp_SOURCES = sip_account/sip_srtp.cpp + check_PROGRAMS += ut_plugins + ut_plugins_SOURCES = plugins/plugins.cpp common.cpp + ++endif # ENABLE_INTEGRATION_TESTS ++ + TESTS = $(check_PROGRAMS) +-- +2.37.3 + diff --git a/gnu/packages/patches/jami-fix-crash-on-block-contact.patch b/gnu/packages/patches/jami-fix-crash-on-block-contact.patch deleted file mode 100644 index 60dab79296..0000000000 --- a/gnu/packages/patches/jami-fix-crash-on-block-contact.patch +++ /dev/null @@ -1,32 +0,0 @@ -From 673dc5f525c9d478fc22f8ea0a50d9849a81f6c8 Mon Sep 17 00:00:00 2001 -From: Kateryna Kostiuk -Date: Fri, 2 Sep 2022 13:32:10 -0400 -Subject: [PATCH] conversation: fix crash when block contact - -This patch fixes crash that happened when block contact -for not active account. - -GitLab: #758 -Change-Id: I5347394a67cdffe0d95c9ee03aedf9d2618cec55 ---- - src/jamidht/jamiaccount.cpp | 4 +++- - 1 file changed, 3 insertions(+), 1 deletion(-) - -diff --git a/daemon/src/jamidht/jamiaccount.cpp b/daemon/src/jamidht/jamiaccount.cpp -index fe15eedb2..9d0a5ee68 100644 ---- a/daemon/src/jamidht/jamiaccount.cpp -+++ b/daemon/src/jamidht/jamiaccount.cpp -@@ -1129,7 +1129,9 @@ JamiAccount::loadAccount(const std::string& archive_password, - if (auto convModule = shared->convModule()) - convModule->removeContact(uri, banned); - // Remove current connections with contact -- shared->connectionManager_->closeConnectionsWith(uri); -+ if (shared->connectionManager_) { -+ shared->connectionManager_->closeConnectionsWith(uri); -+ } - // Update client. - emitSignal(shared->getAccountID(), - uri, --- -2.37.3 - diff --git a/gnu/packages/patches/jami-no-webengine.patch b/gnu/packages/patches/jami-no-webengine.patch new file mode 100644 index 0000000000..f26cd8e3f5 --- /dev/null +++ b/gnu/packages/patches/jami-no-webengine.patch @@ -0,0 +1,243 @@ +From 1f73d3c88e94f2d932c59cab8a02c72a325ccc20 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?S=C3=A9bastien=20Blin?= + +Date: Fri, 11 Nov 2022 16:19:11 -0500 +Subject: [PATCH] misc: fix build without webengine + +Change-Id: I2511cd89e1ce7f60424f69ab6576d7fb992dd58c +GitLab: #881 +--- + .../components/DocumentsScrollview.qml | 1 - + src/app/mainview/components/FilePreview.qml | 1 - + src/app/mainview/components/MediaPreview.qml | 57 ++-------------- + .../mainview/components/SwarmDetailsPanel.qml | 1 - + src/app/nowebengine/VideoPreview.qml | 24 +++++++ + src/app/webengine/VideoPreview.qml | 68 +++++++++++++++++++ + 6 files changed, 99 insertions(+), 53 deletions(-) + create mode 100644 src/app/nowebengine/VideoPreview.qml + create mode 100644 src/app/webengine/VideoPreview.qml + +diff --git a/client-qt/src/app/mainview/components/DocumentsScrollview.qml b/client-qt/src/app/mainview/components/DocumentsScrollview.qml +index df516961..3338536a 100644 +--- a/client-qt/src/app/mainview/components/DocumentsScrollview.qml ++++ b/client-qt/src/app/mainview/components/DocumentsScrollview.qml +@@ -20,7 +20,6 @@ import QtQuick.Controls + import QtQuick.Layouts + import Qt.labs.platform + import Qt5Compat.GraphicalEffects +-import QtWebEngine + + import net.jami.Models 1.1 + import net.jami.Adapters 1.1 +diff --git a/client-qt/src/app/mainview/components/FilePreview.qml b/client-qt/src/app/mainview/components/FilePreview.qml +index 57b1ec8b..fe8f3fd9 100644 +--- a/client-qt/src/app/mainview/components/FilePreview.qml ++++ b/client-qt/src/app/mainview/components/FilePreview.qml +@@ -19,7 +19,6 @@ import QtQuick.Controls + import QtQuick.Layouts + import Qt.labs.platform + import Qt5Compat.GraphicalEffects +-import QtWebEngine + + import net.jami.Models 1.1 + import net.jami.Adapters 1.1 +diff --git a/client-qt/src/app/mainview/components/MediaPreview.qml b/client-qt/src/app/mainview/components/MediaPreview.qml +index 0c33bf3e..965f9343 100644 +--- a/client-qt/src/app/mainview/components/MediaPreview.qml ++++ b/client-qt/src/app/mainview/components/MediaPreview.qml +@@ -19,7 +19,6 @@ import QtQuick.Controls + import QtQuick.Layouts + import Qt.labs.platform + import Qt5Compat.GraphicalEffects +-import QtWebEngine + + import net.jami.Models 1.1 + import net.jami.Adapters 1.1 +@@ -92,59 +91,17 @@ Component { + } + Component { + id: avMediaComp +- + Loader { +- property real msgRadius: 20 +- +- Rectangle { +- id: videoAudioRect +- color: JamiTheme.secondaryBackgroundColor +- anchors.fill: parent +- +- WebEngineView { +- id: wev +- +- property bool isVideo: mediaInfo.isVideo +- property string html: mediaInfo.html +- +- anchors.fill: parent +- anchors.verticalCenter: videoAudioRect.verticalCenter +- backgroundColor: JamiTheme.secondaryBackgroundColor +- anchors.topMargin: isVideo? 0 : wev.implicitHeight / 2 +- settings.fullScreenSupportEnabled: isVideo +- settings.javascriptCanOpenWindows: false +- Component.onCompleted: loadHtml(html, 'file://') +- onFullScreenRequested: function(request) { +- if (request.toggleOn) { +- layoutManager.pushFullScreenItem( +- this, +- videoAudioRect, +- null, +- function() { wev.fullScreenCancelled() }) +- } else if (!request.toggleOn) { +- layoutManager.removeFullScreenItem(this) +- } +- request.accept() +- } +- } +- +- layer.enabled: true +- layer.effect: OpacityMask { +- maskSource: Item { +- width: videoAudioRect.width +- height: videoAudioRect.height +- Rectangle { +- anchors.centerIn: parent +- width: videoAudioRect.width +- height: videoAudioRect.height +- radius: JamiTheme.swarmDetailsPageDocumentsMediaRadius +- } +- } +- } ++ Component.onCompleted: { ++ var qml = WITH_WEBENGINE ? ++ "qrc:/webengine/VideoPreview.qml" : ++ "qrc:/nowebengine/VideoPreview.qml" ++ setSource( qml, { isVideo: mediaInfo.isVideo, html:mediaInfo.html } ) + } ++ ++ property real msgRadius: 20 + } + } +- + Component { + id: imageMediaComp + +diff --git a/client-qt/src/app/mainview/components/SwarmDetailsPanel.qml b/client-qt/src/app/mainview/components/SwarmDetailsPanel.qml +index 0dd93bc2..7625a76e 100644 +--- a/client-qt/src/app/mainview/components/SwarmDetailsPanel.qml ++++ b/client-qt/src/app/mainview/components/SwarmDetailsPanel.qml +@@ -21,7 +21,6 @@ import QtQuick.Controls + import QtQuick.Layouts + import Qt.labs.platform + import Qt5Compat.GraphicalEffects +-import QtWebEngine + + import net.jami.Models 1.1 + import net.jami.Adapters 1.1 +diff --git a/client-qt/src/app/nowebengine/VideoPreview.qml b/client-qt/src/app/nowebengine/VideoPreview.qml +new file mode 100644 +index 00000000..8c2e8a4f +--- /dev/null ++++ b/client-qt/src/app/nowebengine/VideoPreview.qml +@@ -0,0 +1,24 @@ ++/* ++ * Copyright (C) 2022 Savoir-faire Linux Inc. ++ * ++ * This program is free software; you can redistribute it and/or modify ++ * it under the terms of the GNU General Public License as published by ++ * the Free Software Foundation; either version 3 of the License, or ++ * (at your option) any later version. ++ * ++ * This program is distributed in the hope that it will be useful, ++ * but WITHOUT ANY WARRANTY; without even the implied warranty of ++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ * GNU General Public License for more details. ++ * ++ * You should have received a copy of the GNU General Public License ++ * along with this program. If not, see . ++ */ ++ ++import QtQuick ++import QtQuick.Controls ++import QtQuick.Layouts ++ ++Rectangle { ++ property var mediaInfo: undefined ++} +\ No newline at end of file +diff --git a/client-qt/src/app/webengine/VideoPreview.qml b/client-qt/src/app/webengine/VideoPreview.qml +new file mode 100644 +index 00000000..edc03599 +--- /dev/null ++++ b/client-qt/src/app/webengine/VideoPreview.qml +@@ -0,0 +1,68 @@ ++/* ++ * Copyright (C) 2022 Savoir-faire Linux Inc. ++ * ++ * This program is free software; you can redistribute it and/or modify ++ * it under the terms of the GNU General Public License as published by ++ * the Free Software Foundation; either version 3 of the License, or ++ * (at your option) any later version. ++ * ++ * This program is distributed in the hope that it will be useful, ++ * but WITHOUT ANY WARRANTY; without even the implied warranty of ++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ * GNU General Public License for more details. ++ * ++ * You should have received a copy of the GNU General Public License ++ * along with this program. If not, see . ++ */ ++ ++import QtQuick ++import QtWebEngine ++import Qt5Compat.GraphicalEffects ++ ++import net.jami.Constants 1.1 ++ ++Rectangle { ++ id: root ++ color: JamiTheme.secondaryBackgroundColor ++ anchors.fill: parent ++ property bool isVideo: false ++ property string html: "" ++ ++ WebEngineView { ++ id: wev ++ ++ anchors.fill: parent ++ anchors.verticalCenter: root.verticalCenter ++ backgroundColor: JamiTheme.secondaryBackgroundColor ++ anchors.topMargin: root.isVideo? 0 : wev.implicitHeight / 2 ++ settings.fullScreenSupportEnabled: root.isVideo ++ settings.javascriptCanOpenWindows: false ++ Component.onCompleted: loadHtml(root.html, 'file://') ++ onFullScreenRequested: function(request) { ++ if (request.toggleOn) { ++ layoutManager.pushFullScreenItem( ++ this, ++ root, ++ null, ++ function() { wev.fullScreenCancelled() }) ++ } else if (!request.toggleOn) { ++ layoutManager.removeFullScreenItem(this) ++ } ++ request.accept() ++ } ++ } ++ ++ layer.enabled: true ++ layer.effect: OpacityMask { ++ maskSource: Item { ++ width: root.width ++ height: root.height ++ Rectangle { ++ anchors.centerIn: parent ++ width: root.width ++ height: root.height ++ radius: JamiTheme.swarmDetailsPageDocumentsMediaRadius ++ } ++ } ++ } ++} +\ No newline at end of file +-- +2.37.3 +