git » polkit-qt.git » commit 266147b

upgpkg: 0.114.0-2: Build with qt6

author Antonio Rojas
2023-10-01 20:24:56 UTC
committer Antonio Rojas
2023-10-01 20:24:56 UTC
parent af627deb77bf00b0c22d8cdf3bf7e3ee6a98be84

upgpkg: 0.114.0-2: Build with qt6

PKGBUILD +33 -9

diff --git a/PKGBUILD b/PKGBUILD
index 3a17766..e0f9199 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -3,26 +3,50 @@
 # Contributor: Pierre Schmitz <pierre@archlinux.de>
 
 pkgbase=polkit-qt
-pkgname=(polkit-qt5)
+pkgname=(polkit-qt5 polkit-qt6)
 pkgver=0.114.0
-pkgrel=1
+pkgrel=2
 pkgdesc='A library that allows developers to access PolicyKit API with a nice Qt-style API'
 arch=(x86_64)
 url='https://www.kde.org/'
 license=(LGPL)
-depends=(polkit qt5-base)
-makedepends=(cmake)
-source=(https://download.kde.org/stable/$pkgbase-1/$pkgbase-1-$pkgver.tar.xz{,.sig})
+depends=(gcc-libs
+         glib2
+         glibc
+         polkit)
+makedepends=(cmake
+             qt5-base
+             qt6-base)
+source=(https://download.kde.org/stable/$pkgbase-1/$pkgbase-1-$pkgver.tar.xz{,.sig}
+        https://invent.kde.org/libraries/polkit-qt-1/-/commit/fd1bc295.patch)
 sha256sums=('2eb0f22445888295ffa2bfbc0c3693847a0f973bb6b0c3e4cce0218be7e3907e'
-            'SKIP')
+            'SKIP'
+            'ef2fced7bb2c3617fe1d0d367d6dd6c9d4818278da260e87bdf9bc90acfa6beb')
 validpgpkeys=(D81C0CB38EB725EF6691C385BB463350D6EF31EF) # Heiko Becker <heirecka@exherbo.org>
 
+prepare() {
+  patch -d $pkgbase-1-$pkgver -p1 < fd1bc295.patch # Support Qt6
+}
+
 build() {
-  cmake -B build -S $pkgbase-1-$pkgver \
+  cmake -B build5 -S $pkgbase-1-$pkgver \
     -DCMAKE_INSTALL_PREFIX=/usr
-  cmake --build build
+  cmake --build build5
+
+  cmake -B build6 -S $pkgbase-1-$pkgver \
+    -DCMAKE_INSTALL_PREFIX=/usr \
+    -DQT_MAJOR_VERSION=6
+  cmake --build build6
 }
 
 package_polkit-qt5() {
-  DESTDIR="$pkgdir" cmake --install build
+  depends+=(qt5-base)
+
+  DESTDIR="$pkgdir" cmake --install build5
+}
+
+package_polkit-qt6() {
+  depends+=(qt6-base)
+
+  DESTDIR="$pkgdir" cmake --install build6
 }