1 { stdenv, writeText, erlang, perl, which, gitMinimal, wget, lib }:
10 , compilePorts ? false
13 , configurePhase ? null
15 , enableDebugInfo ? false
21 debugInfoFlag = lib.optionalString (enableDebugInfo || erlang.debugInfo) "+debug_info";
23 shell = drv: stdenv.mkDerivation {
24 name = "interactive-shell-${drv.name}";
25 buildInputs = [ drv ];
28 pkg = self: stdenv.mkDerivation (attrs // {
30 name = "${name}-${version}";
40 writeText "setupHook.sh" ''
41 addToSearchPath ERL_LIBS "$1/lib/erlang/lib"
45 buildInputs = buildInputs ++ [ erlang perl which gitMinimal wget ];
46 propagatedBuildInputs = beamDeps;
48 buildFlags = [ "SKIP_DEPS=1" ]
49 ++ lib.optional (enableDebugInfo || erlang.debugInfo) ''ERL_OPTS="$ERL_OPTS +debug_info"''
53 if configurePhase == null
57 # We shouldnt need to do this, but it seems at times there is a *.app in
58 # the repo/package. This ensures we start from a clean slate
59 make SKIP_DEPS=1 clean
70 make $buildFlags "''${buildFlagsArray[@]}"
77 if installPhase == null
81 mkdir -p $out/lib/erlang/lib/${name}
82 cp -r ebin $out/lib/erlang/lib/${name}/
83 cp -r src $out/lib/erlang/lib/${name}/
85 if [ -d include ]; then
86 cp -r include $out/lib/erlang/lib/${name}/
90 cp -r priv $out/lib/erlang/lib/${name}/
94 cp -r doc $out/lib/erlang/lib/${name}/