polkit-elogind: update to 0.114.

Closes #13390.

Signed-off-by: Enno Boland <gottox@voidlinux.eu>
This commit is contained in:
maxice8 2018-04-11 14:32:14 -03:00 committed by Enno Boland
parent b5f730b74b
commit e1723d1636
4 changed files with 115 additions and 26 deletions

View File

@ -1 +0,0 @@
../polkit/patches

View File

@ -0,0 +1,29 @@
Upstream: Pending, https://bugs.freedesktop.org/show_bug.cgi?id=105989
From 08bb656496cd3d6213bbe9473f63f2d4a110da6e Mon Sep 17 00:00:00 2001
From: Rasmus Thomsen <cogitri@exherbo.org>
Date: Wed, 11 Apr 2018 13:14:14 +0200
Subject: [PATCH] configure: fix elogind support
HAVE_LIBSYSTEMD is used to determine which source files to use.
We have to check if either have_libsystemd or have_libelogind is
true, as both of these need the source files which are used when
HAVE_LIBSYSTEMD is true.
---
configure.ac | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git configure.ac configure.ac
index 36df239..da47ecb 100644
--- configure.ac
+++ configure.ac
@@ -221,7 +221,7 @@ AS_IF([test "x$cross_compiling" != "xyes" ], [
AC_SUBST(LIBSYSTEMD_CFLAGS)
AC_SUBST(LIBSYSTEMD_LIBS)
-AM_CONDITIONAL(HAVE_LIBSYSTEMD, [test "$have_libsystemd" = "yes"], [Using libsystemd])
+AM_CONDITIONAL(HAVE_LIBSYSTEMD, [test "$have_libsystemd" = "yes" || test "$have_libelogind" = "yes" ], [Using libsystemd])
dnl ---------------------------------------------------------------------------
dnl - systemd unit / service files
--
2.17.0

View File

@ -0,0 +1,68 @@
--- configure.ac
+++ configure.ac
@@ -99,7 +99,7 @@ AC_CHECK_LIB(expat,XML_ParserCreate,[EXPAT_LIBS="-lexpat"],
[AC_MSG_ERROR([Can't find expat library. Please install expat.])])
AC_SUBST(EXPAT_LIBS)
-AC_CHECK_FUNCS(clearenv fdatasync)
+AC_CHECK_FUNCS(clearenv fdatasync getnetgrent)
if test "x$GCC" = "xyes"; then
LDFLAGS="-Wl,--as-needed $LDFLAGS"
--- src/polkitbackend/polkitbackendinteractiveauthority.c
+++ src/polkitbackend/polkitbackendinteractiveauthority.c
@@ -2228,6 +2228,7 @@ get_users_in_net_group (PolkitIdentity *group,
ret = NULL;
name = polkit_unix_netgroup_get_name (POLKIT_UNIX_NETGROUP (group));
+#if defined HAVE_GETNETGRENT
#ifdef HAVE_SETNETGRENT_RETURN
if (setnetgrent (name) == 0)
{
@@ -2236,6 +2237,7 @@ get_users_in_net_group (PolkitIdentity *group,
}
#else
setnetgrent (name);
+#endif
#endif
for (;;)
@@ -2248,8 +2250,10 @@ get_users_in_net_group (PolkitIdentity *group,
PolkitIdentity *user;
GError *error = NULL;
+#if defined HAVE_GETNETGRENT
if (getnetgrent (&hostname, &username, &domainname) == 0)
break;
+#endif
/* Skip NULL entries since we never want to make everyone an admin
* Skip "-" entries which mean "no match ever" in netgroup land */
@@ -2274,7 +2278,9 @@ get_users_in_net_group (PolkitIdentity *group,
ret = g_list_reverse (ret);
out:
+#if defined HAVE_GETNETGRENT
endnetgrent ();
+#endif
return ret;
}
--- src/polkitbackend/polkitbackendjsauthority.cpp
+++ src/polkitbackend/polkitbackendjsauthority.cpp
@@ -1499,6 +1499,7 @@ js_polkit_user_is_in_netgroup (JSContext *cx,
JS::CallArgs args = JS::CallArgsFromVp (argc, vp);
+#if defined HAVE_GETNETGRENT
user = JS_EncodeString (cx, args[0].toString());
netgroup = JS_EncodeString (cx, args[1].toString());
@@ -1514,6 +1515,7 @@ js_polkit_user_is_in_netgroup (JSContext *cx,
JS_free (cx, user);
ret = true;
+#endif
args.rval ().setBoolean (is_in_netgroup);

View File

@ -1,27 +1,24 @@
# Template file for 'polkit-elogind'
pkgname=polkit-elogind
_pkgname=polkit
version=0.113.0.2018.03.19
revision=2
version=0.114
revision=1
wrksrc="polkit-${version}"
build_style=gnu-configure
configure_args="$(vopt_enable gir introspection)
--disable-static --with-authfw=pam --with-os-type=void --with-mozjs=mozjs-24.0"
configure_args="$(vopt_enable gir introspection) --disable-static
--with-authfw=pam --with-os-type=void --with-mozjs=mozjs-52.0"
hostmakedepends="automake gettext-devel git glib-devel gobject-introspection
gtk-doc intltool pkg-config"
makedepends="elogind-devel libglib-devel mozjs52-devel pam-devel"
system_accounts="polkitd"
short_desc="Authorization Toolkit"
maintainer="Enno Boland <gottox@voidlinux.eu>"
license="GPL-2.0-or-later"
homepage="http://www.freedesktop.org/wiki/Software/polkit"
license="GPL-2"
#distfiles="${FREEDESKTOP_SITE}/${_pkgname}/releases/${_pkgname}-${version}.tar.gz"
#checksum=e1c095093c654951f78f8618d427faf91cf62abdefed98de40ff65eca6413c81
#wrksrc="${_pkgname}-${version}"
wrksrc=$_pkgname
_hash=29ba7afba1b79a325183a71966f35926dfdf506e
provides="${_pkgname}-${version}_${revision}"
distfiles="${FREEDESKTOP_SITE}/polkit/releases/polkit-${version}.tar.gz"
checksum=bdf4007367d758fd794de2495975c115984d206267e52d1e6ac5ceea77e8ede6
provides="polkit-${version}_${revision}"
replaces="polkit>=0"
hostmakedepends="automake libtool gettext-devel pkg-config intltool libxslt
docbook-xsl glib-devel gtk-doc gobject-introspection git"
makedepends="libglib-devel expat-devel pam-devel mozjs24-devel elogind-devel"
system_accounts="polkitd"
make_dirs="
/etc/polkit-1/rules.d 0700 polkitd polkitd
/usr/share/polkit-1/rules.d 0700 polkitd polkitd"
@ -33,23 +30,19 @@ if [ -z "$CROSS_BUILD" ]; then
build_options_default+=" gir"
fi
do_fetch() {
git clone https://anongit.freedesktop.org/git/polkit || :
cd $_pkgname
git checkout $_hash
}
pre_configure() {
NOCONFIGURE=1 ./autogen.sh
autoreconf -fi
# Drop requirement of /sys/fs/cgroup/systemd test in configure... WTF.
sed -e 's,/sys/fs/cgroup/systemd/,/sys/fs/cgroup,g' -i configure
}
post_configure() {
if [ "$CROSS_BUILD" ]; then
sed -e "s#-include \(/usr/include/mozjs-24/js/RequiredDefines\.h\)#-include ${XBPS_CROSS_BASE}\1#" \
-i `find -name Makefile`
sed -e "s#-include \(/usr/include/mozjs-52/js/RequiredDefines\.h\)#-include ${XBPS_CROSS_BASE}\1#" \
-i $(find -name Makefile)
fi
}
post_install() {
vinstall ${FILESDIR}/polkit-1.pam 644 etc/pam.d polkit-1