-
-
Notifications
You must be signed in to change notification settings - Fork 14.8k
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
Erlang: fix cross compilation #100835
Draft
DianaOlympos
wants to merge
2
commits into
NixOS:master
Choose a base branch
from
DianaOlympos:erlang-cross
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Erlang: fix cross compilation #100835
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
@@ -1,11 +1,12 @@ | ||||||
{ pkgs, stdenv, fetchFromGitHub, makeWrapper, gawk, gnum4, gnused | ||||||
, libxml2, libxslt, ncurses, openssl, perl, autoconf | ||||||
, libxml2, libxslt, ncurses, openssl, perl, autoconf, zlib | ||||||
# TODO: use jdk https://github.com/NixOS/nixpkgs/pull/89731 | ||||||
, openjdk8 ? null # javacSupport | ||||||
, unixODBC ? null # odbcSupport | ||||||
, libGL ? null, libGLU ? null, wxGTK ? null, wxmac ? null, xorg ? null # wxSupport | ||||||
, parallelBuild ? false | ||||||
, withSystemd ? stdenv.isLinux, systemd # systemd support in epmd | ||||||
, buildPackages | ||||||
}: | ||||||
|
||||||
{ baseName ? "erlang" | ||||||
|
@@ -43,16 +44,28 @@ let | |||||
inherit (stdenv.lib) optional optionals optionalAttrs optionalString; | ||||||
wxPackages2 = if stdenv.isDarwin then [ wxmac ] else wxPackages; | ||||||
|
||||||
isCross = stdenv.hostPlatform != stdenv.buildPlatform; | ||||||
hipeSupport = (enableHipe && !isCross); | ||||||
|
||||||
in stdenv.mkDerivation ({ | ||||||
name = "${baseName}-${version}" | ||||||
+ optionalString javacSupport "-javac" | ||||||
+ optionalString odbcSupport "-odbc"; | ||||||
|
||||||
inherit src version; | ||||||
|
||||||
nativeBuildInputs = [ autoconf makeWrapper perl gnum4 libxslt libxml2 ]; | ||||||
|
||||||
buildInputs = [ ncurses openssl ] | ||||||
nativeBuildInputs = [ | ||||||
autoconf | ||||||
makeWrapper | ||||||
# seems to get a splice error finding perl if that one is not there | ||||||
buildPackages.perl | ||||||
buildPackages.libxslt | ||||||
libxml2 | ||||||
] | ||||||
++ optional hipeSupport gnum4 | ||||||
++ optional isCross buildPackages.erlang_nox; | ||||||
|
||||||
buildInputs = [ ncurses openssl zlib ] | ||||||
++ optionals wxSupport wxPackages2 | ||||||
++ optionals odbcSupport odbcPackages | ||||||
++ optionals javacSupport javacPackages | ||||||
|
@@ -65,7 +78,7 @@ in stdenv.mkDerivation ({ | |||||
enableParallelBuilding = parallelBuild; | ||||||
|
||||||
# Clang 4 (rightfully) thinks signed comparisons of pointers with NULL are nonsense | ||||||
prePatch = '' | ||||||
prePatch = optional wxSupport '' | ||||||
substituteInPlace lib/wx/c_src/wxe_impl.cpp --replace 'temp > NULL' 'temp != NULL' | ||||||
|
||||||
${prePatch} | ||||||
|
@@ -85,12 +98,13 @@ in stdenv.mkDerivation ({ | |||||
++ optional enableThreads "--enable-threads" | ||||||
++ optional enableSmpSupport "--enable-smp-support" | ||||||
++ optional enableKernelPoll "--enable-kernel-poll" | ||||||
++ optional enableHipe "--enable-hipe" | ||||||
++ optional hipeSupport "--enable-hipe" | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
But honestly I would prefer an asset and throw here because people will be confused why hipe is disabled when cross compiling. |
||||||
++ optional javacSupport "--with-javac" | ||||||
++ optional odbcSupport "--with-odbc=${unixODBC}" | ||||||
++ optional wxSupport "--enable-wx" | ||||||
++ optional withSystemd "--enable-systemd" | ||||||
++ optional stdenv.isDarwin "--enable-darwin-64bit" | ||||||
++ optional isCross "erl_xcomp_sysroot=${stdenv.cc.libc}" | ||||||
++ configureFlags; | ||||||
|
||||||
# install-docs will generate and install manpages and html docs | ||||||
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.