diff --git a/pkgs/development/interpreters/erlang/generic-builder.nix b/pkgs/development/interpreters/erlang/generic-builder.nix index bc0b728ecce4b..e7c1a341856b3 100644 --- a/pkgs/development/interpreters/erlang/generic-builder.nix +++ b/pkgs/development/interpreters/erlang/generic-builder.nix @@ -4,6 +4,7 @@ , unixODBC ? null # odbcSupport , libGLU_combined ? null, wxGTK ? null, wxmac ? null, xorg ? null # wxSupport , withSystemd ? stdenv.isLinux, systemd # systemd support in epmd +, buildPackages }: { baseName ? "erlang" @@ -41,6 +42,8 @@ let inherit (stdenv.lib) optional optionals optionalAttrs optionalString; wxPackages2 = if stdenv.isDarwin then [ wxmac ] else wxPackages; + isCross = stdenv.hostPlatform != stdenv.buildPlatform; + in stdenv.mkDerivation ({ name = "${baseName}-${version}" + optionalString javacSupport "-javac" @@ -48,7 +51,15 @@ in stdenv.mkDerivation ({ inherit src version; - nativeBuildInputs = [ autoreconfHook makeWrapper perl gnum4 libxslt libxml2 ]; + nativeBuildInputs = [ + buildPackages.autoreconfHook + buildPackages.makeWrapper + buildPackages.perl + buildPackages.gnum4 + buildPackages.libxslt + buildPackages.libxml2 + ] + ++ optional isCross buildPackages.erlang; buildInputs = [ ncurses openssl ] ++ optionals wxSupport wxPackages2 @@ -83,7 +94,7 @@ in stdenv.mkDerivation ({ ++ optional enableThreads "--enable-threads" ++ optional enableSmpSupport "--enable-smp-support" ++ optional enableKernelPoll "--enable-kernel-poll" - ++ optional enableHipe "--enable-hipe" + ++ optional (enableHipe && !isCross) "--enable-hipe" ++ optional javacSupport "--with-javac" ++ optional odbcSupport "--with-odbc=${unixODBC}" ++ optional wxSupport "--enable-wx"