Merge pull request #97984 from berbiche/erlang-mk-flags

build-erlang-mk: add support for buildFlags, preserve buildInputs
This commit is contained in:
Timo Kaufmann 2020-11-24 23:42:09 +01:00 committed by GitHub
commit b3e4d34658
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -12,6 +12,7 @@
, configurePhase ? null
, meta ? {}
, enableDebugInfo ? false
, buildFlags ? []
, ... }@attrs:
with stdenv.lib;
@ -39,9 +40,13 @@ let
''
else setupHook;
buildInputs = [ erlang perl which gitMinimal wget ];
buildInputs = buildInputs ++ [ erlang perl which gitMinimal wget ];
propagatedBuildInputs = beamDeps;
buildFlags = [ "SKIP_DEPS=1" ]
++ lib.optional (enableDebugInfo || erlang.debugInfo) ''ERL_OPTS="$ERL_OPTS +debug_info"''
++ buildFlags;
configurePhase = if configurePhase == null
then ''
runHook preConfigure
@ -58,7 +63,7 @@ let
then ''
runHook preBuild
make SKIP_DEPS=1 ERL_OPTS="$ERL_OPTS ${debugInfoFlag}"
make $buildFlags "''${buildFlagsArray[@]}"
runHook postBuild
''