From 18f2a534c21a944c1cebd4739e621f5c7ead46dd Mon Sep 17 00:00:00 2001 From: Matthew Bauer Date: Fri, 15 Jun 2018 18:12:15 -0400 Subject: [PATCH] spidermonkey_17: get darwin working LLVM building is apparently broken. This is a similar fix to what was done in spidermonkey_38. enableReadline flag is also introduced (defaults to true except on darwin). --- pkgs/development/interpreters/spidermonkey/17.nix | 14 +++++++++----- pkgs/top-level/all-packages.nix | 5 ++++- 2 files changed, 13 insertions(+), 6 deletions(-) diff --git a/pkgs/development/interpreters/spidermonkey/17.nix b/pkgs/development/interpreters/spidermonkey/17.nix index 9c47ebe79b6e..e2eef0fab695 100644 --- a/pkgs/development/interpreters/spidermonkey/17.nix +++ b/pkgs/development/interpreters/spidermonkey/17.nix @@ -1,4 +1,6 @@ -{ stdenv, fetchurl, pkgconfig, nspr, perl, python2, zip, libffi, readline }: +{ stdenv, fetchurl, pkgconfig, nspr, perl, python2, zip, libffi +, enableReadline ? (!stdenv.isDarwin), readline +, libobjc }: stdenv.mkDerivation rec { version = "17.0.0"; @@ -14,7 +16,9 @@ stdenv.mkDerivation rec { propagatedBuildInputs = [ nspr ]; nativeBuildInputs = [ pkgconfig ]; - buildInputs = [ perl python2 zip libffi readline ]; + buildInputs = [ perl python2 zip libffi readline ] + ++ stdenv.lib.optional enableReadline readline + ++ stdenv.lib.optional stdenv.isDarwin libobjc; postUnpack = "sourceRoot=\${sourceRoot}/js/src"; @@ -48,7 +52,7 @@ stdenv.mkDerivation rec { "--enable-threadsafe" "--with-system-nspr" "--with-system-ffi" - "--enable-readline" + (if enableReadline then "--enable-readline" else "--disable-readline") ]; # hack around a make problem, see https://github.com/NixOS/nixpkgs/issues/1279#issuecomment-29547393 @@ -64,6 +68,7 @@ stdenv.mkDerivation rec { # https://lists.fedoraproject.org/pipermail/scm-commits/Week-of-Mon-20130617/1041155.html echo -e '#!${stdenv.shell}\nexit 0' > config/find_vanilla_new_calls + '' + stdenv.lib.optionalString stdenv.isLinux '' paxmark m shell/js17 paxmark mr jsapi-tests/jsapi-tests ''; @@ -78,7 +83,6 @@ stdenv.mkDerivation rec { homepage = https://developer.mozilla.org/en/SpiderMonkey; # TODO: MPL/GPL/LGPL tri-license. maintainers = [ maintainers.goibhniu ]; - platforms = platforms.linux; + platforms = platforms.unix; }; } - diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 45e62452181e..e941860fdd3e 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -7518,7 +7518,10 @@ with pkgs; spark_22 = callPackage ../applications/networking/cluster/spark { version = "2.2.1"; }; spidermonkey_1_8_5 = callPackage ../development/interpreters/spidermonkey/1.8.5.nix { }; - spidermonkey_17 = callPackage ../development/interpreters/spidermonkey/17.nix { }; + spidermonkey_17 = callPackage ../development/interpreters/spidermonkey/17.nix { + inherit (darwin) libobjc; + stdenv = gccStdenv; + }; spidermonkey_31 = callPackage ../development/interpreters/spidermonkey/31.nix { }; spidermonkey_38 = callPackage ../development/interpreters/spidermonkey/38.nix ({ inherit (darwin) libobjc;