From f96a7248b12fe3d74024fff79b71c58b481e72e4 Mon Sep 17 00:00:00 2001
From: SolveFinder <kwopleq@proton.me>
Date: Jul 20 2023 09:45:38 +0000
Subject: [PATCH 1/3] libre/discover without nonfree webview support and TPPM functionality


---

diff --git a/libre/discover/PKGBUILD b/libre/discover/PKGBUILD
new file mode 100644
index 0000000..28d8989
--- /dev/null
+++ b/libre/discover/PKGBUILD
@@ -0,0 +1,51 @@
+# Maintainer: Antonio Rojas <arojas@archlinux.org> 
+
+pkgname=discoverless
+_pkgname=discover
+pkgver=5.27.6
+_dirver=$(echo $pkgver | cut -d. -f1-3)
+pkgrel=1
+pkgrel+=.parabola1
+pkgdesc='KDE and Plasma resources management GUI'
+pkgdesc+=', without non-free webview support and TPPM functionality'
+arch=(x86_64)
+arch+=(i686 armv7h)
+url='https://kde.org/plasma-desktop/'
+license=(LGPL)
+depends=(kidletime
+         qt5-graphicaleffects
+         appstream-qt
+         # parabola-appstream-data
+         kirigami2
+         discount
+         kuserfeedback
+         purpose)
+makedepends=(extra-cmake-modules plasma-framework packagekit-qt5 flatpak)
+optdepends=('packagekit-qt5: to manage packages from Parabola repositories (not recommended, use at your own risk)'
+            'flatpak: Flatpak packages support')
+groups=(plasma)
+source=(https://download.kde.org/stable/plasma/$_dirver/$_pkgname-$pkgver.tar.xz{,.sig}
+        'libre.patch')
+sha256sums=('1661d734b2b04d9af015d9c9e8fbd46e066c542f39d3743cfbdaedbdce3591c5'
+            'SKIP'
+            '8685a4595cdcf7ff01db7974971d7f75b1bd70576b0432bcf5796dbff393a1ab')
+validpgpkeys=('E0A3EB202F8E57528E13E72FD7574483BB57B18D'  # Jonathan Esk-Riddell <jr@jriddell.org>
+              '0AAC775BB6437A8D9AF7A3ACFE0784117FBCE11D'  # Bhushan Shah <bshah@kde.org>
+              'D07BD8662C56CB291B316EB2F5675605C74E02CF'  # David Edmundson <davidedmundson@kde.org>
+              '1FA881591C26B276D7A5518EEAAF29B42A678C20') # Marco Martin <notmart@gmail.com>
+
+prepare() {
+  cd "$_pkgname-$pkgver"
+  patch -p1 -i ../libre.patch
+}
+
+build() {
+  cmake -B build -S $_pkgname-$pkgver \
+    -DCMAKE_INSTALL_LIBEXECDIR=lib \
+    -DBUILD_TESTING=OFF
+  cmake --build build
+}
+
+package() {
+  DESTDIR="$pkgdir" cmake --install build
+}
diff --git a/libre/discover/libre.patch b/libre/discover/libre.patch
new file mode 100644
index 0000000..0020a92
--- /dev/null
+++ b/libre/discover/libre.patch
@@ -0,0 +1,43 @@
+From 16354ba2c0dd70c0bdca04ec311b46a2ffda92d5 Mon Sep 17 00:00:00 2001
+From: SolveFinder <kwopleq@proton.me>
+Date: Fri, 14 Jul 2023 11:03:49 +0300
+Subject: [PATCH] Removed non-free WebView
+
+---
+ CMakeLists.txt          | 1 -
+ discover/CMakeLists.txt | 7 +------
+ 2 files changed, 1 insertion(+), 7 deletions(-)
+
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index f96e83b..57991ca 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -23,7 +23,6 @@ include(ECMQtDeclareLoggingCategory)
+ include(KDEClangFormat)
+ include(KDEGitCommitHooks)
+ find_package(Qt${QT_MAJOR_VERSION} ${QT_MIN_VERSION} REQUIRED CONFIG COMPONENTS Widgets Test Network Concurrent DBus Quick)
+-find_package(Qt${QT_MAJOR_VERSION} ${QT_MIN_VERSION} CONFIG OPTIONAL_COMPONENTS WebView)
+ 
+ find_package(PkgConfig REQUIRED)
+ 
+diff --git a/discover/CMakeLists.txt b/discover/CMakeLists.txt
+index 17ac7f8..cbc2403 100644
+--- a/discover/CMakeLists.txt
++++ b/discover/CMakeLists.txt
+@@ -53,12 +53,7 @@ target_link_libraries(plasma-discover PUBLIC
+                                      Discover::Common
+ )
+ 
+-if (TARGET Qt::WebView)
+-    target_link_libraries(plasma-discover PUBLIC Qt::WebView)
+-    target_compile_definitions(plasma-discover PUBLIC -DWITH_QTWEBVIEW=1)
+-else()
+-    target_compile_definitions(plasma-discover PUBLIC -DWITH_QTWEBVIEW=0)
+-endif()
++target_compile_definitions(plasma-discover PUBLIC -DWITH_QTWEBVIEW=0)
+ 
+ if (TARGET KUserFeedbackCore)
+     target_link_libraries(plasma-discover PRIVATE KUserFeedbackCore)
+-- 
+2.41.0
+

From a7e37445792c7f423406609e69cf2f3aac54cd58 Mon Sep 17 00:00:00 2001
From: Solve Finder <kwopleq@proton.me>
Date: Aug 04 2023 19:49:21 +0000
Subject: [PATCH 2/3] Update libre/discover/libre.patch according to message from dev mailing list


---

diff --git a/libre/discover/libre.patch b/libre/discover/libre.patch
index 0020a92..c663c01 100644
--- a/libre/discover/libre.patch
+++ b/libre/discover/libre.patch
@@ -1,12 +1,14 @@
-From 16354ba2c0dd70c0bdca04ec311b46a2ffda92d5 Mon Sep 17 00:00:00 2001
+From b0b3e5a09d0dcee1cafbf25462d9289892a13532 Mon Sep 17 00:00:00 2001
 From: SolveFinder <kwopleq@proton.me>
-Date: Fri, 14 Jul 2023 11:03:49 +0300
-Subject: [PATCH] Removed non-free WebView
+Date: Fri, 4 Aug 2023 21:37:44 +0300
+Subject: [PATCH] libre/discover without TPPM functionality; webview, flatpak, snap, fwupd and rpm-ostree support
 
 ---
- CMakeLists.txt          | 1 -
- discover/CMakeLists.txt | 7 +------
- 2 files changed, 1 insertion(+), 7 deletions(-)
+ CMakeLists.txt                                |  1 -
+ discover/CMakeLists.txt                       |  7 +---
+ libdiscover/backends/CMakeLists.txt           |  8 ++---
+ .../packagekit-backend-categories.xml         | 34 -------------------
+ 4 files changed, 5 insertions(+), 45 deletions(-)
 
 diff --git a/CMakeLists.txt b/CMakeLists.txt
 index f96e83b..57991ca 100644
@@ -38,6 +40,84 @@ index 17ac7f8..cbc2403 100644
  
  if (TARGET KUserFeedbackCore)
      target_link_libraries(plasma-discover PRIVATE KUserFeedbackCore)
+diff --git a/libdiscover/backends/CMakeLists.txt b/libdiscover/backends/CMakeLists.txt
+index bd3a032..3b40c41 100644
+--- a/libdiscover/backends/CMakeLists.txt
++++ b/libdiscover/backends/CMakeLists.txt
+@@ -21,7 +21,7 @@ if(BUILD_DummyBackend)
+     add_subdirectory(DummyBackend)
+ endif()
+ 
+-option(BUILD_FlatpakBackend "Build Flatpak support" "ON")
++option(BUILD_FlatpakBackend "Build Flatpak support" "OFF")
+ if(Flatpak_FOUND AND AppStreamQt_FOUND AND BUILD_FlatpakBackend)
+     add_subdirectory(FlatpakBackend)
+ elseif(BUILD_FlatpakBackend)
+@@ -40,17 +40,17 @@ if(BUILD_SteamOSBackend)
+     add_subdirectory(SteamOSBackend)
+ endif()
+ 
+-option(BUILD_SnapBackend "Build Snap support." "ON")
++option(BUILD_SnapBackend "Build Snap support." "OFF")
+ if(BUILD_SnapBackend AND AppStreamQt_FOUND AND Snapd_FOUND)
+     add_subdirectory(SnapBackend)
+ endif()
+ 
+-option(BUILD_FwupdBackend "Build Fwupd support." "ON")
++option(BUILD_FwupdBackend "Build Fwupd support." "OFF")
+ if(BUILD_FwupdBackend AND TARGET PkgConfig::Fwupd)
+     add_subdirectory(FwupdBackend)
+ endif()
+ 
+-option(BUILD_RpmOstreeBackend "Build rpm-ostree support." "ON")
++option(BUILD_RpmOstreeBackend "Build rpm-ostree support." "OFF")
+ if(BUILD_RpmOstreeBackend AND Ostree_FOUND AND RpmOstree_FOUND)
+     add_subdirectory(RpmOstreeBackend)
+ endif()
+diff --git a/libdiscover/backends/PackageKitBackend/packagekit-backend-categories.xml b/libdiscover/backends/PackageKitBackend/packagekit-backend-categories.xml
+index ff1a922..f6b5fe3 100644
+--- a/libdiscover/backends/PackageKitBackend/packagekit-backend-categories.xml
++++ b/libdiscover/backends/PackageKitBackend/packagekit-backend-categories.xml
+@@ -548,39 +548,5 @@
+       </Or>
+     </Include>
+   </Menu>
+-  <Menu>
+-    <Name>Plasma Addons</Name>
+-    <Icon>plasma</Icon>
+-    <Addons />
+-
+-    <Include>
+-        <Or>
+-            <AppstreamIdWildcard>org.kde.plasma.*</AppstreamIdWildcard>
+-        </Or>
+-    </Include>
+-
+-    <Menu>
+-      <Name>Plasma Widgets</Name>
+-      <Icon>plasma</Icon>
+-      <Addons />
+-      <Include>
+-        <Or>
+-            <AppstreamIdWildcard>org.kde.plasma.*</AppstreamIdWildcard>
+-        </Or>
+-      </Include>
+-    </Menu>
+-
+-<!--
+-    <Menu>
+-      <Name>Fonts</Name>
+-      <Icon>preferences-desktop-font</Icon>
+-      <Include>
+-        <And>
+-            <Category>Fonts</Category>
+-        </And>
+-      </Include>
+-    </Menu>
+--->
+-  </Menu>
+ 
+ </Menu>
 -- 
 2.41.0
 

From 017d9158d32031fa6d3edc07f43a3901bc61d602 Mon Sep 17 00:00:00 2001
From: Solve Finder <kwopleq@proton.me>
Date: Aug 04 2023 19:50:15 +0000
Subject: [PATCH 3/3] Update libre/discover/PKGBUILD according to message from dev mailing list


---

diff --git a/libre/discover/PKGBUILD b/libre/discover/PKGBUILD
index 28d8989..b23bff5 100644
--- a/libre/discover/PKGBUILD
+++ b/libre/discover/PKGBUILD
@@ -2,7 +2,7 @@
 
 pkgname=discoverless
 _pkgname=discover
-pkgver=5.27.6
+pkgver=5.27.7
 _dirver=$(echo $pkgver | cut -d. -f1-3)
 pkgrel=1
 pkgrel+=.parabola1
@@ -20,15 +20,14 @@ depends=(kidletime
          discount
          kuserfeedback
          purpose)
-makedepends=(extra-cmake-modules plasma-framework packagekit-qt5 flatpak)
-optdepends=('packagekit-qt5: to manage packages from Parabola repositories (not recommended, use at your own risk)'
-            'flatpak: Flatpak packages support')
+makedepends=(extra-cmake-modules plasma-framework packagekit-qt5)
+optdepends=('packagekit-qt5: to manage packages from Parabola repositories (not recommended, use at your own risk)')
 groups=(plasma)
 source=(https://download.kde.org/stable/plasma/$_dirver/$_pkgname-$pkgver.tar.xz{,.sig}
         'libre.patch')
-sha256sums=('1661d734b2b04d9af015d9c9e8fbd46e066c542f39d3743cfbdaedbdce3591c5'
+sha256sums=('a9eca14bb4cf3094d5c4df7975f1a793fca8fb4018ca1252d1e1230c79784500'
             'SKIP'
-            '8685a4595cdcf7ff01db7974971d7f75b1bd70576b0432bcf5796dbff393a1ab')
+            '6815271bf4917400f3df7fc2caf00e48099b92d22dfd8b5c3546cd36e27696a3')
 validpgpkeys=('E0A3EB202F8E57528E13E72FD7574483BB57B18D'  # Jonathan Esk-Riddell <jr@jriddell.org>
               '0AAC775BB6437A8D9AF7A3ACFE0784117FBCE11D'  # Bhushan Shah <bshah@kde.org>
               'D07BD8662C56CB291B316EB2F5675605C74E02CF'  # David Edmundson <davidedmundson@kde.org>

