git.iko.soy/typeable/nixpkgs
on master help sign in
buildRebar3: fix buildPhase & cleanup (#22744)
commit979d20794d8651d7ac5c86ad37b68eacbadc5cc1 authorEric Sagnes <eric.sagnes@gmail.com> dateSat 18 Feb 2017, 22:25 (10 years ago) parent8a6fa4a
1 file changed+13−17
pkgs/development/beam-modules/build-rebar3.nix+13−17
pkgs/development/beam-modules/build-rebar3.nix+13−17
@@ -26,6 +26,10 @@ let
2626 buildInputs = [ drv ];
2727 };
2828
29+ customPhases = filterAttrs
30+ (_: v: v != null)
31+ { inherit setupHook configurePhase buildPhase installPhase; };
32+
2933 pkg = self: stdenv.mkDerivation (attrs // {
3034
3135 name = "${name}-${version}";
@@ -41,37 +45,30 @@ let
4145
4246 inherit src;
4347
44− setupHook = if setupHook == null
45− then writeText "setupHook.sh" ''
48+ setupHook = writeText "setupHook.sh" ''
4649 addToSearchPath ERL_LIBS "$1/lib/erlang/lib/"
47− ''
48− else setupHook;
50+ '';
4951
5052 postPatch = ''
5153 rm -f rebar rebar3
5254 '' + postPatch;
5355
54− configurePhase = if configurePhase == null
55− then ''
56+ configurePhase = ''
5657 runHook preConfigure
5758 ${erlang}/bin/escript ${rebar3.bootstrapper} ${debugInfoFlag}
5859 runHook postConfigure
59− ''
60− else configurePhase;
60+ '';
6161
62− buildPhase = if buildPhase == null
63− then ''
62+ buildPhase = ''
6463 runHook preBuild
6564 HOME=. rebar3 compile
6665 ${if compilePorts then ''
6766 HOME=. rebar3 pc compile
6867 '' else ''''}
6968 runHook postBuild
70− ''
71− else installPhase;
69+ '';
7270
73− installPhase = if installPhase == null
74− then ''
71+ installPhase = ''
7572 runHook preInstall
7673 mkdir -p "$out/lib/erlang/lib/${name}-${version}"
7774 for reldir in src ebin priv include; do
@@ -81,8 +78,7 @@ let
8178 success=1
8279 done
8380 runHook postInstall
84− ''
85− else installPhase;
81+ '';
8682
8783 meta = {
8884 inherit (erlang.meta) platforms;
@@ -93,6 +89,6 @@ let
9389 env = shell self;
9490 inherit beamDeps;
9591 };
96− });
92+ } // customPhases);
9793in
9894 fix pkg