Skip to content

Commit

Permalink
spidermonkey_52: cross compilation
Browse files Browse the repository at this point in the history
  • Loading branch information
illegalprime authored and FRidh committed Apr 16, 2019
1 parent d8d8a9c commit ad7e587
Showing 1 changed file with 12 additions and 4 deletions.
16 changes: 12 additions & 4 deletions pkgs/development/interpreters/spidermonkey/52.nix
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{ stdenv, fetchurl, fetchpatch, autoconf213, pkgconfig, perl, python2, zip, which, readline, icu, zlib, nspr }:
{ stdenv, fetchurl, fetchpatch, autoconf213, pkgconfig, perl, python2, zip, which, readline, icu, zlib, nspr, buildPackages }:

let
version = "52.9.0";
Expand All @@ -14,7 +14,7 @@ in stdenv.mkDerivation rec {
setOutputFlags = false; # Configure script only understands --includedir

buildInputs = [ readline icu zlib nspr ];
nativeBuildInputs = [ autoconf213 pkgconfig perl which python2 zip ];
nativeBuildInputs = [ autoconf213 pkgconfig perl which buildPackages.python2 zip ];

# Apparently this package fails to build correctly with modern compilers, which at least
# on ARMv6 causes polkit testsuite to break with an assertion failure in spidermonkey.
Expand All @@ -31,10 +31,12 @@ in stdenv.mkDerivation rec {
})
];

configurePlatforms = [ "host" "target" ];

This comment has been minimized.

Copy link
@matthewbauer

matthewbauer Apr 18, 2019

Member

@illegalprime This looks like the offending line. spidermonkey should just need build and host.


preConfigure = ''
export CXXFLAGS="-fpermissive"
export LIBXUL_DIST=$out
export PYTHON="${python2.interpreter}"
export PYTHON="${buildPackages.python2.interpreter}"
configureFlagsArray+=("--includedir=$dev/include")
cd js/src
Expand All @@ -43,14 +45,20 @@ in stdenv.mkDerivation rec {
'';

configureFlags = [
"--with-system-nspr"
"--with-nspr-prefix=${nspr}"
"--with-system-zlib"
"--with-system-icu"
"--with-intl-api"
"--enable-readline"
"--enable-shared-js"
] ++ stdenv.lib.optional stdenv.hostPlatform.isMusl "--disable-jemalloc";

makeFlags = [
"HOST_CC=${buildPackages.stdenv.cc}/bin/cc"
];

depsBuildBuild = [ buildPackages.stdenv.cc ];

enableParallelBuilding = true;

postInstall = ''
Expand Down

1 comment on commit ad7e587

@matthewbauer
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Getting this for android stuff:

https://hydra.nixos.org/build/92297058

Please sign in to comment.