summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJory A. Pratt <anarchy@gentoo.org>2013-04-01 15:09:30 -0500
committerJory A. Pratt <anarchy@gentoo.org>2013-04-01 15:09:30 -0500
commit86edc4d4305fbd8763c7a13783acd014fcaa059d (patch)
tree0980bc259d81b73040357d6cf8f57945e0e78802
parentUse current ~arch build in tree (diff)
downloadanarchy-86edc4d4305fbd8763c7a13783acd014fcaa059d.tar.gz
anarchy-86edc4d4305fbd8763c7a13783acd014fcaa059d.tar.bz2
anarchy-86edc4d4305fbd8763c7a13783acd014fcaa059d.zip
add spidermonkey-17.0.0 support to polkit
-rw-r--r--sys-auth/polkit/Manifest4
-rw-r--r--sys-auth/polkit/files/polkit-0.110-W_define.patch23
-rw-r--r--sys-auth/polkit/files/polkit-0.110-sm_17.0-updates.patch238
-rw-r--r--sys-auth/polkit/polkit-0.110.ebuild117
4 files changed, 382 insertions, 0 deletions
diff --git a/sys-auth/polkit/Manifest b/sys-auth/polkit/Manifest
new file mode 100644
index 0000000..f134d7a
--- /dev/null
+++ b/sys-auth/polkit/Manifest
@@ -0,0 +1,4 @@
+AUX polkit-0.110-W_define.patch 810 SHA256 75a47bbf04e328a8622996d40128752c6951ce434c404cca87ad3838b848874b SHA512 e17cb4867c0d16c04e4d68dfb95eb58f27cf64e1b8c6b36fa24c876c78bee990bb07a08bb7c335e333797075911639b8c6049909e7948bc86fd07e1abce2be88 WHIRLPOOL 74610ba53eb185f3963fe6dfdddcb2eb4aaa4bf23057939dcfde0d4ada296c7f904a2d45e470a0f0cdae9919c6f51512ee45ea7cb623eb3367439abeac2cb538
+AUX polkit-0.110-sm_17.0-updates.patch 11657 SHA256 1aa6ed9dd62616e04f03e3d560aaecc26c94f13f6c43db000ca846cbc5a3937c SHA512 cd946b04e03f9f9c4db12f099246b2a108b84c3adaf0aaae2a3a579a8d9c2540829907b747b4cecbcd2d115832884c6777d0f1000d3abb9358936199c9a24005 WHIRLPOOL 330cb172918fa44228b5cb0f8021befb95e550e0920a9be318cc9f89a237be691ed7ef545f56924cc9f5aad42dd1f5228d9ed20e6c21465e95989f6efdcbb15e
+DIST polkit-0.110.tar.gz 1390215 SHA256 8e5c5044bb968643b7fa379f287fb10582615df760ad2f1cb84be6e19fafe6e8 SHA512 f2630a84c21216edfc69f56092ba1b127b7765dcf4fe29a7f2f81d7163c11c643a931b215847a3fc6434c482cf12a48fef2f0e2c007d587c8bbb2fbca74eda67 WHIRLPOOL 1a4928733cdab6c9dfa186643959f15d395f6d6cba0a3790a9716282d331ceed3e962e58dc39ed2c40474238fc4d4c9e54662b20d0055059c512d42eed85631b
+EBUILD polkit-0.110.ebuild 2945 SHA256 00e79da568078c60cc512dd269731360e44e03ded3a7587f6b99aaed19067785 SHA512 073973830bf7f05ada0ac116f26db5ba5c63fb0ab888bee41e908cf67a8f662ee55f8a2555cf39c6ddaad738bd38902f6d6a5c9c1157947cd6cefe96579785f8 WHIRLPOOL 8e405e21d70bb848cbdeff8d13ec5cc602845e92ac11b13e8f673cb84faeed0675b5268b2dadee9aa78b9e4839ae729e34b13a06cf44f4cce06ddcac7d09f727
diff --git a/sys-auth/polkit/files/polkit-0.110-W_define.patch b/sys-auth/polkit/files/polkit-0.110-W_define.patch
new file mode 100644
index 0000000..8e502b8
--- /dev/null
+++ b/sys-auth/polkit/files/polkit-0.110-W_define.patch
@@ -0,0 +1,23 @@
+http://bugs.freedesktop.org/show_bug.cgi?id=62220
+
+Failure to compile on SH4 arch because <sys/wait.h> is missing for #define's of:
+WIFEXITED, WEXITSTATUS, WIFSIGNALED, WTERMSIG
+
+Errors are like this:
+
+polkitbackendjsauthority.c:1509:3: warning: implicit declaration of function 'WIFEXITED' [-Wimplicit-function-declaration]
+polkitbackendjsauthority.c:1509:3: warning: nested extern declaration of 'WIFEXITED' [-Wnested-externs]
+
+polkitbackendjsauthority.c:(.text+0x3008): undefined reference to `WIFEXITED'
+polkitbackendjsauthority.c:(.text+0x3010): undefined reference to `WIFEXITED'
+
+--- src/polkitbackend/polkitbackendjsauthority.c
++++ src/polkitbackend/polkitbackendjsauthority.c
+@@ -20,6 +20,7 @@
+ */
+
+ #include "config.h"
++#include <sys/wait.h>
+ #include <errno.h>
+ #include <pwd.h>
+ #include <grp.h>
diff --git a/sys-auth/polkit/files/polkit-0.110-sm_17.0-updates.patch b/sys-auth/polkit/files/polkit-0.110-sm_17.0-updates.patch
new file mode 100644
index 0000000..d182d80
--- /dev/null
+++ b/sys-auth/polkit/files/polkit-0.110-sm_17.0-updates.patch
@@ -0,0 +1,238 @@
+diff -urN a/configure.ac b/configure.ac
+--- a/configure.ac 2013-04-01 13:01:16.129562906 -0500
++++ b/configure.ac 2013-04-01 13:01:58.213560028 -0500
+@@ -125,7 +125,7 @@
+ AC_SUBST(GLIB_CFLAGS)
+ AC_SUBST(GLIB_LIBS)
+
+-PKG_CHECK_MODULES(LIBJS, [mozjs185])
++PKG_CHECK_MODULES(LIBJS, [mozjs-17.0])
+ AC_SUBST(LIBJS_CFLAGS)
+ AC_SUBST(LIBJS_LIBS)
+
+diff -urN a/src/polkitbackend/Makefile.am b/src/polkitbackend/Makefile.am
+--- a/src/polkitbackend/Makefile.am 2013-04-01 13:01:16.120562906 -0500
++++ b/src/polkitbackend/Makefile.am 2013-04-01 13:01:58.213560028 -0500
+@@ -57,6 +57,7 @@
+ # Note: We don't include $(LIBJS_LIBS) here since it's dlopen()'ed in polkitbackendjsauthority.c
+ #
+ libpolkit_backend_1_la_LIBADD = \
++ $(LIBJS_LIBS) \
+ $(GLIB_LIBS) \
+ $(LIBSYSTEMD_LOGIN_LIBS) \
+ $(top_builddir)/src/polkit/libpolkit-gobject-1.la \
+diff -urN a/src/polkitbackend/polkitbackendjsauthority.c b/src/polkitbackend/polkitbackendjsauthority.c
+--- a/src/polkitbackend/polkitbackendjsauthority.c 2013-04-01 13:01:16.119562906 -0500
++++ b/src/polkitbackend/polkitbackendjsauthority.c 2013-04-01 13:01:48.033560724 -0500
+@@ -138,36 +138,35 @@
+
+ /* ---------------------------------------------------------------------------------------------------- */
+
+-static JSBool (*dJS_CallFunctionName)(JSContext *cx, JSObject *obj, const char *name, uintN argc, jsval *argv, jsval *rval);
+-static JSObject *(*dJS_CompileFile)(JSContext *cx, JSObject *obj, const char *filename);
+-static JSBool (*dJS_ConvertArguments)(JSContext *cx, uintN argc, jsval *argv, const char *format, ...);
++static JSBool (*dJS_CallFunctionName)(JSContext *cx, JSObject *obj, const char *name, unsigned argc, jsval *argv, jsval *rval);
++static JSObject *(*dJS_CompileUTF8File)(JSContext *cx, JSObject *obj, const char *filename);
++static JSBool (*dJS_ConvertArguments)(JSContext *cx, unsigned argc, jsval *argv, const char *format, ...);
+ static JSBool (*dJS_ConvertStub)(JSContext *cx, JSObject *obj, JSType type, jsval *vp);
+ static JSBool (*dJS_DefineFunctions)(JSContext *cx, JSObject *obj, JSFunctionSpec *fs);
+-static JSObject *(*dJS_DefineObject)(JSContext *cx, JSObject *obj, const char *name, JSClass *clasp, JSObject *proto, uintN attrs);
++static JSObject *(*dJS_DefineObject)(JSContext *cx, JSObject *obj, const char *name, JSClass *clasp, JSObject *proto, unsigned attrs);
+ static void (*dJS_DestroyContext)(JSContext *cx);
+ #define dJS_DestroyRuntime dJS_Finish
+ static void (*dJS_Finish)(JSRuntime *rt);
+ static char *(*dJS_EncodeString)(JSContext *cx, JSString *str);
+ static JSBool (*dJS_EnumerateStub)(JSContext *cx, JSObject *obj);
+ static JSBool (*dJS_EvaluateScript)(JSContext *cx, JSObject *obj,
+- const char *bytes, uintN length,
+- const char *filename, uintN lineno,
++ const char *bytes, unsigned length,
++ const char *filename, unsigned lineno,
+ jsval *rval);
+ static JSBool (*dJS_ExecuteScript)(JSContext *cx, JSObject *obj, JSObject *scriptObj, jsval *rval);
+-static void (*dJS_FinalizeStub)(JSContext *cx, JSObject *obj);
+ static void (*dJS_free)(JSContext *cx, void *p);
+ static void (*dJS_GC)(JSContext *cx);
+-static JSBool (*dJS_GetArrayLength)(JSContext *cx, JSObject *obj, jsuint *lengthp);
++static JSBool (*dJS_GetArrayLength)(JSContext *cx, JSObject *obj, guint32 *lengthp);
+ static void *(*dJS_GetContextPrivate)(JSContext *cx);
+-static JSBool (*dJS_GetElement)(JSContext *cx, JSObject *obj, jsint index, jsval *vp);
++static JSBool (*dJS_GetElement)(JSContext *cx, JSObject *obj, gint32 index, jsval *vp);
+ static const jschar *(*dJS_GetStringCharsZ)(JSContext *cx, JSString *str);
+ static JSBool (*dJS_InitStandardClasses)(JSContext *cx, JSObject *obj);
+ static void (*dJS_MaybeGC)(JSContext *cx);
+-static JSObject *(*dJS_NewArrayObject)(JSContext *cx, jsint length, jsval *vector);
+-static JSObject *(*dJS_NewCompartmentAndGlobalObject)(JSContext *cx, JSClass *clasp, JSPrincipals *principals);
++static JSObject *(*dJS_NewArrayObject)(JSContext *cx, gint32 length, jsval *vector);
++static JSObject *(*dJS_NewGlobalObject)(JSContext *cx, JSClass *clasp, JSPrincipals *principals);
+ static JSContext *(*dJS_NewContext)(JSRuntime *rt, size_t stackChunkSize);
+ #define dJS_NewRuntime dJS_Init
+-static JSRuntime *(*dJS_Init)(uint32 maxbytes);
++static JSRuntime *(*dJS_Init)(guint32 maxbytes);
+ static JSString *(*dJS_NewStringCopyZ)(JSContext *cx, const char *s);
+ static JSBool (*dJS_PropertyStub)(JSContext *cx, JSObject *obj, jsid id, jsval *vp);
+ static void (*dJS_ReportError)(JSContext *cx, const char *format, ...);
+@@ -176,13 +175,13 @@
+ static void (*dJS_SetContextPrivate)(JSContext *cx, void *data);
+ static JSErrorReporter (*dJS_SetErrorReporter)(JSContext *cx, JSErrorReporter er);
+ JSOperationCallback (*dJS_SetOperationCallback)(JSContext *cx, JSOperationCallback callback);
+-static uint32 (*dJS_SetOptions)(JSContext *cx, uint32 options);
++static guint32 (*dJS_SetOptions)(JSContext *cx, guint32 options);
+ static void (*dJS_SetPendingException)(JSContext *cx, jsval v);
+ static JSBool (*dJS_SetProperty)(JSContext *cx, JSObject *obj, const char *name, jsval *vp);
+ static JSVersion (*dJS_SetVersion)(JSContext *cx, JSVersion version);
+ static void (*dJS_ShutDown)(void);
+ static JSBool (*dJS_StrictPropertyStub)(JSContext *cx, JSObject *obj, jsid id, JSBool strict, jsval *vp);
+-static void (*dJS_TriggerOperationCallback)(JSContext *cx);
++static void (*dJS_TriggerOperationCallback)(JSRuntime *rt);
+
+ #define DJS_SYMBOL(x) {#x, (void*) &d ## x}
+ static const struct {
+@@ -190,7 +189,7 @@
+ gpointer *ptr;
+ } djs_symbols[] = {
+ DJS_SYMBOL(JS_CallFunctionName),
+- DJS_SYMBOL(JS_CompileFile),
++ DJS_SYMBOL(JS_CompileUTF8File),
+ DJS_SYMBOL(JS_ConvertArguments),
+ DJS_SYMBOL(JS_ConvertStub),
+ DJS_SYMBOL(JS_DefineFunctions),
+@@ -201,7 +200,6 @@
+ DJS_SYMBOL(JS_EnumerateStub),
+ DJS_SYMBOL(JS_EvaluateScript),
+ DJS_SYMBOL(JS_ExecuteScript),
+- DJS_SYMBOL(JS_FinalizeStub),
+ DJS_SYMBOL(JS_free),
+ DJS_SYMBOL(JS_GC),
+ DJS_SYMBOL(JS_GetArrayLength),
+@@ -211,7 +209,7 @@
+ DJS_SYMBOL(JS_InitStandardClasses),
+ DJS_SYMBOL(JS_MaybeGC),
+ DJS_SYMBOL(JS_NewArrayObject),
+- DJS_SYMBOL(JS_NewCompartmentAndGlobalObject),
++ DJS_SYMBOL(JS_NewGlobalObject),
+ DJS_SYMBOL(JS_NewContext),
+ DJS_SYMBOL(JS_Init), /* Macro: JS_NewRuntime */
+ DJS_SYMBOL(JS_NewStringCopyZ),
+@@ -239,7 +237,7 @@
+ guint n;
+ const gchar *library_name;
+
+- library_name = "libmozjs185.so.1.0";
++ library_name = "libmozjs-17.0.so";
+ module = g_module_open (library_name, 0);
+ if (module == NULL)
+ goto out;
+@@ -278,9 +276,9 @@
+ static JSClass js_global_class = {0};
+ static JSClass js_polkit_class = {0};
+
+-static JSBool js_polkit_log (JSContext *cx, uintN argc, jsval *vp);
+-static JSBool js_polkit_spawn (JSContext *cx, uintN argc, jsval *vp);
+-static JSBool js_polkit_user_is_in_netgroup (JSContext *cx, uintN argc, jsval *vp);
++static JSBool js_polkit_log (JSContext *cx, unsigned argc, jsval *vp);
++static JSBool js_polkit_spawn (JSContext *cx, unsigned argc, jsval *vp);
++static JSBool js_polkit_user_is_in_netgroup (JSContext *cx, unsigned argc, jsval *vp);
+
+ static JSFunctionSpec js_polkit_functions[] =
+ {
+@@ -388,7 +386,7 @@
+ const gchar *filename = l->data;
+ JSObject *script;
+
+- script = dJS_CompileFile (authority->priv->cx,
++ script = dJS_CompileUTF8File (authority->priv->cx,
+ authority->priv->js_global,
+ filename);
+ if (script == NULL)
+@@ -562,7 +560,6 @@
+ js_global_class.enumerate = dJS_EnumerateStub;
+ js_global_class.resolve = dJS_ResolveStub;
+ js_global_class.convert = dJS_ConvertStub;
+- js_global_class.finalize = dJS_FinalizeStub;
+
+ js_polkit_class.name = "Polkit";
+ js_polkit_class.flags = 0;
+@@ -573,9 +570,8 @@
+ js_polkit_class.enumerate = dJS_EnumerateStub;
+ js_polkit_class.resolve = dJS_ResolveStub;
+ js_polkit_class.convert = dJS_ConvertStub;
+- js_polkit_class.finalize = dJS_FinalizeStub;
+
+- authority->priv->js_global = dJS_NewCompartmentAndGlobalObject (authority->priv->cx,
++ authority->priv->js_global = dJS_NewGlobalObject (authority->priv->cx,
+ &js_global_class,
+ NULL);
+ if (authority->priv->js_global == NULL)
+@@ -789,7 +785,7 @@
+ jsvals[n] = STRING_TO_JSVAL (jsstr);
+ }
+
+- array_object = dJS_NewArrayObject (authority->priv->cx, (jsint) len, jsvals);
++ array_object = dJS_NewArrayObject (authority->priv->cx, (gint32) len, jsvals);
+
+ value_jsval = OBJECT_TO_JSVAL (array_object);
+ dJS_SetProperty (authority->priv->cx, obj, name, &value_jsval);
+@@ -805,7 +801,7 @@
+ gint32 value)
+ {
+ jsval value_jsval;
+- value_jsval = INT_TO_JSVAL ((int32) value);
++ value_jsval = INT_TO_JSVAL ((gint32) value);
+ dJS_SetProperty (authority->priv->cx, obj, name, &value_jsval);
+ }
+
+@@ -1060,7 +1056,7 @@
+ PolkitBackendJsAuthority *authority = POLKIT_BACKEND_JS_AUTHORITY (user_data);
+
+ /* Supposedly this is thread-safe... */
+- dJS_TriggerOperationCallback (authority->priv->cx);
++ dJS_TriggerOperationCallback (authority->priv->rt);
+
+ /* keep source around so we keep trying to kill even if the JS bit catches the exception
+ * thrown in js_operation_callback()
+@@ -1113,7 +1109,7 @@
+ static JSBool
+ call_js_function_with_runaway_killer (PolkitBackendJsAuthority *authority,
+ const char *function_name,
+- uintN argc,
++ unsigned argc,
+ jsval *argv,
+ jsval *rval)
+ {
+@@ -1352,7 +1348,7 @@
+
+ static JSBool
+ js_polkit_log (JSContext *cx,
+- uintN argc,
++ unsigned argc,
+ jsval *vp)
+ {
+ /* PolkitBackendJsAuthority *authority = POLKIT_BACKEND_JS_AUTHORITY (dJS_GetContextPrivate (cx)); */
+@@ -1435,7 +1431,7 @@
+
+ static JSBool
+ js_polkit_spawn (JSContext *cx,
+- uintN js_argc,
++ unsigned js_argc,
+ jsval *vp)
+ {
+ /* PolkitBackendJsAuthority *authority = POLKIT_BACKEND_JS_AUTHORITY (dJS_GetContextPrivate (cx)); */
+@@ -1446,7 +1442,7 @@
+ gint exit_status;
+ GError *error = NULL;
+ JSString *ret_jsstr;
+- jsuint array_len;
++ guint32 array_len;
+ gchar **argv = NULL;
+ GMainContext *context = NULL;
+ GMainLoop *loop = NULL;
+@@ -1553,7 +1549,7 @@
+
+ static JSBool
+ js_polkit_user_is_in_netgroup (JSContext *cx,
+- uintN argc,
++ unsigned argc,
+ jsval *vp)
+ {
+ /* PolkitBackendJsAuthority *authority = POLKIT_BACKEND_JS_AUTHORITY (dJS_GetContextPrivate (cx)); */
diff --git a/sys-auth/polkit/polkit-0.110.ebuild b/sys-auth/polkit/polkit-0.110.ebuild
new file mode 100644
index 0000000..fac0903
--- /dev/null
+++ b/sys-auth/polkit/polkit-0.110.ebuild
@@ -0,0 +1,117 @@
+# Copyright 1999-2013 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: $
+
+EAPI=5
+inherit autotools eutils multilib pam pax-utils systemd user
+
+DESCRIPTION="Policy framework for controlling privileges for system-wide services"
+HOMEPAGE="http://www.freedesktop.org/wiki/Software/polkit"
+SRC_URI="http://www.freedesktop.org/software/${PN}/releases/${P}.tar.gz"
+
+LICENSE="LGPL-2"
+SLOT="0"
+KEYWORDS="alpha amd64 arm ia64 ~mips ppc ppc64 s390 sh sparc x86"
+IUSE="examples gtk +introspection kde nls pam selinux systemd"
+
+RDEPEND=">=dev-lang/spidermonkey-1.8.5-r1[-debug]
+ >=dev-libs/glib-2.32
+ >=dev-libs/expat-2
+ introspection? ( >=dev-libs/gobject-introspection-1 )
+ pam? (
+ sys-auth/pambase
+ virtual/pam
+ )
+ selinux? ( sec-policy/selinux-policykit )
+ systemd? ( sys-apps/systemd )"
+DEPEND="${RDEPEND}
+ app-text/docbook-xml-dtd:4.1.2
+ app-text/docbook-xsl-stylesheets
+ dev-libs/libxslt
+ dev-util/intltool
+ virtual/pkgconfig"
+PDEPEND="
+ gtk? ( || (
+ >=gnome-extra/polkit-gnome-0.105
+ lxde-base/lxpolkit
+ ) )
+ kde? ( sys-auth/polkit-kde-agent )
+ pam? (
+ systemd? ( sys-auth/pambase[systemd] )
+ !systemd? ( sys-auth/pambase[consolekit] )
+ )
+ !systemd? ( >=sys-auth/consolekit-0.4.5_p2012[policykit] )"
+
+QA_MULTILIB_PATHS="
+ usr/lib/polkit-1/polkit-agent-helper-1
+ usr/lib/polkit-1/polkitd"
+
+pkg_setup() {
+ local u=polkitd
+ local g=polkitd
+ local h=/var/lib/polkit-1
+
+ enewgroup ${g}
+ enewuser ${u} -1 -1 ${h} ${g}
+ esethome ${u} ${h}
+}
+
+src_prepare() {
+ epatch "${FILESDIR}"/${P}-W_define.patch
+ epatch "${FILESDIR}"/${P}-sm_17.0-updates.patch
+
+ sed -i -e 's|unix-group:wheel|unix-user:0|' src/polkitbackend/*-default.rules || die #401513
+
+ eautoreconf
+}
+
+src_configure() {
+ econf \
+ --localstatedir="${EPREFIX}"/var \
+ --disable-static \
+ --enable-man-pages \
+ --disable-gtk-doc \
+ $(use_enable systemd libsystemd-login) \
+ $(use_enable introspection) \
+ --disable-examples \
+ $(use_enable nls) \
+ "$(systemd_with_unitdir)" \
+ --with-authfw=$(usex pam pam shadow) \
+ $(use pam && echo --with-pam-module-dir="$(getpam_mod_dir)") \
+ --with-os-type=gentoo
+}
+
+src_compile() {
+ default
+
+ # Required for polkitd on hardened/PaX due to spidermonkey's JIT
+ local f='src/polkitbackend/.libs/polkitd test/polkitbackend/.libs/polkitbackendjsauthoritytest'
+ if has_version '>=dev-lang/spidermonkey-1.8.7[jit]'; then
+ pax-mark m ${f}
+ elif has_version '<dev-lang/spidermonkey-1.8.7'; then
+ pax-mark mr ${f}
+ fi
+}
+
+src_install() {
+ emake DESTDIR="${D}" install
+
+ dodoc docs/TODO HACKING NEWS README
+
+ fowners -R polkitd:root /{etc,usr/share}/polkit-1/rules.d
+
+ diropts -m0700 -o polkitd -g polkitd
+ keepdir /var/lib/polkit-1
+
+ if use examples; then
+ insinto /usr/share/doc/${PF}/examples
+ doins src/examples/{*.c,*.policy*}
+ fi
+
+ prune_libtool_files
+}
+
+pkg_postinst() {
+ chown -R polkitd:root "${EROOT}"/{etc,usr/share}/polkit-1/rules.d
+ chown -R polkitd:polkitd "${EROOT}"/var/lib/polkit-1
+}