pkgsrc-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[pkgsrc/trunk]: pkgsrc/security/polkit polkit: Add duktape backend. Disable m...
details: https://anonhg.NetBSD.org/pkgsrc/rev/03d9d0bd3843
branches: trunk
changeset: 455124:03d9d0bd3843
user: nia <nia%pkgsrc.org@localhost>
date: Mon Jun 28 12:38:46 2021 +0000
description:
polkit: Add duktape backend. Disable mozjs dependency.
Based on an unmerged merge request by Wu Xiaotian:
https://gitlab.freedesktop.org/polkit/polkit/-/merge_requests/35
Bump PKGREVISION.
diffstat:
security/polkit/Makefile | 17 +-
security/polkit/distinfo | 8 +-
security/polkit/patches/patch-configure.ac | 49 +
security/polkit/patches/patch-meson.build | 32 +
security/polkit/patches/patch-meson__options.txt | 12 +
security/polkit/patches/patch-src_polkitbackend_Makefile.am | 46 +
security/polkit/patches/patch-src_polkitbackend_meson.build | 38 +
security/polkit/patches/patch-src_polkitbackend_polkitbackendduktapeauthority.c | 1436 ++++++++++
8 files changed, 1632 insertions(+), 6 deletions(-)
diffs (truncated from 1713 to 300 lines):
diff -r df982369ed71 -r 03d9d0bd3843 security/polkit/Makefile
--- a/security/polkit/Makefile Mon Jun 28 12:34:08 2021 +0000
+++ b/security/polkit/Makefile Mon Jun 28 12:38:46 2021 +0000
@@ -1,6 +1,7 @@
-# $NetBSD: Makefile,v 1.34 2021/06/03 14:43:07 wiz Exp $
+# $NetBSD: Makefile,v 1.35 2021/06/28 12:38:46 nia Exp $
DISTNAME= polkit-0.119
+PKGREVISION= 1
CATEGORIES= security
MASTER_SITES= http://www.freedesktop.org/software/polkit/releases/
@@ -9,8 +10,9 @@
COMMENT= Authorization Manager
LICENSE= gnu-lgpl-v2
-BUILD_DEPENDS+= libxslt-[0-9]*:../../textproc/libxslt
-BUILD_DEPENDS+= docbook-xsl-[0-9]*:../../textproc/docbook-xsl
+TOOL_DEPENDS+= gettext-m4-[0-9]*:../../devel/gettext-m4
+TOOL_DEPENDS+= libxslt-[0-9]*:../../textproc/libxslt
+TOOL_DEPENDS+= docbook-xsl-[0-9]*:../../textproc/docbook-xsl
NOT_PAX_MPROTECT_SAFE= lib/polkit-1/polkitd
@@ -19,7 +21,9 @@
USE_LANGUAGES= c c++14
USE_LIBTOOL= yes
USE_PKGLOCALEDIR= yes
-USE_TOOLS+= pkg-config intltool gmake msgfmt perl
+USE_TOOLS+= pkg-config gmake perl
+USE_TOOLS+= intltool msgfmt msgmerge xgettext
+USE_TOOLS+= autoconf autoreconf automake
# configure: error: *** A compiler with support for C++17 language features is required.
GCC_REQD+= 7
@@ -31,6 +35,7 @@
CONFIGURE_ARGS+= --with-polkitd-user=${POLKITD_USER}
CONFIGURE_ARGS+= --disable-libsystemd-login
CONFIGURE_ARGS+= --disable-libelogind
+CONFIGURE_ARGS+= --with-duktape
.include "../../mk/bsd.prefs.mk"
@@ -69,8 +74,10 @@
SUBST_FILES.paths+= src/examples/org.freedesktop.policykit.examples.pkexec.policy.in
SUBST_SED.paths+= -e 's,/usr/bin/,${PREFIX}/bin/,g'
+pre-configure:
+ cd ${WRKSRC} && autoreconf -fi
-.include "../../lang/mozjs78/buildlink3.mk"
+.include "../../lang/libduktape/buildlink3.mk"
.include "../../devel/gettext-lib/buildlink3.mk"
.include "../../devel/glib2/buildlink3.mk"
.include "../../textproc/expat/buildlink3.mk"
diff -r df982369ed71 -r 03d9d0bd3843 security/polkit/distinfo
--- a/security/polkit/distinfo Mon Jun 28 12:34:08 2021 +0000
+++ b/security/polkit/distinfo Mon Jun 28 12:38:46 2021 +0000
@@ -1,10 +1,16 @@
-$NetBSD: distinfo,v 1.12 2021/06/03 14:43:07 wiz Exp $
+$NetBSD: distinfo,v 1.13 2021/06/28 12:38:46 nia Exp $
SHA1 (polkit-0.119.tar.gz) = 0794825e31a0a6e4859f93596d3f475b9d08f9e1
RMD160 (polkit-0.119.tar.gz) = 52d66bd2b80e3a1ca52495fd09e307adbd2360a0
SHA512 (polkit-0.119.tar.gz) = 0260fb15da1c4c1f429e8223260981e64e297f1be8ced42f6910f09ea6581b8205aca06c9c601eb4a128acba2f468de0223118f96862ba769f95721894cf1578
Size (polkit-0.119.tar.gz) = 1387409 bytes
+SHA1 (patch-configure.ac) = e6c26b07908b05e38b9049470bdd5da14f91b9ae
+SHA1 (patch-meson.build) = ca09024832bd68cc0e18fe9c00a27c3e9e6989df
+SHA1 (patch-meson__options.txt) = cb8d920382f3b2dca0d5992abb0adf979a729a1f
SHA1 (patch-src_polkit_polkitunixprocess.c) = 88818b7b64502f64eade34ad379c07f2b0fd1aea
+SHA1 (patch-src_polkitbackend_Makefile.am) = 3e821914e54ce5d3dc31275cd05d5266a3edc9ba
+SHA1 (patch-src_polkitbackend_meson.build) = 8f4788a5080902eaae949d1c026046d6a3321259
+SHA1 (patch-src_polkitbackend_polkitbackendduktapeauthority.c) = 33cc276888d48422b8239bee5532a9811cca9d21
SHA1 (patch-src_polkitbackend_polkitbackendinteractiveauthority.c) = dd91b4e74e6c39f24e0f5a9b3150fdac12899cb5
SHA1 (patch-src_polkitbackend_polkitbackendjsauthority.cpp) = 432a3d7d082ba6e596ba164d91408fc521b84422
SHA1 (patch-src_polkitbackend_polkitd.c) = b8e11b40e2b171d4f030eb4c4cbc6fdc7a96b2c2
diff -r df982369ed71 -r 03d9d0bd3843 security/polkit/patches/patch-configure.ac
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/security/polkit/patches/patch-configure.ac Mon Jun 28 12:38:46 2021 +0000
@@ -0,0 +1,49 @@
+$NetBSD: patch-configure.ac,v 1.1 2021/06/28 12:38:46 nia Exp $
+
+Add duktape as javascript engine.
+https://gitlab.freedesktop.org/polkit/polkit/-/merge_requests/35
+
+--- configure.ac.orig 2021-06-03 13:56:15.000000000 +0000
++++ configure.ac
+@@ -80,11 +80,22 @@ PKG_CHECK_MODULES(GLIB, [gmodule-2.0 gio
+ AC_SUBST(GLIB_CFLAGS)
+ AC_SUBST(GLIB_LIBS)
+
+-PKG_CHECK_MODULES(LIBJS, [mozjs-78])
+-
+-AC_SUBST(LIBJS_CFLAGS)
+-AC_SUBST(LIBJS_CXXFLAGS)
+-AC_SUBST(LIBJS_LIBS)
++dnl ---------------------------------------------------------------------------
++dnl - Check javascript backend
++dnl ---------------------------------------------------------------------------
++AC_ARG_WITH(duktape, AS_HELP_STRING([--with-duktape],[Use Duktape as javascript backend]),with_duktape=yes,with_duktape=no)
++AS_IF([test x${with_duktape} = xyes], [
++ PKG_CHECK_MODULES(LIBJS, [duktape >= 2.0.0 ])
++ AC_SUBST(LIBJS_CFLAGS)
++ AC_SUBST(LIBJS_LIBS)
++], [
++ PKG_CHECK_MODULES(LIBJS, [mozjs-78])
++
++ AC_SUBST(LIBJS_CFLAGS)
++ AC_SUBST(LIBJS_CXXFLAGS)
++ AC_SUBST(LIBJS_LIBS)
++])
++AM_CONDITIONAL(USE_DUKTAPE, [test x$with_duktape = xyes], [Using duktape as javascript engine library])
+
+ EXPAT_LIB=""
+ AC_ARG_WITH(expat, [ --with-expat=<dir> Use expat from here],
+@@ -581,6 +592,13 @@ echo "
+ PAM support: ${have_pam}
+ systemdsystemunitdir: ${systemdsystemunitdir}
+ polkitd user: ${POLKITD_USER}"
++if test "x${with_duktape}" = xyes; then
++echo "
++ Javascript engine: Duktape"
++else
++echo "
++ Javascript engine: Mozjs"
++fi
+
+ if test "$have_pam" = yes ; then
+ echo "
diff -r df982369ed71 -r 03d9d0bd3843 security/polkit/patches/patch-meson.build
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/security/polkit/patches/patch-meson.build Mon Jun 28 12:38:46 2021 +0000
@@ -0,0 +1,32 @@
+$NetBSD: patch-meson.build,v 1.1 2021/06/28 12:38:46 nia Exp $
+
+Add duktape as javascript engine.
+https://gitlab.freedesktop.org/polkit/polkit/-/merge_requests/35
+
+--- meson.build.orig 2021-06-03 13:56:35.000000000 +0000
++++ meson.build
+@@ -126,7 +126,13 @@ expat_dep = dependency('expat')
+ assert(cc.has_header('expat.h', dependencies: expat_dep), 'Can\'t find expat.h. Please install expat.')
+ assert(cc.has_function('XML_ParserCreate', dependencies: expat_dep), 'Can\'t find expat library. Please install expat.')
+
+-mozjs_dep = dependency('mozjs-78')
++js_engine = get_option('js_engine')
++if js_engine == 'duktape'
++ js_dep = dependency('duktape')
++ libm_dep = cc.find_library('m')
++elif js_engine == 'mozjs'
++ js_dep = dependency('mozjs-78')
++endif
+
+ dbus_dep = dependency('dbus-1')
+ dbus_confdir = dbus_dep.get_pkgconfig_variable('datadir', define_variable: ['datadir', pk_prefix / pk_datadir]) #changed from sysconfdir with respect to commit#8eada3836465838
+@@ -350,6 +356,9 @@ if enable_logind
+ output += ' systemdsystemunitdir: ' + systemd_systemdsystemunitdir + '\n'
+ endif
+ output += ' polkitd user: ' + polkitd_user + ' \n'
++output += ' Javascript engine: ' + js_engine + '\n'
++if enable_logind
++endif
+ output += ' PAM support: ' + enable_pam.to_string() + '\n\n'
+ if enable_pam
+ output += ' PAM file auth: ' + pam_conf['PAM_FILE_INCLUDE_AUTH'] + '\n'
diff -r df982369ed71 -r 03d9d0bd3843 security/polkit/patches/patch-meson__options.txt
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/security/polkit/patches/patch-meson__options.txt Mon Jun 28 12:38:46 2021 +0000
@@ -0,0 +1,12 @@
+$NetBSD: patch-meson__options.txt,v 1.1 2021/06/28 12:38:46 nia Exp $
+
+Add duktape as javascript engine.
+https://gitlab.freedesktop.org/polkit/polkit/-/merge_requests/35
+
+--- meson_options.txt.orig 2021-02-22 16:36:29.000000000 +0000
++++ meson_options.txt
+@@ -16,3 +16,4 @@ option('introspection', type: 'boolean',
+
+ option('gtk_doc', type: 'boolean', value: false, description: 'use gtk-doc to build documentation')
+ option('man', type: 'boolean', value: false, description: 'build manual pages')
++option('js_engine', type: 'combo', choices: ['mozjs', 'duktape'], value: 'duktape', description: 'javascript engine')
diff -r df982369ed71 -r 03d9d0bd3843 security/polkit/patches/patch-src_polkitbackend_Makefile.am
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/security/polkit/patches/patch-src_polkitbackend_Makefile.am Mon Jun 28 12:38:46 2021 +0000
@@ -0,0 +1,46 @@
+$NetBSD: patch-src_polkitbackend_Makefile.am,v 1.1 2021/06/28 12:38:46 nia Exp $
+
+Add duktape as javascript engine.
+https://gitlab.freedesktop.org/polkit/polkit/-/merge_requests/35
+
+--- src/polkitbackend/Makefile.am.orig 2021-05-19 07:47:09.000000000 +0000
++++ src/polkitbackend/Makefile.am
+@@ -33,7 +33,7 @@ libpolkit_backend_1_la_SOURCES =
+ polkitbackendprivate.h \
+ polkitbackendauthority.h polkitbackendauthority.c \
+ polkitbackendinteractiveauthority.h polkitbackendinteractiveauthority.c \
+- polkitbackendjsauthority.h polkitbackendjsauthority.cpp \
++ polkitbackendjsauthority.h \
+ polkitbackendactionpool.h polkitbackendactionpool.c \
+ polkitbackendactionlookup.h polkitbackendactionlookup.c \
+ $(NULL)
+@@ -51,19 +51,27 @@ libpolkit_backend_1_la_CFLAGS =
+ -D_POLKIT_BACKEND_COMPILATION \
+ $(GLIB_CFLAGS) \
+ $(LIBSYSTEMD_CFLAGS) \
+- $(LIBJS_CFLAGS) \
++ $(LIBJS_CFLAGS) \
+ $(NULL)
+
+ libpolkit_backend_1_la_CXXFLAGS = $(libpolkit_backend_1_la_CFLAGS)
+
+ libpolkit_backend_1_la_LIBADD = \
+ $(GLIB_LIBS) \
++ $(DUKTAPE_LIBS) \
+ $(LIBSYSTEMD_LIBS) \
+ $(top_builddir)/src/polkit/libpolkit-gobject-1.la \
+ $(EXPAT_LIBS) \
+- $(LIBJS_LIBS) \
++ $(LIBJS_LIBS) \
+ $(NULL)
+
++if USE_DUKTAPE
++libpolkit_backend_1_la_SOURCES += polkitbackendduktapeauthority.c
++libpolkit_backend_1_la_LIBADD += -lm
++else
++libpolkit_backend_1_la_SOURCES += polkitbackendjsauthority.cpp
++endif
++
+ rulesdir = $(sysconfdir)/polkit-1/rules.d
+ rules_DATA = 50-default.rules
+
diff -r df982369ed71 -r 03d9d0bd3843 security/polkit/patches/patch-src_polkitbackend_meson.build
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/security/polkit/patches/patch-src_polkitbackend_meson.build Mon Jun 28 12:38:46 2021 +0000
@@ -0,0 +1,38 @@
+$NetBSD: patch-src_polkitbackend_meson.build,v 1.1 2021/06/28 12:38:46 nia Exp $
+
+Add duktape as javascript engine.
+https://gitlab.freedesktop.org/polkit/polkit/-/merge_requests/35
+
+--- src/polkitbackend/meson.build.orig 2021-05-19 07:47:09.000000000 +0000
++++ src/polkitbackend/meson.build
+@@ -5,7 +5,6 @@ sources = files(
+ 'polkitbackendactionpool.c',
+ 'polkitbackendauthority.c',
+ 'polkitbackendinteractiveauthority.c',
+- 'polkitbackendjsauthority.cpp',
+ )
+
+ output = 'initjs.h'
+@@ -21,7 +20,7 @@ sources += custom_target(
+ deps = [
+ expat_dep,
+ libpolkit_gobject_dep,
+- mozjs_dep,
++ js_dep,
+ ]
+
+ c_flags = [
+@@ -31,6 +30,13 @@ c_flags = [
+ '-DPACKAGE_SYSCONF_DIR="@0@"'.format(pk_prefix / pk_sysconfdir),
+ ]
+
++if js_engine == 'duktape'
++ sources += files('polkitbackendduktapeauthority.c')
++ deps += libm_dep
++elif js_engine == 'mozjs'
++ sources += files('polkitbackendjsauthority.cpp')
++endif
++
+ if enable_logind
+ sources += files('polkitbackendsessionmonitor-systemd.c')
+
diff -r df982369ed71 -r 03d9d0bd3843 security/polkit/patches/patch-src_polkitbackend_polkitbackendduktapeauthority.c
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/security/polkit/patches/patch-src_polkitbackend_polkitbackendduktapeauthority.c Mon Jun 28 12:38:46 2021 +0000
@@ -0,0 +1,1436 @@
+$NetBSD: patch-src_polkitbackend_polkitbackendduktapeauthority.c,v 1.1 2021/06/28 12:38:46 nia Exp $
+
+Add duktape as javascript engine.
+https://gitlab.freedesktop.org/polkit/polkit/-/merge_requests/35
+
+--- src/polkitbackend/polkitbackendduktapeauthority.c.orig 2021-06-28 12:18:53.849178838 +0000
++++ src/polkitbackend/polkitbackendduktapeauthority.c
+@@ -0,0 +1,1428 @@
++/*
++ * Copyright (C) 2008-2012 Red Hat, Inc.
++ * Copyright (C) 2015 Tangent Space <jstpierre%mecheye.net@localhost>
++ * Copyright (C) 2019 Wu Xiaotian <yetist%gmail.com@localhost>
++ *
++ * This library is free software; you can redistribute it and/or
++ * modify it under the terms of the GNU Lesser General Public
++ * License as published by the Free Software Foundation; either
++ * version 2 of the License, or (at your option) any later version.
++ *
++ * This library is distributed in the hope that it will be useful,
++ * but WITHOUT ANY WARRANTY; without even the implied warranty of
++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
++ * Lesser General Public License for more details.
++ *
Home |
Main Index |
Thread Index |
Old Index