build-erlang-mk: add support for buildFlags

This commit is contained in:
Nicolas Berbiche 2020-09-14 12:48:14 -04:00
parent 79b9007c94
commit 5a558ea4d9

View file

@ -12,6 +12,7 @@
, configurePhase ? null
, meta ? {}
, enableDebugInfo ? false
, buildFlags ? []
, ... }@attrs:
with stdenv.lib;
@ -42,6 +43,10 @@ let
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
''