spidermonkey_*: fix build under macOS

This commit is contained in:
Kirill A. Korinsky 2022-07-08 21:50:38 +02:00 committed by Jan Tojnar
parent f6c8d04c78
commit 60259663a4
4 changed files with 86 additions and 4 deletions

View File

@ -0,0 +1,40 @@
From a26bb162d9403138d64b84e8fa4f0471084c45b2 Mon Sep 17 00:00:00 2001
From: "Kirill A. Korinsky" <kirill@korins.ky>
Date: Fri, 8 Jul 2022 21:21:25 +0200
Subject: [PATCH] Allow system's nspr and icu on bootstrapped sysroot
This patch partially reverts https://github.com/mozilla/gecko-dev/commit/9aa3587bbf0416dd2eb5b614f7b301c71c64286b
---
build/moz.configure/nspr.configure | 2 +-
js/moz.configure | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/build/moz.configure/nspr.configure b/build/moz.configure/nspr.configure
index 06f03d9bc72d..9687c84a7290 100644
--- a/build/moz.configure/nspr.configure
+++ b/build/moz.configure/nspr.configure
@@ -19,7 +19,7 @@ def enable_nspr_build(enable):
return enable
-system_lib_option("--with-system-nspr", help="Use system NSPR")
+option("--with-system-nspr", help="Use system NSPR")
@depends(enable_nspr_build, "--with-system-nspr", js_standalone)
diff --git a/js/moz.configure b/js/moz.configure
index b7ba9790425d..5ff5cb2da266 100644
--- a/js/moz.configure
+++ b/js/moz.configure
@@ -1129,7 +1129,7 @@ set_define(
# ECMAScript Internationalization API Support (uses ICU)
# ======================================================
-system_lib_option("--with-system-icu", help="Use system ICU")
+option("--with-system-icu", help="Use system ICU")
system_icu = pkg_check_modules("MOZ_ICU", "icu-i18n >= 71.1", when="--with-system-icu")
--
2.37.0

View File

@ -0,0 +1,23 @@
From 9d3f6e9ff5e66af90a5d187d902f7893fb91c24b Mon Sep 17 00:00:00 2001
From: "Kirill A. Korinsky" <kirill@korins.ky>
Date: Fri, 1 Jul 2022 12:23:37 +0200
Subject: [PATCH] Always check for pkg-config
---
build/moz.configure/pkg.configure | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/build/moz.configure/pkg.configure b/build/moz.configure/pkg.configure
index 6b460ae174eed..0056ecd7ae2d8 100644
--- a/build/moz.configure/pkg.configure
+++ b/build/moz.configure/pkg.configure
@@ -15,8 +15,7 @@ pkg_config = check_prog(
pkg_config,
bootstrap=depends(when=target_sysroot.bootstrapped)(lambda: "pkgconf"),
allow_missing=True,
- when=compile_environment
- & depends(target.os)(lambda os: os not in ("WINNT", "OSX", "Android")),
+ when=compile_environment,
)

View File

@ -19,6 +19,7 @@
, zip
, autoconf213
, yasm
, xcbuild
# runtime
, icu
@ -26,6 +27,8 @@
, nspr
, readline
, zlib
, libobjc
, libiconv
}:
stdenv.mkDerivation (finalAttrs: rec {
@ -56,6 +59,10 @@ stdenv.mkDerivation (finalAttrs: rec {
# - https://hg.mozilla.org/mozilla-central/rev/6803dda74d33
./add-riscv64-support.patch
] ++ lib.optionals (lib.versionAtLeast version "102") [
# use pkg-config at all systems
./always-check-for-pkg-config.patch
./allow-system-s-nspr-and-icu-on-bootstrapped-sysroot.patch
# Patches required by GJS
# https://discourse.gnome.org/t/gnome-43-to-depend-on-spidermonkey-102/10658
# Install ProfilingCategoryList.h
@ -84,6 +91,8 @@ stdenv.mkDerivation (finalAttrs: rec {
] ++ lib.optionals (lib.versionOlder version "91") [
autoconf213
yasm # to buid icu? seems weird
] ++ lib.optionals stdenv.isDarwin [
xcbuild
];
buildInputs = [
@ -91,6 +100,9 @@ stdenv.mkDerivation (finalAttrs: rec {
nspr
readline
zlib
] ++ lib.optionals stdenv.isDarwin [
libobjc
libiconv
];
depsBuildBuild = [
@ -152,6 +164,7 @@ stdenv.mkDerivation (finalAttrs: rec {
'' + lib.optionalString (lib.versionAtLeast version "91") ''
export M4=m4
export AWK=awk
export AS=$CC
export AC_MACRODIR=$PWD/build/autoconf/
pushd js/src
@ -181,6 +194,6 @@ stdenv.mkDerivation (finalAttrs: rec {
homepage = "https://spidermonkey.dev/";
license = licenses.mpl20; # TODO: MPL/GPL/LGPL tri-license for 78.
maintainers = with maintainers; [ abbradar lostnet catap ];
platforms = platforms.linux;
platforms = platforms.unix;
};
})

View File

@ -15114,9 +15114,15 @@ with pkgs;
sparkleshare = callPackage ../applications/version-management/sparkleshare { };
spidermonkey_78 = callPackage ../development/interpreters/spidermonkey/78.nix { };
spidermonkey_91 = callPackage ../development/interpreters/spidermonkey/91.nix { };
spidermonkey_102 = callPackage ../development/interpreters/spidermonkey/102.nix { };
spidermonkey_78 = callPackage ../development/interpreters/spidermonkey/78.nix {
inherit (darwin) libobjc;
};
spidermonkey_91 = callPackage ../development/interpreters/spidermonkey/91.nix {
inherit (darwin) libobjc;
};
spidermonkey_102 = callPackage ../development/interpreters/spidermonkey/102.nix {
inherit (darwin) libobjc;
};
ssm-agent = callPackage ../applications/networking/cluster/ssm-agent { };
ssm-session-manager-plugin = callPackage ../applications/networking/cluster/ssm-session-manager-plugin { };