1 { stdenv, writeText, erlang, perl, which, gitMinimal, wget, lib }:
12 , configurePhase ? null
14 , 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}";
37 setupHook = if setupHook == null
38 then writeText "setupHook.sh" ''
39 addToSearchPath ERL_LIBS "$1/lib/erlang/lib"
43 buildInputs = buildInputs ++ [ erlang perl which gitMinimal wget ];
44 propagatedBuildInputs = beamDeps;
46 buildFlags = [ "SKIP_DEPS=1" ]
47 ++ lib.optional (enableDebugInfo || erlang.debugInfo) ''ERL_OPTS="$ERL_OPTS +debug_info"''
50 configurePhase = if configurePhase == null
54 # We shouldnt need to do this, but it seems at times there is a *.app in
55 # the repo/package. This ensures we start from a clean slate
56 make SKIP_DEPS=1 clean
62 buildPhase = if buildPhase == null
66 make $buildFlags "''${buildFlagsArray[@]}"
72 installPhase = if installPhase == null
76 mkdir -p $out/lib/erlang/lib/${name}
77 cp -r ebin $out/lib/erlang/lib/${name}/
78 cp -r src $out/lib/erlang/lib/${name}/
80 if [ -d include ]; then
81 cp -r include $out/lib/erlang/lib/${name}/
85 cp -r priv $out/lib/erlang/lib/${name}/
89 cp -r doc $out/lib/erlang/lib/${name}/