Skip to contentSkip to conversation

spidermonkey: new package.

PATCH New aduskett at gmail.com 2 participants 8 messages Nov 25, 2019 RISC-V

lore
Share & tools
lore
#0 lore raw

v3 cover spidermonkey: new package.

From: Adam Duskett <[email protected]>

Spidermonkey is Mozilla's JavaScript engine written in C and C++. It is used in various Mozilla products, including Firefox, and is available under the MPL2.

There are 19 patches currently required to properly cross-compile spidermonkey:

1) allow-newer-autoconf-versions
- Spidermonkey is hardcoded to use Autoconf 2.13, which is from 1999! The reasoning behind using 2.13 is because newer versions of Autoconf do not work correctly with the custom m4 macros in the source code.

However: Because we are building just the Spidermonkey engine instead of the entire Firefox package, newer versions of Autoconf work without issue.
See: See: https://bugzilla.mozilla.org/show_bug.cgi?id=104642
for further explanation.

2) allow-building-in-tree
- By default, spidermonkey must be configured and built out-of-tree, otherwise the following error occurs:

FATAL ERROR PROCESSING MOZBUILD FILE
==============================

The error occurred while processing the following file or one of the files it includes:
js/src/shell/moz.build

The error occurred when validating the result of the execution. The reported error is:
The path specified in LOCAL_INCLUDES is not allowed:
.. (resolved to js/src)
Remove this check, as spidermonkey builds without issue in-tree.

3) allow-unknown-configuration-options
- By default, if an unknown parameter is passed to configure, an error is raised. Replace the raise with a pass and continue.
Fixes: https://bugzilla.mozilla.org/show_bug.cgi?id=1379540

4) fix-building-with-musl
- The MIPS specific header <sgidefs.h> is not provided by musl. The Linux kernel headers <asm/sgidefs.h> provide the same definitions.

5) add-riscv-support
- Submitted upstream:

    See: https://bugzilla.mozilla.org/show_bug.cgi?id=1318905

6) copy-headers-on-install-instead-of-symlinking
- When installing, instead of linking the headers to the source directory, copy them.

7) ensure-proper-running-on-64-bit-and-32-bit-be-platforms
- Taken from the Fedora RPM

    Applied upstream.
    Fixes: https://bugzilla.mozilla.org/show_bug.cgi?id=1488552

8) 0008-save-and-restore-non-volatile-x28-on-ARM64-for-generated-unboxed-obje
- Taken from the Fedora RPM:

    Applied upstream.
    Fixes: https://bugzilla.mozilla.org/show_bug.cgi?id=1375074

9) save-x28-before-clobbering-it-in-the-regex-compiler
- Taken from the Fedora RPM:

    Applied upstream.
    Fixes: https://bugzilla.mozilla.org/show_bug.cgi?id=1445907

10) always-use-the-equivalent-year-to-determine-the-time-zone
- Taken from the Fedora RPM:

    Applied upstream.
    Fixes: https://bugzilla.mozilla.org/show_bug.cgi?id=1415202

Typically, The Firefox source tarball is used to build spidermonkey; however, this has two disadvantages:
- It's large. The Firefox source tarball is over 250M.
- It requires Autoconf 2.13
Instead, use a tarball with only the Spidermonkey source code in it with a pre-setup configure file. This tarball reduces the size to 31M and prevents the Autoconf 2.13 requirement.

Also in this patch set:
- Update polkit to 0.116
- Update polkit to support systemd-logind
- Update polkit to support linux-pam

Tested with test-pkg -a
- 44 tests completed:
- 18 OK
- 26 SKIPPED
- 0 FAILED

Changes from v1 -> v2:
- When making large patch series like this, I tend to do all of my work in my own fork of buildroot, and then copy the changes over to a master copy of buildroot. I was testing spidermonkey without host_python_ssl to make sure it's actually a requirement (It is), and I forgot to re-add it back before making the patch. Doh!

Changes from v2 -> v3:
- Applied Thomas' suggestions.
- Added dbus as a runtime dependency of polkit (polkitd will crash without it)
- Added an initrc S50polkit file.
- Added a polkit user (polkitd requires it.)

Adam Duskett (4):
spidermonkey: new package
package/polkit: bump to version 0.116 package/polkit: support different authentication frameworks package/polkit: enable systemd login support

 DEVELOPERS                                    |   2 +
 package/Config.in                             |   1 +
 .../0001-make-netgroup-support-optional.patch | 232 ++++++++++++++++++
 package/polkit/Config.in                      |  24 +-
 package/polkit/S50polkit                      |  16 ++
 package/polkit/polkit.hash                    |   2 +-
 package/polkit/polkit.mk                      |  39 ++-
 package/polkit/polkit.service                 |   7 +
 .../0001-allow-newer-autoconf-versions.patch  |  61 +++++
 .../0002-allow-building-in-tree.patch         |  47 ++++
 ...-allow-unknown-configuration-options.patch |  35 +++
 .../0004-fix-building-with-musl.patch         | 133 ++++++++++
 .../spidermonkey/0005-add-riscv-support.patch | 121 +++++++++
 ...ers-on-install-instead-of-symlinking.patch |  34 +++
 ...ng-on-64-bit-and-32-bit-be-platforms.patch | 144 +++++++++++
 ...-on-ARM64-for-generated-unboxed-obje.patch |  66 +++++
 ...-clobbering-it-in-the-regex-compiler.patch | 100 ++++++++
 ...lent-year-to-determine-the-time-zone.patch | 103 ++++++++
 package/spidermonkey/Config.in                |  47 ++++
 package/spidermonkey/spidermonkey.hash        |   3 +
 package/spidermonkey/spidermonkey.mk          |  58 +++++
 21 files changed, 1264 insertions(+), 11 deletions(-)
 create mode 100644 package/polkit/0001-make-netgroup-support-optional.patch
 create mode 100644 package/polkit/S50polkit
 create mode 100644 package/polkit/polkit.service
 create mode 100644 package/spidermonkey/0001-allow-newer-autoconf-versions.patch
 create mode 100644 package/spidermonkey/0002-allow-building-in-tree.patch
 create mode 100644 package/spidermonkey/0003-allow-unknown-configuration-options.patch
 create mode 100644 package/spidermonkey/0004-fix-building-with-musl.patch
 create mode 100644 package/spidermonkey/0005-add-riscv-support.patch
 create mode 100644 package/spidermonkey/0006-copy-headers-on-install-instead-of-symlinking.patch
 create mode 100644 package/spidermonkey/0007-ensure-proper-running-on-64-bit-and-32-bit-be-platforms.patch
 create mode 100644 package/spidermonkey/0008-save-and-restore-non-volatile-x28-on-ARM64-for-generated-unboxed-obje.patch
 create mode 100644 package/spidermonkey/0009-save-x28-before-clobbering-it-in-the-regex-compiler.patch
 create mode 100644 package/spidermonkey/0010-always-use-the-equivalent-year-to-determine-the-time-zone.patch
 create mode 100644 package/spidermonkey/Config.in
 create mode 100644 package/spidermonkey/spidermonkey.hash
 create mode 100644 package/spidermonkey/spidermonkey.mk
Signature · 1 line
2.23.0
#1 lore raw

PATCH v3 1/4 spidermonkey: new package

From: Adam Duskett <[email protected]>

Spidermonkey is Mozilla's JavaScript engine written in C and C++. It is used in various Mozilla products, including Firefox, and is available under the MPL2.

There are 10 patches currently required to properly cross-compile spidermonkey:

1) allow-newer-autoconf-versions
- Spidermonkey is hardcoded to use Autoconf 2.13, which is from 1999! The reasoning behind using 2.13 is because newer versions of Autoconf do not work correctly with the custom m4 macros in the source code.

However: Because we are building just the Spidermonkey engine instead of the entire Firefox package, newer versions of Autoconf work without issue.
See: See: https://bugzilla.mozilla.org/show_bug.cgi?id=104642
for further explanation.

2) allow-building-in-tree
- By default, spidermonkey must be configured and built out-of-tree, otherwise the following error occurs:

FATAL ERROR PROCESSING MOZBUILD FILE
==============================

The error occurred while processing the following file or one of the files it includes:
js/src/shell/moz.build

The error occurred when validating the result of the execution. The reported error is:
The path specified in LOCAL_INCLUDES is not allowed:
.. (resolved to js/src)
Remove this check, as spidermonkey builds without issue in-tree.

3) allow-unknown-configuration-options
- By default, if an unknown parameter is passed to configure, an error is raised. Replace the raise with a pass and continue.
Fixes: https://bugzilla.mozilla.org/show_bug.cgi?id=1379540

4) fix-building-with-musl
- The MIPS specific header <sgidefs.h> is not provided by musl. The Linux kernel headers <asm/sgidefs.h> provide the same definitions.

5) add-riscv-support
- Submitted upstream:

    See: https://bugzilla.mozilla.org/show_bug.cgi?id=1318905

6) copy-headers-on-install-instead-of-symlinking
- When installing, instead of linking the headers to the source directory, copy them.

7) ensure-proper-running-on-64-bit-and-32-bit-be-platforms
- Taken from the Fedora RPM

    Applied upstream.
    Fixes: https://bugzilla.mozilla.org/show_bug.cgi?id=1488552

8) 0008-save-and-restore-non-volatile-x28-on-ARM64-for-generated-unboxed-obje
- Taken from the Fedora RPM:

    Applied upstream.
    Fixes: https://bugzilla.mozilla.org/show_bug.cgi?id=1375074

9) save-x28-before-clobbering-it-in-the-regex-compiler
- Taken from the Fedora RPM:

    Applied upstream.
    Fixes: https://bugzilla.mozilla.org/show_bug.cgi?id=1445907

10) always-use-the-equivalent-year-to-determine-the-time-zone
- Taken from the Fedora RPM:

    Applied upstream.
    Fixes: https://bugzilla.mozilla.org/show_bug.cgi?id=1415202

Typically, The Firefox source tarball is used to build spidermonkey; however, this has two disadvantages:
- It's large. The Firefox source tarball is over 250M.
- It requires Autoconf 2.13
Instead, use a tarball with only the Spidermonkey source code in it with a pre-setup configure file. This tarball reduces the size to 31M and prevents the Autoconf 2.13 requirement.

---
Changes v1 -> v2:
- Add select BR2_PACKAGE_HOST_PYTHON_SSL to package/spidermonkey/Config.in this line was left out from a old Config file that was copied over when making the patch.

Changes v2 -> v3:
- Fix typo pertaining to the total number of patches (Thomas)
- Change BR2_PACKAGE_SPIDERMONKEY_ARCH_SUPPORTS to an explicit list of supported architectures. (Thomas)
- Fix Alphabetic ordering. (Thomas)
- Fix Depends menu. (Thomas)
- Fix GCC version check in depends menu. (Thomas)
- Change _LICENSE line ordering (Thomas)
- Drop host-perl dependency. (Thomas)
- Drop host-zip dependency. (Thomas)
- Move --disable-readline to a if clause. (Thomas)
- Move --enable-ion to a if clause. (Thomas)

 DEVELOPERS                                    |   1 +
 package/Config.in                             |   1 +
 .../0001-allow-newer-autoconf-versions.patch  |  61 ++++++++
 .../0002-allow-building-in-tree.patch         |  47 ++++++
 ...-allow-unknown-configuration-options.patch |  35 +++++
 .../0004-fix-building-with-musl.patch         | 133 ++++++++++++++++
 .../spidermonkey/0005-add-riscv-support.patch | 121 +++++++++++++++
 ...ers-on-install-instead-of-symlinking.patch |  34 +++++
 ...ng-on-64-bit-and-32-bit-be-platforms.patch | 144 ++++++++++++++++++
 ...-on-ARM64-for-generated-unboxed-obje.patch |  66 ++++++++
 ...-clobbering-it-in-the-regex-compiler.patch | 100 ++++++++++++
 ...lent-year-to-determine-the-time-zone.patch | 103 +++++++++++++
 package/spidermonkey/Config.in                |  47 ++++++
 package/spidermonkey/spidermonkey.hash        |   3 +
 package/spidermonkey/spidermonkey.mk          |  58 +++++++
 15 files changed, 954 insertions(+)
 create mode 100644 package/spidermonkey/0001-allow-newer-autoconf-versions.patch
 create mode 100644 package/spidermonkey/0002-allow-building-in-tree.patch
 create mode 100644 package/spidermonkey/0003-allow-unknown-configuration-options.patch
 create mode 100644 package/spidermonkey/0004-fix-building-with-musl.patch
 create mode 100644 package/spidermonkey/0005-add-riscv-support.patch
 create mode 100644 package/spidermonkey/0006-copy-headers-on-install-instead-of-symlinking.patch
 create mode 100644 package/spidermonkey/0007-ensure-proper-running-on-64-bit-and-32-bit-be-platforms.patch
 create mode 100644 package/spidermonkey/0008-save-and-restore-non-volatile-x28-on-ARM64-for-generated-unboxed-obje.patch
 create mode 100644 package/spidermonkey/0009-save-x28-before-clobbering-it-in-the-regex-compiler.patch
 create mode 100644 package/spidermonkey/0010-always-use-the-equivalent-year-to-determine-the-time-zone.patch
 create mode 100644 package/spidermonkey/Config.in
 create mode 100644 package/spidermonkey/spidermonkey.hash
 create mode 100644 package/spidermonkey/spidermonkey.mk
DEVELOPERS +1 -0
index 5837bbfab2..544e3ac1c3 100644
@@ -73,6 +73,7 @@ F:	package/selinux-python/
 F:	package/semodule-utils/
 F:	package/setools/
 F:	package/sngrep/
+F:	package/spidermonkey/
 F:	package/systemd/
 
 N:	Adam Heinrich <[email protected]>
package/Config.in +1 -0
index c04626173d..5f913316d8 100644
@@ -1490,6 +1490,7 @@ endif
 	source "package/jsmin/Config.in"
 	source "package/json-javascript/Config.in"
 	source "package/openlayers/Config.in"
+	source "package/spidermonkey/Config.in"
 endmenu
 
 menu "JSON/XML"
package/spidermonkey/0001-allow-newer-autoconf-versions.patch new file +61 -0

61 lines not on this page · raw message

package/spidermonkey/0002-allow-building-in-tree.patch new file +47 -0

47 lines not on this page · raw message

package/spidermonkey/0003-allow-unknown-configuration-options.patch new file +35 -0
new file mode 100644
index 0000000000..b489075a94
@@ -0,0 +1,35 @@
+From 4a06a1a6a71293decb83aee7adb74bc709493106 Mon Sep 17 00:00:00 2001
+From: Philip Chimento <[email protected]>
+Date: Wed, 5 Jul 2017 22:57:09 -0700
+Subject: [PATCH] allow unknown configuration options
+
+By default, if an unknown parameter is passed to configure, an error is raised.
+Replace the raise with a pass and continue.
+
+Fixes: https://bugzilla.mozilla.org/show_bug.cgi?id=1379540
+
+Signed-off-by: Philip Chimento <[email protected]>
+Signed-off-by: Adam Duskett <[email protected]>
+---
+ js/src/configure                               | 9 +++++++++
+ python/mozbuild/mozbuild/configure/__init__.py | 2 +-
+ python/mozbuild/mozbuild/configure/options.py  | 6 +++++-
+ 3 files changed, 15 insertions(+), 2 deletions(-)
+ create mode 100755 js/src/configure
+
+diff --git a/python/mozbuild/mozbuild/configure/__init__.py b/python/mozbuild/mozbuild/configure/__init__.py
+index 0fe640ca..09b460d3 100644
+--- a/python/mozbuild/mozbuild/configure/__init__.py
++++ b/python/mozbuild/mozbuild/configure/__init__.py
+@@ -421,7 +421,7 @@ def run(self, path=None):
+         # All options should have been removed (handled) by now.
+         for arg in self._helper:
+             without_value = arg.split('=', 1)[0]
+-            raise InvalidOptionError('Unknown option: %s' % without_value)
++            pass
+ 
+         # Run the execution queue
+         for func, args in self._execution_queue:
+--
+2.23.0
+
package/spidermonkey/0004-fix-building-with-musl.patch new file +133 -0

133 lines not on this page · raw message

package/spidermonkey/0005-add-riscv-support.patch new file +121 -0

121 lines not on this page · raw message

package/spidermonkey/0006-copy-headers-on-install-instead-of-symlinking.patch new file +34 -0
new file mode 100644
index 0000000000..10ca54c702
@@ -0,0 +1,34 @@
+From 903a79a1efff18fc7cc50db09a3fe5d768adc9a8 Mon 19 Mar 2018 09:58:06 +0100
+From: Rico Tzschichholz <[email protected]>
+Date: Wed, 5 Jul 2017 22:45:59 -0700
+Subject: build: Copy headers on install instead of symlinking
+
+Patch ported from mozjs52 by Philip Chimento
+
+Signed-off-by: Rico Tzschichholz <[email protected]>
+Signed-off-by: Adam Duskett <[email protected]>
+---
+ python/mozbuild/mozbuild/backend/recursivemake.py | 6 +++---
+ 1 file changed, 3 insertions(+), 3 deletions(-)
+
+diff --git a/python/mozbuild/mozbuild/backend/recursivemake.py b/python/mozbuild/mozbuild/backend/recursivemake.py
+index dd9020d..6918ef8 100644
+--- a/python/mozbuild/mozbuild/backend/recursivemake.py
++++ b/python/mozbuild/mozbuild/backend/recursivemake.py
+@@ -1427,11 +1427,11 @@ class RecursiveMakeBackend(CommonBackend):
+                                 raise Exception("Wildcards are only supported in the filename part of "
+                                                 "srcdir-relative or absolute paths.")
+ 
+-                            install_manifest.add_pattern_link(basepath, wild, path)
++                            install_manifest.add_pattern_copy(basepath, wild, path)
+                         else:
+-                            install_manifest.add_pattern_link(f.srcdir, f, path)
++                            install_manifest.add_pattern_copy(f.srcdir, f, path)
+                     else:
+-                        install_manifest.add_link(f.full_path, dest)
++                        install_manifest.add_copy(f.full_path, dest)
+                 else:
+                     install_manifest.add_optional_exists(dest)
+                     backend_file.write('%s_FILES += %s\n' % (
+--
+2.23.0
package/spidermonkey/0007-ensure-proper-running-on-64-bit-and-32-bit-be-platforms.patch new file +144 -0

144 lines not on this page · raw message

package/spidermonkey/0008-save-and-restore-non-volatile-x28-on-ARM64-for-generated-unboxed-obje.patch new file +66 -0

66 lines not on this page · raw message

package/spidermonkey/0009-save-x28-before-clobbering-it-in-the-regex-compiler.patch new file +100 -0

100 lines not on this page · raw message

package/spidermonkey/0010-always-use-the-equivalent-year-to-determine-the-time-zone.patch new file +103 -0

103 lines not on this page · raw message

package/spidermonkey/Config.in new file +47 -0

47 lines not on this page · raw message

package/spidermonkey/spidermonkey.hash new file +3 -0
new file mode 100644
index 0000000000..ccb0265861
@@ -0,0 +1,3 @@
+# Locally computed
+sha256 f51039c997415fd0f13f8e01966b4a8ff80cbf90deb8b14c18827104a369cc0d mozjs-60.5.2.tar.bz2
+sha256 aaac93a33bec26d5d1a9c5efc1e7dc6bd215d8a4f1e1a7fc5315a67adfd51338 moz.configure
package/spidermonkey/spidermonkey.mk new file +58 -0

58 lines not on this page · raw message

Signature · 1 line
2.23.0
#2 lore raw

PATCH v3 1/4 spidermonkey: new package

Hello,

Quoted 1 line · On Mon, 25 Nov 2019 09:50:28 -0800 aduskett at gmail.com wrote:

From: Adam Duskett <[email protected]>

The commit title should have been "package/spidermonkey: new package".

Quoted 37 lines
package/spidermonkey/Config.in new file +31 -0
new file mode 100644
index 0000000000..487db6ac6d
@@ -0,0 +1,47 @@
+config BR2_PACKAGE_SPIDERMONKEY_ARCH_SUPPORTS
+	bool
+	default y if BR2_aarch64
+	default y if BR2_arm || BR2_armeb
+	default y if BR2_i386 || BR2_x86_64
+	default y if BR2_mips || BR2_mipsel || BR2_mips64 || BR2_mips64el
+	default y if BR2_powerpc || BR2_powerpc64 || BR2_powerpc64le
+	default y if BR2_riscv
+	default y if BR2_sh4 || BR2_sh4a
+	default y if BR2_sparc || BR2_sparc64
+
+config BR2_PACKAGE_SPIDERMONKEY_JIT_ARCH_SUPPORTS
+	bool
+	default y if BR2_aarch64  || BR2_arm || BR2_armeb || BR2_i386 || BR2_x86_64
+
+config BR2_PACKAGE_SPIDERMONKEY
+	bool "spidermonkey"
+	depends on BR2_INSTALL_LIBSTDCPP
+	depends on BR2_PACKAGE_LIBNSPR_ARCH_SUPPORT # libnspr
+	depends on BR2_PACKAGE_SPIDERMONKEY_ARCH_SUPPORTS
+	depends on BR2_TOOLCHAIN_GCC_AT_LEAST_4_9
+	depends on BR2_TOOLCHAIN_HAS_THREADS_NPTL # needs pthread_getattr_np()
+	depends on BR2_USE_MMU # fork in executable tools.
+	depends on BR2_USE_WCHAR
+	depends on !BR2_TOOLCHAIN_USES_UCLIBC # No way to check for fenv support.
+	depends on !BR2_STATIC_LIBS # dlopen
+	select BR2_PACKAGE_HOST_PYTHON
+	select BR2_PACKAGE_HOST_PYTHON_SSL
+	select BR2_PACKAGE_LIBNSPR
+	select BR2_PACKAGE_ZLIB
+	help

package/spidermonkey/Config.in line 41

Quoted 10 lines
package/spidermonkey/Config.in new file +10 -0
+	  SpiderMonkey is the code-name for Mozilla Firefox's C++
+	  implementation of JavaScript. It is intended to be embedded in
+	  other applications that provide host environments for
+	  JavaScript.
+
+	  https://developer.mozilla.org/en-US/docs/Mozilla/Projects/SpiderMonkey
+
+comment "spidermonkey needs a glibc or musl toolchain with C++, wchar, dynamic library, NPTL, gcc >= 4.9"
+	depends on BR2_USE_MMU
+	depends on BR2_PACKAGE_LIBNSPR_ARCH_SUPPORT

You forgot BR2_PACKAGE_SPIDERMONKEY_ARCH_SUPPORTS here. However I've simplified things by moving the "depends on BR2_PACKAGE_LIBNSPR_ARCH_SUPPORT" into the definition of BR2_PACKAGE_SPIDERMONKEY_ARCH_SUPPORTS.

package/spidermonkey/Config.in line 47

Quoted 6 lines
package/spidermonkey/Config.in new file +6 -0
+SPIDERMONKEY_DEPENDENCIES = \
+	host-python \
+	libnspr \
+	zlib
+
+SPIDERMONKEY_CONF_ENV += \

= sign is sufficient here.

I've applied to next with those fixes.

Thanks,

Thomas

Signature · 3 lines
Thomas Petazzoni, CTO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
#3 lore raw

PATCH v3 2/4 package/polkit: bump to version 0.116

In reply to aduskett at gmail.com

From: Adam Duskett <[email protected]>

Other changes:
- Add spidermonkey as a dependency.
- Add 0001-make-netgroup-support-optional.patch to allow building on musl.
- Add S50polkit
- Add a polkit user
- Add a runtime dependency on dbus.
- Change --enable-libelogind=no to --disable-libelongind

---
Changes v2 -> v3:
- Add S50polkit
- Add a polkit user for runtime as polkitd requires a polkit user.
- Add a runtime dependency on dbus as polkitd requires it.
- Remove transitive dependency comments (Thomas)
- Fix dependency comment formatting. (Thomas)

 DEVELOPERS                                    |   1 +
 .../0001-make-netgroup-support-optional.patch | 232 ++++++++++++++++++
 package/polkit/Config.in                      |  24 +-
 package/polkit/S50polkit                      |  16 ++
 package/polkit/polkit.hash                    |   2 +-
 package/polkit/polkit.mk                      |  25 +-
 package/polkit/polkit.service                 |   7 +
 7 files changed, 298 insertions(+), 9 deletions(-)
 create mode 100644 package/polkit/0001-make-netgroup-support-optional.patch
 create mode 100644 package/polkit/S50polkit
 create mode 100644 package/polkit/polkit.service
DEVELOPERS +1 -0
index 544e3ac1c3..2ab80644a8 100644
@@ -53,6 +53,7 @@ F:	package/openjdk/
 F:	package/openjdk-bin/
 F:	package/php/
 F:	package/policycoreutils/
+F:	package/polkit/
 F:	package/python3/
 F:	package/python-aioredis/
 F:	package/python-asgiref/
package/polkit/0001-make-netgroup-support-optional.patch new file +232 -0

232 lines not on this page · raw message

package/polkit/Config.in +19 -5
index ac17cb4dc3..7ba6dad993 100644
@@ -1,11 +1,18 @@
 config BR2_PACKAGE_POLKIT
 	bool "polkit"
+	depends on BR2_INSTALL_LIBSTDCPP # spidermonkey
+	depends on BR2_PACKAGE_LIBNSPR_ARCH_SUPPORT # spidermonkey
+	depends on BR2_PACKAGE_SPIDERMONKEY_ARCH_SUPPORTS # spidermonkey
+	depends on BR2_TOOLCHAIN_GCC_AT_LEAST_4_9 # spidermonkey
+	depends on BR2_TOOLCHAIN_HAS_THREADS_NPTL # spidermonkey
 	depends on BR2_USE_MMU # libglib2
-	depends on BR2_TOOLCHAIN_HAS_THREADS # libglib2
-	depends on BR2_TOOLCHAIN_USES_GLIBC
 	depends on BR2_USE_WCHAR # libglib2
-	select BR2_PACKAGE_LIBGLIB2
+	depends on !BR2_STATIC_LIBS # spidermonkey
+	depends on !BR2_TOOLCHAIN_USES_UCLIBC # spidermonkey
+	select BR2_PACKAGE_DBUS # runtime
 	select BR2_PACKAGE_EXPAT
+	select BR2_PACKAGE_LIBGLIB2
+	select BR2_PACKAGE_SPIDERMONKEY
 	help
 	  PolicyKit is a toolkit for defining and handling
 	  authorizations. It is used for allowing unprivileged
@@ -13,6 +20,13 @@ config BR2_PACKAGE_POLKIT
 
 	  http://www.freedesktop.org/wiki/Software/polkit
 
-comment "polkit needs a toolchain w/ wchar, threads"
+comment "polkit needs a glibc or musl toolchain with C++, wchar, dynamic library, NPTL, gcc >= 4.9"
 	depends on BR2_USE_MMU
-	depends on !BR2_USE_WCHAR || !BR2_TOOLCHAIN_HAS_THREADS
+	depends on BR2_PACKAGE_LIBNSPR_ARCH_SUPPORT
+	depends on BR2_PACKAGE_SPIDERMONKEY_ARCH_SUPPORTS
+	depends on BR2_TOOLCHAIN_USES_UCLIBC || \
+		!BR2_INSTALL_LIBSTDCPP || \
+		BR2_STATIC_LIBS || \
+		!BR2_TOOLCHAIN_HAS_THREADS_NPTL || \
+		!BR2_TOOLCHAIN_GCC_AT_LEAST_4_9 || \
+		!BR2_USE_WCHAR
package/polkit/S50polkit new file +16 -0
new file mode 100644
index 0000000000..69b71ee500
@@ -0,0 +1,16 @@
+#!/bin/sh
+#
+# Start polkitd
+#
+
+umask 077
+
+case "$1" in
+  start)
+  echo "Starting polkitd..."
+  /usr/lib/polkit-1/polkitd --no-debug &
+  ;;
+  *)
+  echo "Usage: $0 {start}"
+  exit 1
+esac
package/polkit/polkit.hash +1 -1
index 6368091c4a..bacd682139 100644
@@ -1,5 +1,5 @@
 # Locally calculated after checking pgp signature
-sha256	8fdc7cc8ba4750fcce1a4db9daa759c12afebc7901237e1c993c38f08985e1df	polkit-0.105.tar.gz
+sha256	88170c9e711e8db305a12fdb8234fac5706c61969b94e084d0f117d8ec5d34b1	polkit-0.116.tar.gz
 
 # Locally calculated
 sha256	d2e2aa973e29c75e1b492e67ea7b7da9de2d501d49a934657971fd74f9a0b0a8	COPYING
package/polkit/polkit.mk +22 -3
index fb4c171c52..96af4033ff 100644
@@ -4,20 +4,39 @@
 #
 ################################################################################
 
-POLKIT_VERSION = 0.105
+POLKIT_VERSION = 0.116
 POLKIT_SITE = http://www.freedesktop.org/software/polkit/releases
 POLKIT_LICENSE = GPL-2.0
 POLKIT_LICENSE_FILES = COPYING
 
 POLKIT_INSTALL_STAGING = YES
 
-POLKIT_DEPENDENCIES = libglib2 host-intltool expat
+POLKIT_DEPENDENCIES = libglib2 host-intltool expat dbus spidermonkey
 
 # We could also support --with-authfw=pam
 POLKIT_CONF_OPTS = \
 	--with-authfw=shadow \
 	--with-os-type=unknown \
 	--disable-man-pages \
-	--disable-examples
+	--disable-examples \
+	--disable-libelogind \
+	--disable-libsystemd-login
+
+define POLKIT_USERS
+	polkitd -1 polkitd -1 * /usr/lib/polkit-1 /bin/sh - Polkit Daemon
+endef
+
+define POLKIT_INSTALL_INIT_SYSTEMD
+	$(INSTALL) -D -m 644 package/polkit/polkit.service \
+		$(TARGET_DIR)/usr/lib/systemd/system/polkit.service
+	mkdir -p $(TARGET_DIR)/etc/systemd/system/multi-user.target.wants
+	ln -sf ../../../../usr/lib/systemd/system/polkit.service \
+		$(TARGET_DIR)/etc/systemd/system/multi-user.target.wants/polkit.service
+endef
+
+define POLKIT_INSTALL_INIT_SYSV
+	$(INSTALL) -D -m 0755 package/polkit/S50polkit \
+		$(TARGET_DIR)/etc/init.d/S50polkit
+endef
 
 $(eval $(autotools-package))
package/polkit/polkit.service new file +7 -0
new file mode 100644
index 0000000000..013e3684c5
@@ -0,0 +1,7 @@
+[Unit]
+Description=Authorization Manager
+
+[Service]
+Type=dbus
+BusName=org.freedesktop.PolicyKit1
+ExecStart=/usr/lib/polkit-1/polkitd --no-debug
Signature · 1 line
2.23.0
#4 lore raw

PATCH v3 2/4 package/polkit: bump to version 0.116

Hello,

package/polkit/Config.in line 4

Quoted 9 lines · On Mon, 25 Nov 2019 09:50:29 -0800 aduskett at gmail.com wrote:
package/polkit/Config.in +2 -0
index ac17cb4dc3..7ba6dad993 100644
@@ -1,11 +1,18 @@
 config BR2_PACKAGE_POLKIT
 	bool "polkit"
+	depends on BR2_INSTALL_LIBSTDCPP # spidermonkey
+	depends on BR2_PACKAGE_LIBNSPR_ARCH_SUPPORT # spidermonkey

This one is no longer needed, as it is now implied by BR2_PACKAGE_SPIDERMONKEY_ARCH_SUPPORTS.

package/polkit/Config.in line 11

Quoted 10 lines
package/polkit/Config.in +5 -3
+	depends on BR2_PACKAGE_SPIDERMONKEY_ARCH_SUPPORTS # spidermonkey
+	depends on BR2_TOOLCHAIN_GCC_AT_LEAST_4_9 # spidermonkey
+	depends on BR2_TOOLCHAIN_HAS_THREADS_NPTL # spidermonkey
 	depends on BR2_USE_MMU # libglib2
-	depends on BR2_TOOLCHAIN_HAS_THREADS # libglib2
-	depends on BR2_TOOLCHAIN_USES_GLIBC
 	depends on BR2_USE_WCHAR # libglib2
-	select BR2_PACKAGE_LIBGLIB2
+	depends on !BR2_STATIC_LIBS # spidermonkey
+	depends on !BR2_TOOLCHAIN_USES_UCLIBC # spidermonkey

All those new dependencies need to be propagated to places where "select BR2_PACKAGE_POLKIT" is used:

package/systemd/Config.in:      select BR2_PACKAGE_POLKIT
package/udisks/Config.in:       select BR2_PACKAGE_POLKIT

package/polkit/Config.in line 12

Quoted 1 line
package/polkit/Config.in +1 -0
+	select BR2_PACKAGE_DBUS # runtime

So D-Bus is a runtime dependency.

Quoted 12 lines
package/polkit/S50polkit new file +6 -0
new file mode 100644
index 0000000000..69b71ee500
@@ -0,0 +1,16 @@
+#!/bin/sh
+#
+# Start polkitd
+#
+
+umask 077

package/polkit/S50polkit line 16

Quoted 10 lines
package/polkit/S50polkit new file +10 -0
+
+case "$1" in
+  start)
+  echo "Starting polkitd..."
+  /usr/lib/polkit-1/polkitd --no-debug &
+  ;;
+  *)
+  echo "Usage: $0 {start}"
+  exit 1
+esac

Please provide a complete startup script, which follows the template at package/busybox/S01syslogd, and uses start-stop-daemon. Since there was no startup script so far, I would suggest to add it in a separate commit. Ditto for the systemd unit. They are independent from the version bump.

package/polkit/S50polkit

Quoted 4 lines

POLKIT_INSTALL_STAGING = YES

package/polkit/S50polkit new file +1 -1
-POLKIT_DEPENDENCIES = libglib2 host-intltool expat
+POLKIT_DEPENDENCIES = libglib2 host-intltool expat dbus spidermonkey

So D-Bus is a build time dependency, or a runtime-dependency ?

Quoted 4 lines

# We could also support --with-authfw=pam
POLKIT_CONF_OPTS = \

package/polkit/S50polkit new file +0 -0
 	--with-authfw=shadow \

package/polkit/S50polkit

Quoted 10 lines
package/polkit/S50polkit new file +7 -1
 	--with-os-type=unknown \
 	--disable-man-pages \
-	--disable-examples
+	--disable-examples \
+	--disable-libelogind \
+	--disable-libsystemd-login
+
+define POLKIT_USERS
+	polkitd -1 polkitd -1 * /usr/lib/polkit-1 /bin/sh - Polkit Daemon
+endef

Is this related to the version bump ?

Thanks!

Thomas

Signature · 3 lines
Thomas Petazzoni, CTO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
#5 lore raw

PATCH v3 3/4 package/polkit: support different authentication frameworks

In reply to aduskett at gmail.com

From: Adam Duskett <[email protected]>

Use pam if available, otherwise use shadow.

---
 package/polkit/polkit.mk | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)
package/polkit/polkit.mk +6 -2
index 96af4033ff..725db85471 100644
@@ -13,15 +13,19 @@ POLKIT_INSTALL_STAGING = YES
 
 POLKIT_DEPENDENCIES = libglib2 host-intltool expat dbus spidermonkey
 
-# We could also support --with-authfw=pam
 POLKIT_CONF_OPTS = \
-	--with-authfw=shadow \
 	--with-os-type=unknown \
 	--disable-man-pages \
 	--disable-examples \
 	--disable-libelogind \
 	--disable-libsystemd-login
 
+ifeq ($(BR2_PACKAGE_LINUX_PAM),y)
+POLKIT_CONF_OPTS += --with-authfw=pam
+else
+POLKIT_CONF_OPTS += --with-authfw=shadow
+endif
+
 define POLKIT_USERS
 	polkitd -1 polkitd -1 * /usr/lib/polkit-1 /bin/sh - Polkit Daemon
 endef
Signature · 1 line
2.23.0
#6 lore raw

PATCH v3 4/4 package/polkit: enable systemd login support

In reply to aduskett at gmail.com

From: Adam Duskett <[email protected]>

If systemd-logind is selected, enable libsystemd-login support.

---
Changes v2 -> v3:
- Change --enable-libsystemd-login=yes to
--enable-libsystemd-login (Thomas)

 package/polkit/polkit.mk | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)
package/polkit/polkit.mk +8 -2
index 725db85471..899c157b40 100644
@@ -17,8 +17,7 @@ POLKIT_CONF_OPTS = \
 	--with-os-type=unknown \
 	--disable-man-pages \
 	--disable-examples \
-	--disable-libelogind \
-	--disable-libsystemd-login
+	--disable-libelogind
 
 ifeq ($(BR2_PACKAGE_LINUX_PAM),y)
 POLKIT_CONF_OPTS += --with-authfw=pam
@@ -26,6 +25,13 @@ else
 POLKIT_CONF_OPTS += --with-authfw=shadow
 endif
 
+ifeq ($(BR2_PACKAGE_SYSTEMD_LOGIND),y)
+POLKIT_DEPENDENCIES += systemd
+POLKIT_CONF_OPTS += --enable-libsystemd-login
+else
+POLKIT_CONF_OPTS += --disable-libsystemd-login
+endif
+
 define POLKIT_USERS
 	polkitd -1 polkitd -1 * /usr/lib/polkit-1 /bin/sh - Polkit Daemon
 endef
Signature · 1 line
2.23.0
#7 lore raw

PATCH v3 4/4 package/polkit: enable systemd login support

Hello Adam,

package/polkit/polkit.mk else · line 29

Quoted 8 lines · On Mon, 25 Nov 2019 09:50:31 -0800 aduskett at gmail.com wrote:

ifeq ($(BR2_PACKAGE_LINUX_PAM),y)
POLKIT_CONF_OPTS += --with-authfw=pam

package/polkit/polkit.mk +2 -0
@@ -26,6 +25,13 @@ else
 POLKIT_CONF_OPTS += --with-authfw=shadow
 endif
 
+ifeq ($(BR2_PACKAGE_SYSTEMD_LOGIND),y)
+POLKIT_DEPENDENCIES += systemd

systemd has an optional dependency on polkit, and here you are adding an optional dependency of polkit on systemd. This is not going to work well.

Thomas

Signature · 3 lines
Thomas Petazzoni, CTO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com