about summary refs log tree commit diff
path: root/pkgs/development/beam-modules/build-erlang-mk.nix
diff options
context:
space:
mode:
authorEric Merritt <eric@sunlightpayments.com>2016-06-15 07:15:06 -0700
committerEric Merritt <eric@merritt.tech>2016-06-15 07:20:01 -0700
commitb1cd08246fa51d3b018ae92f1e58a79844e44859 (patch)
tree27b0d7aab28a687d0f0d81c32204e454bc09707e /pkgs/development/beam-modules/build-erlang-mk.nix
parentde4013367349b38ca44ea59805640b76a2f01102 (diff)
downloadnixlib-b1cd08246fa51d3b018ae92f1e58a79844e44859.tar
nixlib-b1cd08246fa51d3b018ae92f1e58a79844e44859.tar.gz
nixlib-b1cd08246fa51d3b018ae92f1e58a79844e44859.tar.bz2
nixlib-b1cd08246fa51d3b018ae92f1e58a79844e44859.tar.lz
nixlib-b1cd08246fa51d3b018ae92f1e58a79844e44859.tar.xz
nixlib-b1cd08246fa51d3b018ae92f1e58a79844e44859.tar.zst
nixlib-b1cd08246fa51d3b018ae92f1e58a79844e44859.zip
beamPackages: turn on debug_info for beam packages
This allows you to turn on debug infor for all the beam packages in the
system with a single change at the top level. This is required for
debugging and dialyzer work. It also allows you to switch it on on a
package by package basis.
Diffstat (limited to 'pkgs/development/beam-modules/build-erlang-mk.nix')
-rw-r--r--pkgs/development/beam-modules/build-erlang-mk.nix7
1 files changed, 5 insertions, 2 deletions
diff --git a/pkgs/development/beam-modules/build-erlang-mk.nix b/pkgs/development/beam-modules/build-erlang-mk.nix
index ef966ebd04f7..110c06e6f8ad 100644
--- a/pkgs/development/beam-modules/build-erlang-mk.nix
+++ b/pkgs/development/beam-modules/build-erlang-mk.nix
@@ -1,4 +1,4 @@
-{ stdenv, writeText, erlang, perl, which, gitMinimal, wget }:
+{ stdenv, writeText, erlang, perl, which, gitMinimal, wget, lib }:
 
 { name, version
 , src
@@ -11,11 +11,14 @@
 , buildPhase ? null
 , configurePhase ? null
 , meta ? {}
+, enableDebugInfo ? false
 , ... }@attrs:
 
 with stdenv.lib;
 
 let
+  debugInfoFlag = lib.optionalString (enableDebugInfo || erlang.debugInfo) "+debug_info";
+
   shell = drv: stdenv.mkDerivation {
           name = "interactive-shell-${drv.name}";
           buildInputs = [ drv ];
@@ -55,7 +58,7 @@ let
     then ''
         runHook preBuild
 
-        make SKIP_DEPS=1
+        make SKIP_DEPS=1 ERL_OPTS="$ERL_OPTS ${debugInfoFlag}"
 
         runHook postBuild
     ''