Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

spidermonkey_52: cross compilation #58049

Merged
merged 1 commit into from
Apr 16, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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" ];

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