From 5a558ea4d9a99f10440dfdb738e726ea09be51dd Mon Sep 17 00:00:00 2001 From: Nicolas Berbiche Date: Mon, 14 Sep 2020 12:48:14 -0400 Subject: [PATCH] build-erlang-mk: add support for buildFlags --- pkgs/development/beam-modules/build-erlang-mk.nix | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/pkgs/development/beam-modules/build-erlang-mk.nix b/pkgs/development/beam-modules/build-erlang-mk.nix index 4dedf782b753..4ea8a52601c6 100644 --- a/pkgs/development/beam-modules/build-erlang-mk.nix +++ b/pkgs/development/beam-modules/build-erlang-mk.nix @@ -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 ''