gparted: upgrade 0.33.0 -> 1.1.0

* Due to huge bump recipe had to reworked completely
* They offer a polkit action so our tailored version can go (it stopped working
  long ago btw). It is installed unconditionally but packed into an extra
  package which finds it's way into image only if 'polkit' is in distro
  features.

Signed-off-by: Andreas Müller <schnitzeltony@gmail.com>
Signed-off-by: Khem Raj <raj.khem@gmail.com>
This commit is contained in:
Andreas Müller
2020-05-01 13:35:24 +02:00
committed by Khem Raj
parent f7d2d46855
commit 7e7e95db1d
5 changed files with 86 additions and 70 deletions

View File

@@ -0,0 +1,47 @@
From 79fd11f1d8e4827ae8aee03420a5c92038fe4ef5 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Andreas=20M=C3=BCller?= <schnitzeltony@gmail.com>
Date: Wed, 26 Feb 2020 20:25:06 +0100
Subject: [PATCH] Install polkit action unconditionally - executable pkexec is
not in our sysroot
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Upstream-Status: Inappropriate [OE-specific]
Signed-off-by: Andreas Müller <schnitzeltony@gmail.com>
---
configure.ac | 17 +----------------
1 file changed, 1 insertion(+), 16 deletions(-)
diff --git a/configure.ac b/configure.ac
index 43503ac..b339ee5 100644
--- a/configure.ac
+++ b/configure.ac
@@ -24,22 +24,7 @@ dnl======================
dnl Find graphical privilege escalation program
dnl======================
dnl Check for pkexec >= 0.102 for it's ability to run X11 apps.
-AM_CONDITIONAL([INSTALL_POLKIT_ACTIONS], false)
-PKEXEC_REQUIRED_VERSION='0.102'
-AC_MSG_CHECKING([for pkexec >= $PKEXEC_REQUIRED_VERSION])
-PKEXEC_REQUIRED_INT=`echo "$PKEXEC_REQUIRED_VERSION" | $AWK -F. '{print $1 * 10000 + $2}'`
-PKEXEC_VERSION_OUTPUT=`pkexec --version 2> /dev/null` ||
- AC_MSG_RESULT([not found])
-if test "x$PKEXEC_VERSION_OUTPUT" != 'x'; then
- PKEXEC_FOUND_VERSION=`echo "$PKEXEC_VERSION_OUTPUT" | head -1 | cut -d' ' -f3`
- PKEXEC_FOUND_INT=`echo "$PKEXEC_FOUND_VERSION" | $AWK -F. '{print $1 * 10000 + $2}'`
- AC_MSG_RESULT([$PKEXEC_FOUND_VERSION found])
- if test "$PKEXEC_FOUND_INT" -ge "$PKEXEC_REQUIRED_INT"; then
- GKSUPROG='pkexec --disable-internal-agent'
- AC_SUBST([GKSUPROG])
- AM_CONDITIONAL([INSTALL_POLKIT_ACTIONS], true)
- fi
-fi
+AM_CONDITIONAL([INSTALL_POLKIT_ACTIONS], true)
dnl Check for alternative graphical privilege escalation programs.
if test "x$GKSUPROG" = 'x'; then
--
2.21.0

View File

@@ -1,10 +0,0 @@
#!/bin/sh
# polkit installed?
if [ $(which pkexec) ]; then
pkexec --disable-internal-agent "%sbindir%/gparted" "$@"
else
%sbindir%/gparted "$@"
fi

View File

@@ -1,20 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE policyconfig PUBLIC
"-//freedesktop//DTD PolicyKit Policy Configuration 1.0//EN"
"http://www.freedesktop.org/standards/PolicyKit/1/policyconfig.dtd">
<policyconfig>
<action id="org.yoctoproject.pkexec.run-gparted">
<description>Run the GParted program</description>
<message>Authentication is required to run the GParted Partition Editor</message>
<icon_name>gparted</icon_name>
<defaults>
<allow_any>auth_admin</allow_any>
<allow_inactive>auth_admin</allow_inactive>
<allow_active>auth_admin</allow_active>
</defaults>
<annotate key="org.freedesktop.policykit.exec.path">/usr/sbin/gparted</annotate>
<annotate key="org.freedesktop.policykit.exec.allow_gui">true</annotate>
</action>
</policyconfig>

View File

@@ -1,40 +0,0 @@
SUMMARY = "A partition editor to graphically manage disk partitions "
HOMEPAGE = "http://gparted.org/index.php"
LICENSE = "GPLv2"
LIC_FILES_CHKSUM = "file://COPYING;md5=94d55d512a9ba36caa9b7df079bae19f"
inherit features_check autotools pkgconfig gtk-icon-cache
REQUIRED_DISTRO_FEATURES = "x11"
SRC_URI = " \
${SOURCEFORGE_MIRROR}/project/${BPN}/${BPN}/${BPN}-${PV}/${BPN}-${PV}.tar.gz \
file://org.yoctoproject.pkexec.run-gparted.policy \
file://gparted_polkit \
"
SRC_URI[md5sum] = "2f481ad34decb7021ca04ca305e79e7d"
SRC_URI[sha256sum] = "5023b8c983f88a22e65bf6f09a12ea09369defc008981b52ee8b96a3879f81d6"
DEPENDS += "glib-2.0 glib-2.0-native gtkmm parted gnome-doc-utils intltool-native"
do_install_append() {
# Add a script which checks if polkit is installed.
# If yes: a policy is requested from polkit / otherwise start as usual
install ${WORKDIR}/gparted_polkit ${D}${sbindir}
sed -i 's:%sbindir%:${sbindir}:g' ${D}${sbindir}/gparted_polkit
# relink menu entry to use our script
sed -i 's:${sbindir}/gparted:${sbindir}/gparted_polkit:g' ${D}${datadir}/applications/gparted.desktop
install -d ${D}${datadir}/polkit-1/actions
install ${WORKDIR}/org.yoctoproject.pkexec.run-gparted.policy ${D}${datadir}/polkit-1/actions/org.yoctoproject.pkexec.run-gparted.policy
}
EXTRA_OECONF = "--disable-scrollkeeper --disable-doc"
FILES_${PN} += " \
${datadir}/appdata \
${datadir}/icons \
${datadir}/polkit-1 \
"
RDEPENDS_${PN} = "dosfstools mtools e2fsprogs"

View File

@@ -0,0 +1,39 @@
SUMMARY = "A partition editor to graphically manage disk partitions "
HOMEPAGE = "http://gparted.org/index.php"
LICENSE = "GPLv2"
LIC_FILES_CHKSUM = "file://COPYING;md5=94d55d512a9ba36caa9b7df079bae19f"
inherit features_check autotools pkgconfig python3native gnome-help gtk-icon-cache
REQUIRED_DISTRO_FEATURES = "x11"
SRC_URI = " \
${SOURCEFORGE_MIRROR}/project/${BPN}/${BPN}/${BPN}-${PV}/${BPN}-${PV}.tar.gz \
file://0001-Install-polkit-action-unconditionally-executable-pke.patch \
"
SRC_URI[md5sum] = "0da45cb522d766dfb4886fb3bdbc2634"
SRC_URI[sha256sum] = "e2fe7b7afbc07e930491c00a05200c2682cc0576ca8f6da87245a000257f5924"
DEPENDS += " \
glib-2.0-native \
yelp-tools-native \
intltool-native \
glib-2.0 \
gtkmm3 \
parted \
"
FILES_${PN} += " \
${datadir}/appdata \
${datadir}/icons \
"
PACKAGES += "${PN}-polkit"
FILES_${PN}-polkit = "${datadir}/polkit-1"
RDEPENDS_${PN} = " \
${@bb.utils.contains('DISTRO_FEATURES', 'polkit', '${PN}-polkit', '', d)} \
dosfstools \
mtools \
e2fsprogs \
"