From nobody Thu Nov 16 13:58:31 2023 X-Original-To: dev-commits-ports-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4SWM7r13f1z50gxq; Thu, 16 Nov 2023 13:58:32 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4SWM7r0dw2z4mnJ; Thu, 16 Nov 2023 13:58:32 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1700143112; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=qX43qdRu4MiIVFEcgPx/X5pB439mbFAFnAmhiylqhco=; b=sRVRLlp9rN141KqXiEVrA1xkmU3qutK55+lW6trHJmXO33i90/lhjvZ3bPkuLRlS95jYva NembhaCF+eCgqYS697RUnx1yaK1of9LV5Jk4sXl/Ab80Wh/D+J/Zb9FSRb97wI4rSrQSGm 3miaTPhTRCXV2/XAJJiU96qEND85m66h5ng45fl0XdCLSu73qMp7aOFh0ammdgS+trMbvr /n32HMP7BGnNmRHFLGEoeE2ApKds8AjknzPAicZBDndHo9uIUWC8Lqp08np+Qo7kumI3ke +YvyH7qRPbxtWbIpBBtqDIXahs76/hr02gpJWwWdXgRG/aVZdsG1TBzLAd7pgg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1700143112; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=qX43qdRu4MiIVFEcgPx/X5pB439mbFAFnAmhiylqhco=; b=hDJidUeUXRXktVdSERdFTadXrGMfyz+B68gl66AT07U+JodFUFn5shvcVpz69PJEPia/JE 7mddDfcra87TN5twplLgvb7UalLuu9gKI2TY04vV7TrfC+q9n+v6Xipd3WmoqM802Pr3dW p7bJ6CmW2MYjsBuvW5FbaNsd2zJB1ogY8XDS3YQZ40kI0TYDp+YOG8L3b913YaLnnwT+Za TV5g+Sm3p72HzKHfpmhMdoBc616NfTIWyg1DijYgUhD/yGTbnEevte1F9EzPSqvYhW87k6 OBjhBZEYn071lBwkP3ZG9U7MgQYzvq10XHKmk0HQp3gGnguRigzqvlKQfytizQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1700143112; a=rsa-sha256; cv=none; b=G/m/b5CLHk+4NdyU/5S+FF/hugn0lwqAJPaF4F+3RU4eO1WeYLyGA5TMAejSkuYpm+monM ohvJuaAZmtvAhH3IA/G/7Gqm6srxOOK0Q+eMcT6iqT4BBjrWkag1uViPwax7F4nsIfXTRj De3+Yj9AAgzVPUrNloaKsRwyBkoIetPRlZMHkCqNFqyynvbuZPSdFmsR6YHcW/G0FoKwSE jREQ3wAbFqcRMKi246kcIwdaENsE+5f2QFVUgRAObjmR5RPRnvJxRBZNir6MEXo54ZhJXW Fjz7uzS2qT48Zk8yRB9GMliVkOuHBSsW9x0e6maukNdG8FhdkP94/NVFUKDwqg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4SWM7q6hLNz12Mq; Thu, 16 Nov 2023 13:58:31 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 3AGDwVhw052743; Thu, 16 Nov 2023 13:58:31 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 3AGDwVL5052740; Thu, 16 Nov 2023 13:58:31 GMT (envelope-from git) Date: Thu, 16 Nov 2023 13:58:31 GMT Message-Id: <202311161358.3AGDwVL5052740@gitrepo.freebsd.org> To: ports-committers@FreeBSD.org, dev-commits-ports-all@FreeBSD.org, dev-commits-ports-main@FreeBSD.org From: Gleb Popov Subject: git: 50d2fdf85d45 - main - sysutils/plasma5-discover: Unbreak build after AppStreamQt update. List-Id: Commit messages for all branches of the ports repository List-Archive: https://lists.freebsd.org/archives/dev-commits-ports-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-ports-all@freebsd.org X-BeenThere: dev-commits-ports-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: arrowd X-Git-Repository: ports X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 50d2fdf85d45fdcc211086be0893c6132642877a Auto-Submitted: auto-generated The branch main has been updated by arrowd: URL: https://cgit.FreeBSD.org/ports/commit/?id=50d2fdf85d45fdcc211086be0893c6132642877a commit 50d2fdf85d45fdcc211086be0893c6132642877a Author: Gleb Popov AuthorDate: 2023-11-16 13:57:32 +0000 Commit: Gleb Popov CommitDate: 2023-11-16 13:58:24 +0000 sysutils/plasma5-discover: Unbreak build after AppStreamQt update. Sponsored by: Serenity Cybersecurity, LLC --- sysutils/plasma5-discover/Makefile | 3 +- .../plasma5-discover/files/patch-CMakeLists.txt | 11 ++ .../patch-libdiscover_appstream_AppStreamUtils.cpp | 113 +++++++++++++++++++++ .../patch-libdiscover_appstream_AppStreamUtils.h | 22 ++++ .../patch-libdiscover_backends_CMakeLists.txt | 16 +++ 5 files changed, 164 insertions(+), 1 deletion(-) diff --git a/sysutils/plasma5-discover/Makefile b/sysutils/plasma5-discover/Makefile index f96e638dea41..6adf984da5b8 100644 --- a/sysutils/plasma5-discover/Makefile +++ b/sysutils/plasma5-discover/Makefile @@ -1,5 +1,6 @@ PORTNAME= discover DISTVERSION= ${KDE_PLASMA_VERSION} +PORTREVISION= 1 CATEGORIES= sysutils kde kde-plasma MAINTAINER= kde@FreeBSD.org @@ -8,7 +9,7 @@ WWW= https://www.kde.org/plasma-desktop # TODO: update packagekit-qt5 #LIB_DEPENDS= libpackagekit-qt.so:ports-mgmt/packagekit-qt5 -LIB_DEPENDS= libAppStreamQt.so:devel/appstream-qt +LIB_DEPENDS= libAppStreamQt5.so:devel/appstream-qt USES= cmake compiler:c++11-lib cpe desktop-file-utils gettext kde:5 \ pkgconfig qt:5 tar:xz xorg diff --git a/sysutils/plasma5-discover/files/patch-CMakeLists.txt b/sysutils/plasma5-discover/files/patch-CMakeLists.txt new file mode 100644 index 000000000000..157ffb29cb3f --- /dev/null +++ b/sysutils/plasma5-discover/files/patch-CMakeLists.txt @@ -0,0 +1,11 @@ +--- CMakeLists.txt.orig 2023-10-24 12:55:33 UTC ++++ CMakeLists.txt +@@ -31,7 +31,7 @@ find_package(packagekitqt5 1.0.1 CONFIG) + find_package(KF5Kirigami2 2.7.0) + + find_package(packagekitqt5 1.0.1 CONFIG) +-find_package(AppStreamQt 0.15.3 CONFIG REQUIRED) ++find_package(AppStreamQt5 1.0.0 CONFIG REQUIRED) + find_package(KF5Attica 5.23 CONFIG) + find_package(KF5NewStuff 5.53 CONFIG) + diff --git a/sysutils/plasma5-discover/files/patch-libdiscover_appstream_AppStreamUtils.cpp b/sysutils/plasma5-discover/files/patch-libdiscover_appstream_AppStreamUtils.cpp new file mode 100644 index 000000000000..c8b6adf0c5ad --- /dev/null +++ b/sysutils/plasma5-discover/files/patch-libdiscover_appstream_AppStreamUtils.cpp @@ -0,0 +1,113 @@ +--- libdiscover/appstream/AppStreamUtils.cpp.orig 2023-10-24 12:55:33 UTC ++++ libdiscover/appstream/AppStreamUtils.cpp +@@ -7,11 +7,11 @@ + #include "AppStreamUtils.h" + + #include "utils.h" +-#include +-#include +-#include +-#include +-#include ++#include ++#include ++#include ++#include ++#include + #include + #include + #include +@@ -35,10 +35,20 @@ QString AppStreamUtils::changelogToHtml(const AppStrea + + QString AppStreamUtils::changelogToHtml(const AppStream::Component &appdata) + { +- if (appdata.releases().isEmpty()) ++#if ASQ_CHECK_VERSION(1, 0, 0) ++ const auto releases = appdata.releasesPlain(); ++#else ++ const auto releases = appdata.releases(); ++#endif ++ if (releases.isEmpty()) { + return {}; ++ } + +- const auto release = appdata.releases().constFirst(); ++#if ASQ_CHECK_VERSION(1, 0, 0) ++ const auto release = releases.indexSafe(0).value(); ++#else ++ const auto release = releases.constFirst(); ++#endif + if (release.description().isEmpty()) + return {}; + +@@ -49,17 +59,19 @@ Screenshots AppStreamUtils::fetchScreenshots(const App + + Screenshots AppStreamUtils::fetchScreenshots(const AppStream::Component &appdata) + { +- const auto appdataScreenshots = appdata.screenshots(); ++ const auto appdataScreenshots = appdata.screenshotsAll(); + Screenshots ret; + ret.reserve(appdataScreenshots.size()); + for (const AppStream::Screenshot &s : appdataScreenshots) { + const auto images = s.images(); + const QUrl thumbnail = AppStreamUtils::imageOfKind(images, AppStream::Image::KindThumbnail); +- const QUrl plain = AppStreamUtils::imageOfKind(images, AppStream::Image::KindSource); +- if (plain.isEmpty()) +- qWarning() << "invalid screenshot for" << appdata.name(); ++ const QUrl full = AppStreamUtils::imageOfKind(images, AppStream::Image::KindSource); ++ if (full.isEmpty()) { ++ qWarning() << "AppStreamUtils: Invalid screenshot for" << appdata.name(); ++ } ++ const bool isAnimated = s.mediaKind() == AppStream::Screenshot::MediaKindVideo; + +- ret.append(Screenshot{plain, thumbnail.isEmpty() ? plain : thumbnail, s.mediaKind() == AppStream::Screenshot::MediaKindVideo}); ++ ret.append(Screenshot{thumbnail.isEmpty() ? full : thumbnail, full, isAnimated}); + } + return ret; + } +@@ -128,20 +140,13 @@ QString AppStreamUtils::versionString(const QString &v + + QString AppStreamUtils::versionString(const QString &version, const AppStream::Component &appdata) + { ++ Q_UNUSED(appdata); ++ + if (version.isEmpty()) { + return {}; +- } else { +- if (appdata.releases().isEmpty()) +- return version; +- +- auto release = appdata.releases().constFirst(); +- if (release.timestamp().isValid() && version.startsWith(release.version())) { +- QLocale l; +- return i18n("%1, released on %2", version, l.toString(release.timestamp().date(), QLocale::ShortFormat)); +- } else { +- return version; +- } + } ++ ++ return version; + } + + QString AppStreamUtils::contentRatingDescription(const AppStream::Component &appdata) +@@ -238,7 +243,7 @@ uint AppStreamUtils::contentRatingMinimumAge(const App + #endif + } + +-static void kRemoveDuplicates(QList &input, AppStream::Bundle::Kind kind) ++static void kRemoveDuplicates(AppStream::ComponentBox &input, AppStream::Bundle::Kind kind) + { + QSet ret; + for (auto it = input.begin(); it != input.end();) { +@@ -252,9 +257,9 @@ static void kRemoveDuplicates(QList AppStreamUtils::componentsByCategories(AppStream::Pool *pool, Category *cat, AppStream::Bundle::Kind kind) ++AppStream::ComponentBox AppStreamUtils::componentsByCategories(AppStream::Pool *pool, Category *cat, AppStream::Bundle::Kind kind) + { +- QList ret; ++ AppStream::ComponentBox ret(AppStream::ComponentBox::FlagNoChecks); + for (const auto &categoryName : cat->involvedCategories()) { + ret += pool->componentsByCategories({categoryName}); + } diff --git a/sysutils/plasma5-discover/files/patch-libdiscover_appstream_AppStreamUtils.h b/sysutils/plasma5-discover/files/patch-libdiscover_appstream_AppStreamUtils.h new file mode 100644 index 000000000000..02cef6467b97 --- /dev/null +++ b/sysutils/plasma5-discover/files/patch-libdiscover_appstream_AppStreamUtils.h @@ -0,0 +1,22 @@ +--- libdiscover/appstream/AppStreamUtils.h.orig 2023-10-24 12:55:33 UTC ++++ libdiscover/appstream/AppStreamUtils.h +@@ -6,9 +6,9 @@ + + #pragma once + +-#include +-#include +-#include ++#include ++#include ++#include + #include + #include + #include +@@ -38,5 +38,5 @@ Q_DECL_EXPORT uint contentRatingMinimumAge(const AppSt + Q_DECL_EXPORT AbstractResource::ContentIntensity contentRatingIntensity(const AppStream::Component &appdata); + Q_DECL_EXPORT uint contentRatingMinimumAge(const AppStream::Component &appdata); + +-Q_DECL_EXPORT QList componentsByCategories(AppStream::Pool *pool, Category *cat, AppStream::Bundle::Kind kind); ++Q_DECL_EXPORT AppStream::ComponentBox componentsByCategories(AppStream::Pool *pool, Category *cat, AppStream::Bundle::Kind kind); + } diff --git a/sysutils/plasma5-discover/files/patch-libdiscover_backends_CMakeLists.txt b/sysutils/plasma5-discover/files/patch-libdiscover_backends_CMakeLists.txt new file mode 100644 index 000000000000..ed1820a7eb43 --- /dev/null +++ b/sysutils/plasma5-discover/files/patch-libdiscover_backends_CMakeLists.txt @@ -0,0 +1,16 @@ +--- libdiscover/backends/CMakeLists.txt.orig 2023-10-24 12:55:33 UTC ++++ libdiscover/backends/CMakeLists.txt +@@ -8,11 +8,11 @@ endfunction() + Qt::Test Qt::Core ${EXTRA_LIBS}) + endfunction() + +-if(KF5Attica_FOUND AND KF5NewStuff_FOUND AND AppStreamQt_FOUND) ++if(KF5Attica_FOUND AND KF5NewStuff_FOUND AND AppStreamQt5_FOUND) + add_subdirectory(KNSBackend) + endif() + +-if(packagekitqt5_FOUND AND AppStreamQt_FOUND) ++if(packagekitqt5_FOUND AND AppStreamQt5_FOUND) + add_subdirectory(PackageKitBackend) + endif() +